diff options
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
-rw-r--r-- | fs/nfs/nfs4xdr.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index e23a0a664e12..5c399ec41079 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
@@ -1715,17 +1715,17 @@ static void encode_secinfo(struct xdr_stream *xdr, const struct qstr *name, stru | |||
1715 | #if defined(CONFIG_NFS_V4_1) | 1715 | #if defined(CONFIG_NFS_V4_1) |
1716 | /* NFSv4.1 operations */ | 1716 | /* NFSv4.1 operations */ |
1717 | static void encode_bind_conn_to_session(struct xdr_stream *xdr, | 1717 | static void encode_bind_conn_to_session(struct xdr_stream *xdr, |
1718 | struct nfs4_session *session, | 1718 | struct nfs41_bind_conn_to_session_args *args, |
1719 | struct compound_hdr *hdr) | 1719 | struct compound_hdr *hdr) |
1720 | { | 1720 | { |
1721 | __be32 *p; | 1721 | __be32 *p; |
1722 | 1722 | ||
1723 | encode_op_hdr(xdr, OP_BIND_CONN_TO_SESSION, | 1723 | encode_op_hdr(xdr, OP_BIND_CONN_TO_SESSION, |
1724 | decode_bind_conn_to_session_maxsz, hdr); | 1724 | decode_bind_conn_to_session_maxsz, hdr); |
1725 | encode_opaque_fixed(xdr, session->sess_id.data, NFS4_MAX_SESSIONID_LEN); | 1725 | encode_opaque_fixed(xdr, args->sessionid.data, NFS4_MAX_SESSIONID_LEN); |
1726 | p = xdr_reserve_space(xdr, 8); | 1726 | p = xdr_reserve_space(xdr, 8); |
1727 | *p++ = cpu_to_be32(NFS4_CDFC4_BACK_OR_BOTH); | 1727 | *p++ = cpu_to_be32(args->dir); |
1728 | *p = 0; /* use_conn_in_rdma_mode = False */ | 1728 | *p = (args->use_conn_in_rdma_mode) ? cpu_to_be32(1) : cpu_to_be32(0); |
1729 | } | 1729 | } |
1730 | 1730 | ||
1731 | static void encode_op_map(struct xdr_stream *xdr, struct nfs4_op_map *op_map) | 1731 | static void encode_op_map(struct xdr_stream *xdr, struct nfs4_op_map *op_map) |
@@ -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 */ |
@@ -2734,14 +2734,14 @@ static void nfs4_xdr_enc_fsid_present(struct rpc_rqst *req, | |||
2734 | */ | 2734 | */ |
2735 | static void nfs4_xdr_enc_bind_conn_to_session(struct rpc_rqst *req, | 2735 | static void nfs4_xdr_enc_bind_conn_to_session(struct rpc_rqst *req, |
2736 | struct xdr_stream *xdr, | 2736 | struct xdr_stream *xdr, |
2737 | struct nfs_client *clp) | 2737 | struct nfs41_bind_conn_to_session_args *args) |
2738 | { | 2738 | { |
2739 | struct compound_hdr hdr = { | 2739 | struct compound_hdr hdr = { |
2740 | .minorversion = clp->cl_mvops->minor_version, | 2740 | .minorversion = args->client->cl_mvops->minor_version, |
2741 | }; | 2741 | }; |
2742 | 2742 | ||
2743 | encode_compound_hdr(xdr, req, &hdr); | 2743 | encode_compound_hdr(xdr, req, &hdr); |
2744 | encode_bind_conn_to_session(xdr, clp->cl_session, &hdr); | 2744 | encode_bind_conn_to_session(xdr, args, &hdr); |
2745 | encode_nops(&hdr); | 2745 | encode_nops(&hdr); |
2746 | } | 2746 | } |
2747 | 2747 | ||
@@ -5613,7 +5613,7 @@ static int decode_bind_conn_to_session(struct xdr_stream *xdr, | |||
5613 | 5613 | ||
5614 | status = decode_op_hdr(xdr, OP_BIND_CONN_TO_SESSION); | 5614 | status = decode_op_hdr(xdr, OP_BIND_CONN_TO_SESSION); |
5615 | if (!status) | 5615 | if (!status) |
5616 | status = decode_sessionid(xdr, &res->session->sess_id); | 5616 | status = decode_sessionid(xdr, &res->sessionid); |
5617 | if (unlikely(status)) | 5617 | if (unlikely(status)) |
5618 | return status; | 5618 | return status; |
5619 | 5619 | ||
@@ -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); |