diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2008-10-20 13:01:59 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2009-01-06 11:53:45 -0500 |
commit | b3d47676d474ecd914c72049c87e71e5f0ffe040 (patch) | |
tree | cdf0016aac0fc81abe75aac56f5349022d2fd2e5 /fs/nfsd/nfsfh.c | |
parent | 238c6d54830c624f34ac9cf123ac04aebfca5013 (diff) |
nfsd: update fh_verify description
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/nfsd/nfsfh.c')
-rw-r--r-- | fs/nfsd/nfsfh.c | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c index f0da7d9c3a92..019a8a20184d 100644 --- a/fs/nfsd/nfsfh.c +++ b/fs/nfsd/nfsfh.c | |||
@@ -258,14 +258,32 @@ out: | |||
258 | return error; | 258 | return error; |
259 | } | 259 | } |
260 | 260 | ||
261 | /* | 261 | /** |
262 | * Perform sanity checks on the dentry in a client's file handle. | 262 | * fh_verify - filehandle lookup and access checking |
263 | * @rqstp: pointer to current rpc request | ||
264 | * @fhp: filehandle to be verified | ||
265 | * @type: expected type of object pointed to by filehandle | ||
266 | * @access: type of access needed to object | ||
267 | * | ||
268 | * Look up a dentry from the on-the-wire filehandle, check the client's | ||
269 | * access to the export, and set the current task's credentials. | ||
270 | * | ||
271 | * Regardless of success or failure of fh_verify(), fh_put() should be | ||
272 | * called on @fhp when the caller is finished with the filehandle. | ||
273 | * | ||
274 | * fh_verify() may be called multiple times on a given filehandle, for | ||
275 | * example, when processing an NFSv4 compound. The first call will look | ||
276 | * up a dentry using the on-the-wire filehandle. Subsequent calls will | ||
277 | * skip the lookup and just perform the other checks and possibly change | ||
278 | * the current task's credentials. | ||
263 | * | 279 | * |
264 | * Note that the file handle dentry may need to be freed even after | 280 | * @type specifies the type of object expected using one of the S_IF* |
265 | * an error return. | 281 | * constants defined in include/linux/stat.h. The caller may use zero |
282 | * to indicate that it doesn't care, or a negative integer to indicate | ||
283 | * that it expects something not of the given type. | ||
266 | * | 284 | * |
267 | * This is only called at the start of an nfsproc call, so fhp points to | 285 | * @access is formed from the NFSD_MAY_* constants defined in |
268 | * a svc_fh which is all 0 except for the over-the-wire file handle. | 286 | * include/linux/nfsd/nfsd.h. |
269 | */ | 287 | */ |
270 | __be32 | 288 | __be32 |
271 | fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access) | 289 | fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access) |