diff options
author | J. Bruce Fields <bfields@redhat.com> | 2012-11-16 14:16:46 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-11-26 09:08:14 -0500 |
commit | 70cc7f75b1ee4161dfdea1012223db25712ab1a5 (patch) | |
tree | 4e9756cce119094f08a7bbeb52b5487c31790b8a /fs/nfsd | |
parent | 5a80a54d21c96590d013378d8c5f65f879451ab4 (diff) | |
download | talos-obmc-linux-70cc7f75b1ee4161dfdea1012223db25712ab1a5.tar.gz talos-obmc-linux-70cc7f75b1ee4161dfdea1012223db25712ab1a5.zip |
nfsd4: move more write parameters into xdr argument
In preparation for moving some of this elsewhere.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4xdr.c | 20 | ||||
-rw-r--r-- | fs/nfsd/xdr4.h | 2 |
2 files changed, 11 insertions, 11 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 579dc707bad9..cb9f9017af8f 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -1139,16 +1139,17 @@ nfsd4_decode_verify(struct nfsd4_compoundargs *argp, struct nfsd4_verify *verify DECODE_TAIL; } -static int fill_in_write_vector(struct kvec *vec, struct kvec *head, struct page **pagelist, int buflen) +static int fill_in_write_vector(struct kvec *vec, struct nfsd4_write *write) { int i = 1; + int buflen = write->wr_buflen; - vec[0].iov_base = head->iov_base; - vec[0].iov_len = min_t(int, buflen, head->iov_len); + vec[0].iov_base = write->wr_head.iov_base; + vec[0].iov_len = min_t(int, buflen, write->wr_head.iov_len); buflen -= vec[0].iov_len; while (buflen) { - vec[i].iov_base = page_address(pagelist[i - 1]); + vec[i].iov_base = page_address(write->wr_pagelist[i - 1]); vec[i].iov_len = min_t(int, PAGE_SIZE, buflen); buflen -= vec[i].iov_len; i++; @@ -1161,8 +1162,6 @@ nfsd4_decode_write(struct nfsd4_compoundargs *argp, struct nfsd4_write *write) { int avail; int len; - struct page **pagelist; - struct kvec head; DECODE_HEAD; status = nfsd4_decode_stateid(argp, &write->wr_stateid); @@ -1185,10 +1184,10 @@ nfsd4_decode_write(struct nfsd4_compoundargs *argp, struct nfsd4_write *write) __FILE__, __LINE__); goto xdr_error; } - head.iov_base = p; - head.iov_len = avail; + write->wr_head.iov_base = p; + write->wr_head.iov_len = avail; WARN_ON(avail != (XDR_QUADLEN(avail) << 2)); - pagelist = argp->pagelist; + write->wr_pagelist = argp->pagelist; len = XDR_QUADLEN(write->wr_buflen) << 2; if (len >= avail) { @@ -1205,8 +1204,7 @@ nfsd4_decode_write(struct nfsd4_compoundargs *argp, struct nfsd4_write *write) argp->end = argp->p + XDR_QUADLEN(PAGE_SIZE); } argp->p += XDR_QUADLEN(len); - write->wr_vlen = fill_in_write_vector(argp->rqstp->rq_vec, - &head, pagelist, write->wr_buflen); + write->wr_vlen = fill_in_write_vector(argp->rqstp->rq_vec, write); WARN_ON_ONCE(write->wr_vlen > ARRAY_SIZE(argp->rqstp->rq_vec)); DECODE_TAIL; diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h index 3c414c1be295..152867b8125d 100644 --- a/fs/nfsd/xdr4.h +++ b/fs/nfsd/xdr4.h @@ -386,6 +386,8 @@ struct nfsd4_write { u32 wr_stable_how; /* request */ u32 wr_buflen; /* request */ int wr_vlen; + struct kvec wr_head; + struct page ** wr_pagelist; /* request */ u32 wr_bytes_written; /* response */ u32 wr_how_written; /* response */ |