diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2019-12-10 13:30:49 +0100 |
---|---|---|
committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2020-01-15 16:15:16 +0100 |
commit | 444a52960c0f109daf78e50e2a07d1f0786e2052 (patch) | |
tree | e775d799f5f64d85adf5fd467b462240d4e67903 /fs/nfs/super.c | |
parent | Merge tag 'nfs-for-5.5-2' of git://git.linux-nfs.org/projects/anna/linux-nfs (diff) | |
download | linux-444a52960c0f109daf78e50e2a07d1f0786e2052.tar.xz linux-444a52960c0f109daf78e50e2a07d1f0786e2052.zip |
saner calling conventions for nfs_fs_mount_common()
Allow it to take ERR_PTR() for server and return ERR_CAST() of it in
such case. All callers used to open-code that...
Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'fs/nfs/super.c')
-rw-r--r-- | fs/nfs/super.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 8d8d04bb9d64..f074c3773f0e 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -1903,9 +1903,6 @@ struct dentry *nfs_try_mount(int flags, const char *dev_name, else server = nfs_mod->rpc_ops->create_server(mount_info, nfs_mod); - if (IS_ERR(server)) - return ERR_CAST(server); - return nfs_fs_mount_common(server, flags, dev_name, mount_info, nfs_mod); } EXPORT_SYMBOL_GPL(nfs_try_mount); @@ -2666,6 +2663,9 @@ struct dentry *nfs_fs_mount_common(struct nfs_server *server, }; int error; + if (IS_ERR(server)) + return ERR_CAST(server); + if (server->flags & NFS_MOUNT_UNSHARED) compare_super = NULL; @@ -2814,10 +2814,7 @@ nfs_xdev_mount(struct file_system_type *fs_type, int flags, /* create a new volume representation */ server = nfs_mod->rpc_ops->clone_server(NFS_SB(data->sb), data->fh, data->fattr, data->authflavor); - if (IS_ERR(server)) - mntroot = ERR_CAST(server); - else - mntroot = nfs_fs_mount_common(server, flags, + mntroot = nfs_fs_mount_common(server, flags, dev_name, &mount_info, nfs_mod); dprintk("<-- nfs_xdev_mount() = %ld\n", |