diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-02-18 14:30:18 -0500 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-02-18 15:28:50 -0500 |
commit | 79969dd12e8756f64a999992c0536ccd91bf6e54 (patch) | |
tree | b66d51039b086df40fdc3420a977f10c248f3454 /fs/nfs/nfs4xdr.c | |
parent | 65d2918e716afb89359cfa59734d76c1ff8700cb (diff) |
NFSv4.1: Clean up create_session
Don't decode directly into the shared struct session
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
-rw-r--r-- | fs/nfs/nfs4xdr.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index e23a0a664e12..248903b138a8 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
@@ -1806,8 +1806,8 @@ static void encode_create_session(struct xdr_stream *xdr, | |||
1806 | 1806 | ||
1807 | encode_op_hdr(xdr, OP_CREATE_SESSION, decode_create_session_maxsz, hdr); | 1807 | encode_op_hdr(xdr, OP_CREATE_SESSION, decode_create_session_maxsz, hdr); |
1808 | p = reserve_space(xdr, 16 + 2*28 + 20 + clnt->cl_nodelen + 12); | 1808 | p = reserve_space(xdr, 16 + 2*28 + 20 + clnt->cl_nodelen + 12); |
1809 | p = xdr_encode_hyper(p, clp->cl_clientid); | 1809 | p = xdr_encode_hyper(p, args->clientid); |
1810 | *p++ = cpu_to_be32(clp->cl_seqid); /*Sequence id */ | 1810 | *p++ = cpu_to_be32(args->seqid); /*Sequence id */ |
1811 | *p++ = cpu_to_be32(args->flags); /*flags */ | 1811 | *p++ = cpu_to_be32(args->flags); /*flags */ |
1812 | 1812 | ||
1813 | /* Fore Channel */ | 1813 | /* Fore Channel */ |
@@ -5641,12 +5641,10 @@ static int decode_create_session(struct xdr_stream *xdr, | |||
5641 | { | 5641 | { |
5642 | __be32 *p; | 5642 | __be32 *p; |
5643 | int status; | 5643 | int status; |
5644 | struct nfs_client *clp = res->client; | ||
5645 | struct nfs4_session *session = clp->cl_session; | ||
5646 | 5644 | ||
5647 | status = decode_op_hdr(xdr, OP_CREATE_SESSION); | 5645 | status = decode_op_hdr(xdr, OP_CREATE_SESSION); |
5648 | if (!status) | 5646 | if (!status) |
5649 | status = decode_sessionid(xdr, &session->sess_id); | 5647 | status = decode_sessionid(xdr, &res->sessionid); |
5650 | if (unlikely(status)) | 5648 | if (unlikely(status)) |
5651 | return status; | 5649 | return status; |
5652 | 5650 | ||
@@ -5654,13 +5652,13 @@ static int decode_create_session(struct xdr_stream *xdr, | |||
5654 | p = xdr_inline_decode(xdr, 8); | 5652 | p = xdr_inline_decode(xdr, 8); |
5655 | if (unlikely(!p)) | 5653 | if (unlikely(!p)) |
5656 | goto out_overflow; | 5654 | goto out_overflow; |
5657 | clp->cl_seqid = be32_to_cpup(p++); | 5655 | res->seqid = be32_to_cpup(p++); |
5658 | session->flags = be32_to_cpup(p); | 5656 | res->flags = be32_to_cpup(p); |
5659 | 5657 | ||
5660 | /* Channel attributes */ | 5658 | /* Channel attributes */ |
5661 | status = decode_chan_attrs(xdr, &session->fc_attrs); | 5659 | status = decode_chan_attrs(xdr, &res->fc_attrs); |
5662 | if (!status) | 5660 | if (!status) |
5663 | status = decode_chan_attrs(xdr, &session->bc_attrs); | 5661 | status = decode_chan_attrs(xdr, &res->bc_attrs); |
5664 | return status; | 5662 | return status; |
5665 | out_overflow: | 5663 | out_overflow: |
5666 | print_overflow_msg(__func__, xdr); | 5664 | print_overflow_msg(__func__, xdr); |