nfs41: use nfs4_getaclres
authorBenny Halevy <bhalevy@panasas.com>
Wed, 1 Apr 2009 13:21:59 +0000 (09:21 -0400)
committerBenny Halevy <bhalevy@panasas.com>
Wed, 17 Jun 2009 17:46:25 +0000 (10:46 -0700)
In preparation for nfs41 sequence processing.

Signed-off-by: Andy Admason <andros@netapp.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
[nfs41: embed resp_len in nfs_getaclres]
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/nfs4proc.c
fs/nfs/nfs4xdr.c
include/linux/nfs_xdr.h

index aea2e83..20c9acf 100644 (file)
@@ -2755,12 +2755,14 @@ static ssize_t __nfs4_get_acl_uncached(struct inode *inode, void *buf, size_t bu
                .acl_pages = pages,
                .acl_len = buflen,
        };
-       size_t resp_len = buflen;
+       struct nfs_getaclres res = {
+               .acl_len = buflen,
+       };
        void *resp_buf;
        struct rpc_message msg = {
                .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_GETACL],
                .rpc_argp = &args,
-               .rpc_resp = &resp_len,
+               .rpc_resp = &res,
        };
        struct page *localpage = NULL;
        int ret;
@@ -2774,7 +2776,7 @@ static ssize_t __nfs4_get_acl_uncached(struct inode *inode, void *buf, size_t bu
                        return -ENOMEM;
                args.acl_pages[0] = localpage;
                args.acl_pgbase = 0;
-               resp_len = args.acl_len = PAGE_SIZE;
+               args.acl_len = PAGE_SIZE;
        } else {
                resp_buf = buf;
                buf_to_pages(buf, buflen, args.acl_pages, &args.acl_pgbase);
@@ -2782,18 +2784,18 @@ static ssize_t __nfs4_get_acl_uncached(struct inode *inode, void *buf, size_t bu
        ret = rpc_call_sync(NFS_CLIENT(inode), &msg, 0);
        if (ret)
                goto out_free;
-       if (resp_len > args.acl_len)
-               nfs4_write_cached_acl(inode, NULL, resp_len);
+       if (res.acl_len > args.acl_len)
+               nfs4_write_cached_acl(inode, NULL, res.acl_len);
        else
-               nfs4_write_cached_acl(inode, resp_buf, resp_len);
+               nfs4_write_cached_acl(inode, resp_buf, res.acl_len);
        if (buf) {
                ret = -ERANGE;
-               if (resp_len > buflen)
+               if (res.acl_len > buflen)
                        goto out_free;
                if (localpage)
-                       memcpy(buf, resp_buf, resp_len);
+                       memcpy(buf, resp_buf, res.acl_len);
        }
-       ret = resp_len;
+       ret = res.acl_len;
 out_free:
        if (localpage)
                __free_page(localpage);
index a77ee3d..3e77789 100644 (file)
@@ -4018,7 +4018,8 @@ out:
  * Decode GETACL response
  */
 static int
-nfs4_xdr_dec_getacl(struct rpc_rqst *rqstp, __be32 *p, size_t *acl_len)
+nfs4_xdr_dec_getacl(struct rpc_rqst *rqstp, __be32 *p,
+                   struct nfs_getaclres *res)
 {
        struct xdr_stream xdr;
        struct compound_hdr hdr;
@@ -4031,7 +4032,7 @@ nfs4_xdr_dec_getacl(struct rpc_rqst *rqstp, __be32 *p, size_t *acl_len)
        status = decode_putfh(&xdr);
        if (status)
                goto out;
-       status = decode_getacl(&xdr, rqstp, acl_len);
+       status = decode_getacl(&xdr, rqstp, &res->acl_len);
 
 out:
        return status;
index 5652331..6e9ee28 100644 (file)
@@ -444,6 +444,11 @@ struct nfs_getaclargs {
        struct nfs4_sequence_args       seq_args;
 };
 
+struct nfs_getaclres {
+       size_t                          acl_len;
+       struct nfs4_sequence_res        seq_res;
+};
+
 struct nfs_setattrres {
        struct nfs_fattr *              fattr;
        const struct nfs_server *       server;