diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2013-03-16 15:55:45 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-03-29 15:44:12 -0400 |
commit | 2ed4b95b7ee5e5bcf77576ce5df4d7036584cd3c (patch) | |
tree | 86296c4d572f1db0b9668cce684137a970b4b8a3 /fs/nfs | |
parent | 75bc8821bd9ae76f2ffb92a46f7abdbb0aaa0536 (diff) |
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>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/nfs4proc.c | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index f462dd884385..173c988177e3 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -2547,24 +2547,36 @@ static int nfs4_find_root_sec(struct nfs_server *server, struct nfs_fh *fhandle, | |||
2547 | return status; | 2547 | return status; |
2548 | } | 2548 | } |
2549 | 2549 | ||
2550 | /* | 2550 | static int nfs4_do_find_root_sec(struct nfs_server *server, |
2551 | * get the file handle for the "/" directory on the server | 2551 | struct nfs_fh *fhandle, struct nfs_fsinfo *info) |
2552 | { | ||
2553 | int mv = server->nfs_client->cl_minorversion; | ||
2554 | return nfs_v4_minor_ops[mv]->find_root_sec(server, fhandle, info); | ||
2555 | } | ||
2556 | |||
2557 | /** | ||
2558 | * nfs4_proc_get_rootfh - get file handle for server's pseudoroot | ||
2559 | * @server: initialized nfs_server handle | ||
2560 | * @fhandle: we fill in the pseudo-fs root file handle | ||
2561 | * @info: we fill in an FSINFO struct | ||
2562 | * | ||
2563 | * Returns zero on success, or a negative errno. | ||
2552 | */ | 2564 | */ |
2553 | int nfs4_proc_get_rootfh(struct nfs_server *server, struct nfs_fh *fhandle, | 2565 | int nfs4_proc_get_rootfh(struct nfs_server *server, struct nfs_fh *fhandle, |
2554 | struct nfs_fsinfo *info) | 2566 | struct nfs_fsinfo *info) |
2555 | { | 2567 | { |
2556 | int minor_version = server->nfs_client->cl_minorversion; | 2568 | int status; |
2557 | int status = nfs4_lookup_root(server, fhandle, info); | 2569 | |
2558 | if ((status == -NFS4ERR_WRONGSEC) && !(server->flags & NFS_MOUNT_SECFLAVOUR)) | 2570 | status = nfs4_lookup_root(server, fhandle, info); |
2559 | /* | 2571 | if ((status == -NFS4ERR_WRONGSEC) && |
2560 | * A status of -NFS4ERR_WRONGSEC will be mapped to -EPERM | 2572 | !(server->flags & NFS_MOUNT_SECFLAVOUR)) |
2561 | * by nfs4_map_errors() as this function exits. | 2573 | status = nfs4_do_find_root_sec(server, fhandle, info); |
2562 | */ | 2574 | |
2563 | status = nfs_v4_minor_ops[minor_version]->find_root_sec(server, fhandle, info); | ||
2564 | if (status == 0) | 2575 | if (status == 0) |
2565 | status = nfs4_server_capabilities(server, fhandle); | 2576 | status = nfs4_server_capabilities(server, fhandle); |
2566 | if (status == 0) | 2577 | if (status == 0) |
2567 | status = nfs4_do_fsinfo(server, fhandle, info); | 2578 | status = nfs4_do_fsinfo(server, fhandle, info); |
2579 | |||
2568 | return nfs4_map_errors(status); | 2580 | return nfs4_map_errors(status); |
2569 | } | 2581 | } |
2570 | 2582 | ||