aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ.Bruce Fields <bfields@fieldses.org>2006-12-13 03:35:20 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-13 12:05:53 -0500
commite57101991156aaba97c630f38e880f0d4012edcd (patch)
tree5d0a405f254e8e17663746abdc9e5a75428ecc1f
parentb797b5beac966df5c5d96c0d39fe366f57135343 (diff)
[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>
-rw-r--r--fs/nfsd/nfs4proc.c10
-rw-r--r--include/linux/nfsd/nfsd.h4
2 files changed, 7 insertions, 7 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 50bc94243ca1..793a0b0a6cdd 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -740,7 +740,7 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
740 struct svc_fh *current_fh = NULL; 740 struct svc_fh *current_fh = NULL;
741 struct svc_fh *save_fh = NULL; 741 struct svc_fh *save_fh = NULL;
742 struct nfs4_stateowner *replay_owner = NULL; 742 struct nfs4_stateowner *replay_owner = NULL;
743 int slack_space; /* in words, not bytes! */ 743 int slack_bytes;
744 __be32 status; 744 __be32 status;
745 745
746 status = nfserr_resource; 746 status = nfserr_resource;
@@ -790,10 +790,10 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
790 * failed response to the next operation. If we don't 790 * failed response to the next operation. If we don't
791 * have enough room, fail with ERR_RESOURCE. 791 * have enough room, fail with ERR_RESOURCE.
792 */ 792 */
793/* FIXME - is slack_space *really* words, or bytes??? - neilb */ 793 slack_bytes = (char *)resp->end - (char *)resp->p;
794 slack_space = (char *)resp->end - (char *)resp->p; 794 if (slack_bytes < COMPOUND_SLACK_SPACE
795 if (slack_space < COMPOUND_SLACK_SPACE + COMPOUND_ERR_SLACK_SPACE) { 795 + COMPOUND_ERR_SLACK_SPACE) {
796 BUG_ON(slack_space < COMPOUND_ERR_SLACK_SPACE); 796 BUG_ON(slack_bytes < COMPOUND_ERR_SLACK_SPACE);
797 op->status = nfserr_resource; 797 op->status = nfserr_resource;
798 goto encode_op; 798 goto encode_op;
799 } 799 }
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index edb54c3171b3..0727774772ba 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -275,12 +275,12 @@ static inline int is_fsid(struct svc_fh *fh, struct knfsd_fh *reffh)
275 * we might process an operation with side effects, and be unable to 275 * we might process an operation with side effects, and be unable to
276 * tell the client that the operation succeeded. 276 * tell the client that the operation succeeded.
277 * 277 *
278 * COMPOUND_SLACK_SPACE - this is the minimum amount of buffer space 278 * COMPOUND_SLACK_SPACE - this is the minimum bytes of buffer space
279 * needed to encode an "ordinary" _successful_ operation. (GETATTR, 279 * needed to encode an "ordinary" _successful_ operation. (GETATTR,
280 * READ, READDIR, and READLINK have their own buffer checks.) if we 280 * READ, READDIR, and READLINK have their own buffer checks.) if we
281 * fall below this level, we fail the next operation with NFS4ERR_RESOURCE. 281 * fall below this level, we fail the next operation with NFS4ERR_RESOURCE.
282 * 282 *
283 * COMPOUND_ERR_SLACK_SPACE - this is the minimum amount of buffer space 283 * COMPOUND_ERR_SLACK_SPACE - this is the minimum bytes of buffer space
284 * needed to encode an operation which has failed with NFS4ERR_RESOURCE. 284 * needed to encode an operation which has failed with NFS4ERR_RESOURCE.
285 * care is taken to ensure that we never fall below this level for any 285 * care is taken to ensure that we never fall below this level for any
286 * reason. 286 * reason.