Commit 89fc0a31 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] kNFSd - 1 of 2 - Change NFSv4 xdr decoding to cope with separate pages.

Now that nfsd uses a list of pages for requests instead of
one large buffer, NFSv4 need to know about this.

The most interesting part of this is that it is possible
that section of a request, like a path name, could span
two pages, so we need to be able to kmalloc as little bit
of space to copy them into, and make sure they get
freed later.
parent 586a5a35
...@@ -481,7 +481,8 @@ nfsd4_write(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_writ ...@@ -481,7 +481,8 @@ nfsd4_write(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_writ
*p++ = nfssvc_boot.tv_usec; *p++ = nfssvc_boot.tv_usec;
return nfsd_write(rqstp, current_fh, write->wr_offset, return nfsd_write(rqstp, current_fh, write->wr_offset,
write->wr_buf, write->wr_buflen, &write->wr_how_written); write->wr_vec, write->wr_vlen, write->wr_buflen,
&write->wr_how_written);
} }
/* This routine never returns NFS_OK! If there are no other errors, it /* This routine never returns NFS_OK! If there are no other errors, it
...@@ -700,6 +701,16 @@ nfsd4_proc_compound(struct svc_rqst *rqstp, ...@@ -700,6 +701,16 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
kfree(args->ops); kfree(args->ops);
args->ops = args->iops; args->ops = args->iops;
} }
if (args->tmpp) {
kfree(args->tmpp);
args->tmpp = NULL;
}
while (args->to_free) {
struct tmpbuf *tb = args->to_free;
args->to_free = tb->next;
kfree(tb->buf);
kfree(tb);
}
fh_put(&current_fh); fh_put(&current_fh);
fh_put(&save_fh); fh_put(&save_fh);
return status; return status;
......
This diff is collapsed.
...@@ -249,7 +249,9 @@ struct nfsd4_write { ...@@ -249,7 +249,9 @@ struct nfsd4_write {
u64 wr_offset; /* request */ u64 wr_offset; /* request */
u32 wr_stable_how; /* request */ u32 wr_stable_how; /* request */
u32 wr_buflen; /* request */ u32 wr_buflen; /* request */
char * wr_buf; /* request */ struct iovec wr_vec[RPCSVC_MAXPAGES]; /* request */
int wr_vlen;
u32 wr_bytes_written; /* response */ u32 wr_bytes_written; /* response */
u32 wr_how_written; /* response */ u32 wr_how_written; /* response */
nfs4_verifier wr_verifier; /* response */ nfs4_verifier wr_verifier; /* response */
...@@ -288,6 +290,14 @@ struct nfsd4_compoundargs { ...@@ -288,6 +290,14 @@ struct nfsd4_compoundargs {
/* scratch variables for XDR decode */ /* scratch variables for XDR decode */
u32 * p; u32 * p;
u32 * end; u32 * end;
struct page ** pagelist;
int pagelen;
u32 tmp[8];
u32 * tmpp;
struct tmpbuf {
struct tmpbuf *next;
void *buf;
} *to_free;
u32 taglen; u32 taglen;
char * tag; char * tag;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment