Commit 14d2b59e8c1634ceb995097b162592b0af139578

Authored by Jesper Juhl
Committed by Linus Torvalds
1 parent cb65a5ba3d

[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>

Showing 1 changed file with 4 additions and 4 deletions Side-by-side Diff

... ... @@ -171,19 +171,19 @@
171 171 p = nfs3svc_encode_post_op_attr(rqstp, p, &resp->fh);
172 172 if (resp->status == 0 && dentry && dentry->d_inode) {
173 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 174 struct kvec *head = rqstp->rq_res.head;
178 175 unsigned int base;
179 176 int n;
  177 + int w;
180 178  
181 179 *p++ = htonl(resp->mask);
182 180 if (!xdr_ressize_check(rqstp, p))
183 181 return 0;
184 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 187 while (w > 0) {
188 188 if (!rqstp->rq_respages[rqstp->rq_resused++])
189 189 return 0;