diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-11-16 12:58:36 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-11-26 17:49:52 -0500 |
commit | 2b2fa71723f955d5b4a0f4edd99cf3cd69ceafd1 (patch) | |
tree | d4ed6dc3dea4ce2530e4d98a7a36e8f1942767ad /fs/nfs | |
parent | df2fabffbace8988f3265585ec793ff9deccdea7 (diff) |
NFSv4.1: Simplify struct nfs4_sequence_args too
Replace the session pointer + slotid with a pointer to the
allocated slot.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/nfs4proc.c | 6 | ||||
-rw-r--r-- | fs/nfs/nfs4xdr.c | 21 |
2 files changed, 13 insertions, 14 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 4311dba49c58..6c41a34e34b4 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -591,7 +591,7 @@ out: | |||
591 | static void nfs41_init_sequence(struct nfs4_sequence_args *args, | 591 | static void nfs41_init_sequence(struct nfs4_sequence_args *args, |
592 | struct nfs4_sequence_res *res, int cache_reply) | 592 | struct nfs4_sequence_res *res, int cache_reply) |
593 | { | 593 | { |
594 | args->sa_session = NULL; | 594 | args->sa_slot = NULL; |
595 | args->sa_cache_this = 0; | 595 | args->sa_cache_this = 0; |
596 | if (cache_reply) | 596 | if (cache_reply) |
597 | args->sa_cache_this = 1; | 597 | args->sa_cache_this = 1; |
@@ -644,8 +644,8 @@ int nfs41_setup_sequence(struct nfs4_session *session, | |||
644 | rpc_task_set_priority(task, RPC_PRIORITY_NORMAL); | 644 | rpc_task_set_priority(task, RPC_PRIORITY_NORMAL); |
645 | slot = tbl->slots + slotid; | 645 | slot = tbl->slots + slotid; |
646 | slot->renewal_time = jiffies; | 646 | slot->renewal_time = jiffies; |
647 | args->sa_session = session; | 647 | |
648 | args->sa_slotid = slotid; | 648 | args->sa_slot = slot; |
649 | 649 | ||
650 | dprintk("<-- %s slotid=%d seqid=%d\n", __func__, slotid, slot->seq_nr); | 650 | dprintk("<-- %s slotid=%d seqid=%d\n", __func__, slotid, slot->seq_nr); |
651 | 651 | ||
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 50bac7066160..27b0fec1a6b0 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
@@ -1833,18 +1833,16 @@ static void encode_sequence(struct xdr_stream *xdr, | |||
1833 | struct compound_hdr *hdr) | 1833 | struct compound_hdr *hdr) |
1834 | { | 1834 | { |
1835 | #if defined(CONFIG_NFS_V4_1) | 1835 | #if defined(CONFIG_NFS_V4_1) |
1836 | struct nfs4_session *session = args->sa_session; | 1836 | struct nfs4_session *session; |
1837 | struct nfs4_slot_table *tp; | 1837 | struct nfs4_slot_table *tp; |
1838 | struct nfs4_slot *slot; | 1838 | struct nfs4_slot *slot = args->sa_slot; |
1839 | __be32 *p; | 1839 | __be32 *p; |
1840 | 1840 | ||
1841 | if (!session) | 1841 | if (slot == NULL) |
1842 | return; | 1842 | return; |
1843 | 1843 | ||
1844 | tp = &session->fc_slot_table; | 1844 | tp = slot->table; |
1845 | 1845 | session = tp->session; | |
1846 | WARN_ON(args->sa_slotid == NFS4_MAX_SLOT_TABLE); | ||
1847 | slot = tp->slots + args->sa_slotid; | ||
1848 | 1846 | ||
1849 | encode_op_hdr(xdr, OP_SEQUENCE, decode_sequence_maxsz, hdr); | 1847 | encode_op_hdr(xdr, OP_SEQUENCE, decode_sequence_maxsz, hdr); |
1850 | 1848 | ||
@@ -1858,12 +1856,12 @@ static void encode_sequence(struct xdr_stream *xdr, | |||
1858 | ((u32 *)session->sess_id.data)[1], | 1856 | ((u32 *)session->sess_id.data)[1], |
1859 | ((u32 *)session->sess_id.data)[2], | 1857 | ((u32 *)session->sess_id.data)[2], |
1860 | ((u32 *)session->sess_id.data)[3], | 1858 | ((u32 *)session->sess_id.data)[3], |
1861 | slot->seq_nr, args->sa_slotid, | 1859 | slot->seq_nr, slot->slot_nr, |
1862 | tp->highest_used_slotid, args->sa_cache_this); | 1860 | tp->highest_used_slotid, args->sa_cache_this); |
1863 | p = reserve_space(xdr, NFS4_MAX_SESSIONID_LEN + 16); | 1861 | p = reserve_space(xdr, NFS4_MAX_SESSIONID_LEN + 16); |
1864 | p = xdr_encode_opaque_fixed(p, session->sess_id.data, NFS4_MAX_SESSIONID_LEN); | 1862 | p = xdr_encode_opaque_fixed(p, session->sess_id.data, NFS4_MAX_SESSIONID_LEN); |
1865 | *p++ = cpu_to_be32(slot->seq_nr); | 1863 | *p++ = cpu_to_be32(slot->seq_nr); |
1866 | *p++ = cpu_to_be32(args->sa_slotid); | 1864 | *p++ = cpu_to_be32(slot->slot_nr); |
1867 | *p++ = cpu_to_be32(tp->highest_used_slotid); | 1865 | *p++ = cpu_to_be32(tp->highest_used_slotid); |
1868 | *p = cpu_to_be32(args->sa_cache_this); | 1866 | *p = cpu_to_be32(args->sa_cache_this); |
1869 | #endif /* CONFIG_NFS_V4_1 */ | 1867 | #endif /* CONFIG_NFS_V4_1 */ |
@@ -2025,8 +2023,9 @@ static void encode_free_stateid(struct xdr_stream *xdr, | |||
2025 | static u32 nfs4_xdr_minorversion(const struct nfs4_sequence_args *args) | 2023 | static u32 nfs4_xdr_minorversion(const struct nfs4_sequence_args *args) |
2026 | { | 2024 | { |
2027 | #if defined(CONFIG_NFS_V4_1) | 2025 | #if defined(CONFIG_NFS_V4_1) |
2028 | if (args->sa_session) | 2026 | |
2029 | return args->sa_session->clp->cl_mvops->minor_version; | 2027 | if (args->sa_slot) |
2028 | return args->sa_slot->table->session->clp->cl_mvops->minor_version; | ||
2030 | #endif /* CONFIG_NFS_V4_1 */ | 2029 | #endif /* CONFIG_NFS_V4_1 */ |
2031 | return 0; | 2030 | return 0; |
2032 | } | 2031 | } |