diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-11-20 19:49:20 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-12-05 18:30:42 -0500 |
commit | 87dda67e7386ba7d2164391ea58b34e028d8157b (patch) | |
tree | 9f8740fa1631a5bb5d3163d86783a764d542cbc6 /fs/nfs/nfs4state.c | |
parent | 97e548a93de213b149eea025a97d88e28143b445 (diff) |
NFSv4.1: Allow SEQUENCE to resize the slot table on the fly
Instead of an array of slots, use a singly linked list of slots that
can be dynamically appended to or shrunk.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4state.c')
-rw-r--r-- | fs/nfs/nfs4state.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 1b7fa73c9436..c14b2c7ac8a7 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c | |||
@@ -2025,29 +2025,15 @@ out: | |||
2025 | static int nfs4_recall_slot(struct nfs_client *clp) | 2025 | static int nfs4_recall_slot(struct nfs_client *clp) |
2026 | { | 2026 | { |
2027 | struct nfs4_slot_table *fc_tbl; | 2027 | struct nfs4_slot_table *fc_tbl; |
2028 | struct nfs4_slot *new, *old; | 2028 | u32 new_size; |
2029 | int i; | ||
2030 | 2029 | ||
2031 | if (!nfs4_has_session(clp)) | 2030 | if (!nfs4_has_session(clp)) |
2032 | return 0; | 2031 | return 0; |
2033 | nfs4_begin_drain_session(clp); | 2032 | nfs4_begin_drain_session(clp); |
2034 | fc_tbl = &clp->cl_session->fc_slot_table; | ||
2035 | new = nfs4_alloc_slots(fc_tbl, fc_tbl->target_highest_slotid + 1, GFP_NOFS); | ||
2036 | if (!new) | ||
2037 | return -ENOMEM; | ||
2038 | 2033 | ||
2039 | spin_lock(&fc_tbl->slot_tbl_lock); | 2034 | fc_tbl = &clp->cl_session->fc_slot_table; |
2040 | for (i = 0; i <= fc_tbl->target_highest_slotid; i++) | 2035 | new_size = fc_tbl->server_highest_slotid + 1; |
2041 | new[i].seq_nr = fc_tbl->slots[i].seq_nr; | 2036 | return nfs4_resize_slot_table(fc_tbl, new_size, 1); |
2042 | old = fc_tbl->slots; | ||
2043 | fc_tbl->slots = new; | ||
2044 | fc_tbl->max_slots = fc_tbl->target_highest_slotid + 1; | ||
2045 | fc_tbl->max_slotid = fc_tbl->target_highest_slotid; | ||
2046 | clp->cl_session->fc_attrs.max_reqs = fc_tbl->max_slots; | ||
2047 | spin_unlock(&fc_tbl->slot_tbl_lock); | ||
2048 | |||
2049 | kfree(old); | ||
2050 | return 0; | ||
2051 | } | 2037 | } |
2052 | 2038 | ||
2053 | static int nfs4_bind_conn_to_session(struct nfs_client *clp) | 2039 | static int nfs4_bind_conn_to_session(struct nfs_client *clp) |