aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4state.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2012-11-20 19:49:20 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-12-06 00:30:42 +0100
commit87dda67e7386ba7d2164391ea58b34e028d8157b (patch)
tree9f8740fa1631a5bb5d3163d86783a764d542cbc6 /fs/nfs/nfs4state.c
parentNFSv4.1: Support dynamic resizing of the session slot table (diff)
downloadlinux-dev-87dda67e7386ba7d2164391ea58b34e028d8157b.tar.xz
linux-dev-87dda67e7386ba7d2164391ea58b34e028d8157b.zip
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.c22
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:
static int nfs4_recall_slot(struct nfs_client *clp)
{
struct nfs4_slot_table *fc_tbl;
- struct nfs4_slot *new, *old;
- int i;
+ u32 new_size;
if (!nfs4_has_session(clp))
return 0;
nfs4_begin_drain_session(clp);
- fc_tbl = &clp->cl_session->fc_slot_table;
- new = nfs4_alloc_slots(fc_tbl, fc_tbl->target_highest_slotid + 1, GFP_NOFS);
- if (!new)
- return -ENOMEM;
- spin_lock(&fc_tbl->slot_tbl_lock);
- for (i = 0; i <= fc_tbl->target_highest_slotid; i++)
- new[i].seq_nr = fc_tbl->slots[i].seq_nr;
- old = fc_tbl->slots;
- fc_tbl->slots = new;
- fc_tbl->max_slots = fc_tbl->target_highest_slotid + 1;
- fc_tbl->max_slotid = fc_tbl->target_highest_slotid;
- clp->cl_session->fc_attrs.max_reqs = fc_tbl->max_slots;
- spin_unlock(&fc_tbl->slot_tbl_lock);
-
- kfree(old);
- return 0;
+ fc_tbl = &clp->cl_session->fc_slot_table;
+ new_size = fc_tbl->server_highest_slotid + 1;
+ return nfs4_resize_slot_table(fc_tbl, new_size, 1);
}
static int nfs4_bind_conn_to_session(struct nfs_client *clp)