aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJesper Juhl <jesper.juhl@gmail.com>2006-12-08 05:39:39 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 11:29:01 -0500
commitcb65a5ba3dcef3184ef1ba026b1e268bd1a9323f (patch)
treedb13839b65b036ef7d2cf3cf596b8512fe1b7f48 /fs
parent4b75f78edcab291eb29fe9a205cbf7b80c1c644f (diff)
[PATCH] NFS2: Calculate 'w' a bit later in nfsaclsvc_encode_getaclres()
NFS2: Calculate 'w' a bit later in nfsaclsvc_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 2406 212 0 2618 a3a fs/nfsd/nfs2acl.o After: text data bss dec hex filename 2400 212 0 2612 a34 fs/nfsd/nfs2acl.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')
-rw-r--r--fs/nfsd/nfs2acl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/nfsd/nfs2acl.c b/fs/nfsd/nfs2acl.c
index e3eca081698..edde5dc5f79 100644
--- a/fs/nfsd/nfs2acl.c
+++ b/fs/nfsd/nfs2acl.c
@@ -222,12 +222,10 @@ static int nfsaclsvc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p,
222{ 222{
223 struct dentry *dentry = resp->fh.fh_dentry; 223 struct dentry *dentry = resp->fh.fh_dentry;
224 struct inode *inode = dentry->d_inode; 224 struct inode *inode = dentry->d_inode;
225 int w = nfsacl_size(
226 (resp->mask & NFS_ACL) ? resp->acl_access : NULL,
227 (resp->mask & NFS_DFACL) ? resp->acl_default : NULL);
228 struct kvec *head = rqstp->rq_res.head; 225 struct kvec *head = rqstp->rq_res.head;
229 unsigned int base; 226 unsigned int base;
230 int n; 227 int n;
228 int w;
231 229
232 if (dentry == NULL || dentry->d_inode == NULL) 230 if (dentry == NULL || dentry->d_inode == NULL)
233 return 0; 231 return 0;
@@ -239,7 +237,9 @@ static int nfsaclsvc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p,
239 return 0; 237 return 0;
240 base = (char *)p - (char *)head->iov_base; 238 base = (char *)p - (char *)head->iov_base;
241 239
242 rqstp->rq_res.page_len = w; 240 rqstp->rq_res.page_len = w = nfsacl_size(
241 (resp->mask & NFS_ACL) ? resp->acl_access : NULL,
242 (resp->mask & NFS_DFACL) ? resp->acl_default : NULL);
243 while (w > 0) { 243 while (w > 0) {
244 if (!rqstp->rq_respages[rqstp->rq_resused++]) 244 if (!rqstp->rq_respages[rqstp->rq_resused++])
245 return 0; 245 return 0;