Commit 60f00153 authored by Trond Myklebust's avatar Trond Myklebust

NFSv4.1: Clean up nfs4_recall_slot()

Move the test for nfs4_has_session out of the nfs4_state_manager()
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 1a2dd948
...@@ -1792,12 +1792,14 @@ static int nfs4_reset_session(struct nfs_client *clp) ...@@ -1792,12 +1792,14 @@ static int nfs4_reset_session(struct nfs_client *clp)
static int nfs4_recall_slot(struct nfs_client *clp) static int nfs4_recall_slot(struct nfs_client *clp)
{ {
struct nfs4_slot_table *fc_tbl = &clp->cl_session->fc_slot_table; struct nfs4_slot_table *fc_tbl;
struct nfs4_channel_attrs *fc_attrs = &clp->cl_session->fc_attrs;
struct nfs4_slot *new, *old; struct nfs4_slot *new, *old;
int i; int i;
if (!nfs4_has_session(clp))
return 0;
nfs4_begin_drain_session(clp); nfs4_begin_drain_session(clp);
fc_tbl = &clp->cl_session->fc_slot_table;
new = kmalloc(fc_tbl->target_max_slots * sizeof(struct nfs4_slot), new = kmalloc(fc_tbl->target_max_slots * sizeof(struct nfs4_slot),
GFP_NOFS); GFP_NOFS);
if (!new) if (!new)
...@@ -1810,7 +1812,7 @@ static int nfs4_recall_slot(struct nfs_client *clp) ...@@ -1810,7 +1812,7 @@ static int nfs4_recall_slot(struct nfs_client *clp)
fc_tbl->slots = new; fc_tbl->slots = new;
fc_tbl->max_slots = fc_tbl->target_max_slots; fc_tbl->max_slots = fc_tbl->target_max_slots;
fc_tbl->target_max_slots = 0; fc_tbl->target_max_slots = 0;
fc_attrs->max_reqs = fc_tbl->max_slots; clp->cl_session->fc_attrs.max_reqs = fc_tbl->max_slots;
spin_unlock(&fc_tbl->slot_tbl_lock); spin_unlock(&fc_tbl->slot_tbl_lock);
kfree(old); kfree(old);
...@@ -1920,8 +1922,7 @@ static void nfs4_state_manager(struct nfs_client *clp) ...@@ -1920,8 +1922,7 @@ static void nfs4_state_manager(struct nfs_client *clp)
} }
/* Recall session slots */ /* Recall session slots */
if (test_and_clear_bit(NFS4CLNT_RECALL_SLOT, &clp->cl_state) if (test_and_clear_bit(NFS4CLNT_RECALL_SLOT, &clp->cl_state)) {
&& nfs4_has_session(clp)) {
section = "recall slot"; section = "recall slot";
status = nfs4_recall_slot(clp); status = nfs4_recall_slot(clp);
if (status < 0) if (status < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment