aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs3acl.c
diff options
context:
space:
mode:
authorJesper Juhl <jesper.juhl@gmail.com>2006-12-08 05:39:40 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 11:29:02 -0500
commit14d2b59e8c1634ceb995097b162592b0af139578 (patch)
tree4e46ee276d756cfefa3b6e8e38e2f8d2b4cb0215 /fs/nfsd/nfs3acl.c
parentcb65a5ba3dcef3184ef1ba026b1e268bd1a9323f (diff)
[PATCH] NFS3: Calculate 'w' a bit later in nfs3svc_encode_getaclres()
NFS3: Calculate 'w' a bit later in nfs3svc_encode_getaclres() This is a small performance optimization since we can return before needing 'w'. It also saves a few bytes of .text : Before: text data bss dec hex filename 1632 140 0 1772 6ec fs/nfsd/nfs3acl.o After: text data bss dec hex filename 1624 140 0 1764 6e4 fs/nfsd/nfs3acl.o Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Cc: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/nfsd/nfs3acl.c')
-rw-r--r--fs/nfsd/nfs3acl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/nfsd/nfs3acl.c b/fs/nfsd/nfs3acl.c
index fcad2895ddb0..3e3f2de82c36 100644
--- a/fs/nfsd/nfs3acl.c
+++ b/fs/nfsd/nfs3acl.c
@@ -171,19 +171,19 @@ static int nfs3svc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p,
171 p = nfs3svc_encode_post_op_attr(rqstp, p, &resp->fh); 171 p = nfs3svc_encode_post_op_attr(rqstp, p, &resp->fh);
172 if (resp->status == 0 && dentry && dentry->d_inode) { 172 if (resp->status == 0 && dentry && dentry->d_inode) {
173 struct inode *inode = dentry->d_inode; 173 struct inode *inode = dentry->d_inode;
174 int w = nfsacl_size(
175 (resp->mask & NFS_ACL) ? resp->acl_access : NULL,
176 (resp->mask & NFS_DFACL) ? resp->acl_default : NULL);
177 struct kvec *head = rqstp->rq_res.head; 174 struct kvec *head = rqstp->rq_res.head;
178 unsigned int base; 175 unsigned int base;
179 int n; 176 int n;
177 int w;
180 178
181 *p++ = htonl(resp->mask); 179 *p++ = htonl(resp->mask);
182 if (!xdr_ressize_check(rqstp, p)) 180 if (!xdr_ressize_check(rqstp, p))
183 return 0; 181 return 0;
184 base = (char *)p - (char *)head->iov_base; 182 base = (char *)p - (char *)head->iov_base;
185 183
186 rqstp->rq_res.page_len = w; 184 rqstp->rq_res.page_len = w = nfsacl_size(
185 (resp->mask & NFS_ACL) ? resp->acl_access : NULL,
186 (resp->mask & NFS_DFACL) ? resp->acl_default : NULL);
187 while (w > 0) { 187 while (w > 0) {
188 if (!rqstp->rq_respages[rqstp->rq_resused++]) 188 if (!rqstp->rq_respages[rqstp->rq_resused++])
189 return 0; 189 return 0;