mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-25 10:19:47 +00:00
NFS: Clean up nfs4_proc_get_rootfh
The long lines with no vertical white space make this function difficult for humans to read. Add a proper documenting comment while we're here. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Cc: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
parent
75bc8821bd
commit
2ed4b95b7e
1 changed files with 22 additions and 10 deletions
|
@ -2547,24 +2547,36 @@ static int nfs4_find_root_sec(struct nfs_server *server, struct nfs_fh *fhandle,
|
|||
return status;
|
||||
}
|
||||
|
||||
/*
|
||||
* get the file handle for the "/" directory on the server
|
||||
static int nfs4_do_find_root_sec(struct nfs_server *server,
|
||||
struct nfs_fh *fhandle, struct nfs_fsinfo *info)
|
||||
{
|
||||
int mv = server->nfs_client->cl_minorversion;
|
||||
return nfs_v4_minor_ops[mv]->find_root_sec(server, fhandle, info);
|
||||
}
|
||||
|
||||
/**
|
||||
* nfs4_proc_get_rootfh - get file handle for server's pseudoroot
|
||||
* @server: initialized nfs_server handle
|
||||
* @fhandle: we fill in the pseudo-fs root file handle
|
||||
* @info: we fill in an FSINFO struct
|
||||
*
|
||||
* Returns zero on success, or a negative errno.
|
||||
*/
|
||||
int nfs4_proc_get_rootfh(struct nfs_server *server, struct nfs_fh *fhandle,
|
||||
struct nfs_fsinfo *info)
|
||||
{
|
||||
int minor_version = server->nfs_client->cl_minorversion;
|
||||
int status = nfs4_lookup_root(server, fhandle, info);
|
||||
if ((status == -NFS4ERR_WRONGSEC) && !(server->flags & NFS_MOUNT_SECFLAVOUR))
|
||||
/*
|
||||
* A status of -NFS4ERR_WRONGSEC will be mapped to -EPERM
|
||||
* by nfs4_map_errors() as this function exits.
|
||||
*/
|
||||
status = nfs_v4_minor_ops[minor_version]->find_root_sec(server, fhandle, info);
|
||||
int status;
|
||||
|
||||
status = nfs4_lookup_root(server, fhandle, info);
|
||||
if ((status == -NFS4ERR_WRONGSEC) &&
|
||||
!(server->flags & NFS_MOUNT_SECFLAVOUR))
|
||||
status = nfs4_do_find_root_sec(server, fhandle, info);
|
||||
|
||||
if (status == 0)
|
||||
status = nfs4_server_capabilities(server, fhandle);
|
||||
if (status == 0)
|
||||
status = nfs4_do_fsinfo(server, fhandle, info);
|
||||
|
||||
return nfs4_map_errors(status);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue