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>
このコミットが含まれているのは:
Trond Myklebust
2012-11-20 19:49:20 -05:00
コミット 87dda67e73
4個のファイルの変更121行の追加80行の削除

ファイルの表示

@@ -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;
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)