mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-29 10:01:25 +00:00
[PATCH] knfsd: nfsd4: clarify units of COMPOUND_SLACK_SPACE
A comment here incorrectly states that "slack_space" is measured in words, not bytes. Remove the comment, and adjust a variable name and a few comments to clarify the situation. This is pure cleanup; there should be no change in functionality. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
b797b5beac
commit
e571019911
2 changed files with 7 additions and 7 deletions
|
@ -740,7 +740,7 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
|
||||||
struct svc_fh *current_fh = NULL;
|
struct svc_fh *current_fh = NULL;
|
||||||
struct svc_fh *save_fh = NULL;
|
struct svc_fh *save_fh = NULL;
|
||||||
struct nfs4_stateowner *replay_owner = NULL;
|
struct nfs4_stateowner *replay_owner = NULL;
|
||||||
int slack_space; /* in words, not bytes! */
|
int slack_bytes;
|
||||||
__be32 status;
|
__be32 status;
|
||||||
|
|
||||||
status = nfserr_resource;
|
status = nfserr_resource;
|
||||||
|
@ -790,10 +790,10 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
|
||||||
* failed response to the next operation. If we don't
|
* failed response to the next operation. If we don't
|
||||||
* have enough room, fail with ERR_RESOURCE.
|
* have enough room, fail with ERR_RESOURCE.
|
||||||
*/
|
*/
|
||||||
/* FIXME - is slack_space *really* words, or bytes??? - neilb */
|
slack_bytes = (char *)resp->end - (char *)resp->p;
|
||||||
slack_space = (char *)resp->end - (char *)resp->p;
|
if (slack_bytes < COMPOUND_SLACK_SPACE
|
||||||
if (slack_space < COMPOUND_SLACK_SPACE + COMPOUND_ERR_SLACK_SPACE) {
|
+ COMPOUND_ERR_SLACK_SPACE) {
|
||||||
BUG_ON(slack_space < COMPOUND_ERR_SLACK_SPACE);
|
BUG_ON(slack_bytes < COMPOUND_ERR_SLACK_SPACE);
|
||||||
op->status = nfserr_resource;
|
op->status = nfserr_resource;
|
||||||
goto encode_op;
|
goto encode_op;
|
||||||
}
|
}
|
||||||
|
|
|
@ -275,12 +275,12 @@ static inline int is_fsid(struct svc_fh *fh, struct knfsd_fh *reffh)
|
||||||
* we might process an operation with side effects, and be unable to
|
* we might process an operation with side effects, and be unable to
|
||||||
* tell the client that the operation succeeded.
|
* tell the client that the operation succeeded.
|
||||||
*
|
*
|
||||||
* COMPOUND_SLACK_SPACE - this is the minimum amount of buffer space
|
* COMPOUND_SLACK_SPACE - this is the minimum bytes of buffer space
|
||||||
* needed to encode an "ordinary" _successful_ operation. (GETATTR,
|
* needed to encode an "ordinary" _successful_ operation. (GETATTR,
|
||||||
* READ, READDIR, and READLINK have their own buffer checks.) if we
|
* READ, READDIR, and READLINK have their own buffer checks.) if we
|
||||||
* fall below this level, we fail the next operation with NFS4ERR_RESOURCE.
|
* fall below this level, we fail the next operation with NFS4ERR_RESOURCE.
|
||||||
*
|
*
|
||||||
* COMPOUND_ERR_SLACK_SPACE - this is the minimum amount of buffer space
|
* COMPOUND_ERR_SLACK_SPACE - this is the minimum bytes of buffer space
|
||||||
* needed to encode an operation which has failed with NFS4ERR_RESOURCE.
|
* needed to encode an operation which has failed with NFS4ERR_RESOURCE.
|
||||||
* care is taken to ensure that we never fall below this level for any
|
* care is taken to ensure that we never fall below this level for any
|
||||||
* reason.
|
* reason.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue