diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-06-05 10:51:00 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-06-28 17:20:48 -0400 |
commit | 60f00153d93e0bea872f1a9f5b01423247649083 (patch) | |
tree | 6991014a2b2f4197f055c93269a9de737ac0a728 /fs/nfs/nfs4state.c | |
parent | 1a2dd948e2b1e27476982bc7dd6961585823aec5 (diff) |
NFSv4.1: Clean up nfs4_recall_slot()
Move the test for nfs4_has_session out of the nfs4_state_manager()
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4state.c')
-rw-r--r-- | fs/nfs/nfs4state.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index da62f66a85ad..338a12acdc38 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c | |||
@@ -1792,12 +1792,14 @@ out: | |||
1792 | 1792 | ||
1793 | static int nfs4_recall_slot(struct nfs_client *clp) | 1793 | static int nfs4_recall_slot(struct nfs_client *clp) |
1794 | { | 1794 | { |
1795 | struct nfs4_slot_table *fc_tbl = &clp->cl_session->fc_slot_table; | 1795 | struct nfs4_slot_table *fc_tbl; |
1796 | struct nfs4_channel_attrs *fc_attrs = &clp->cl_session->fc_attrs; | ||
1797 | struct nfs4_slot *new, *old; | 1796 | struct nfs4_slot *new, *old; |
1798 | int i; | 1797 | int i; |
1799 | 1798 | ||
1799 | if (!nfs4_has_session(clp)) | ||
1800 | return 0; | ||
1800 | nfs4_begin_drain_session(clp); | 1801 | nfs4_begin_drain_session(clp); |
1802 | fc_tbl = &clp->cl_session->fc_slot_table; | ||
1801 | new = kmalloc(fc_tbl->target_max_slots * sizeof(struct nfs4_slot), | 1803 | new = kmalloc(fc_tbl->target_max_slots * sizeof(struct nfs4_slot), |
1802 | GFP_NOFS); | 1804 | GFP_NOFS); |
1803 | if (!new) | 1805 | if (!new) |
@@ -1810,7 +1812,7 @@ static int nfs4_recall_slot(struct nfs_client *clp) | |||
1810 | fc_tbl->slots = new; | 1812 | fc_tbl->slots = new; |
1811 | fc_tbl->max_slots = fc_tbl->target_max_slots; | 1813 | fc_tbl->max_slots = fc_tbl->target_max_slots; |
1812 | fc_tbl->target_max_slots = 0; | 1814 | fc_tbl->target_max_slots = 0; |
1813 | fc_attrs->max_reqs = fc_tbl->max_slots; | 1815 | clp->cl_session->fc_attrs.max_reqs = fc_tbl->max_slots; |
1814 | spin_unlock(&fc_tbl->slot_tbl_lock); | 1816 | spin_unlock(&fc_tbl->slot_tbl_lock); |
1815 | 1817 | ||
1816 | kfree(old); | 1818 | kfree(old); |
@@ -1920,8 +1922,7 @@ static void nfs4_state_manager(struct nfs_client *clp) | |||
1920 | } | 1922 | } |
1921 | 1923 | ||
1922 | /* Recall session slots */ | 1924 | /* Recall session slots */ |
1923 | if (test_and_clear_bit(NFS4CLNT_RECALL_SLOT, &clp->cl_state) | 1925 | if (test_and_clear_bit(NFS4CLNT_RECALL_SLOT, &clp->cl_state)) { |
1924 | && nfs4_has_session(clp)) { | ||
1925 | section = "recall slot"; | 1926 | section = "recall slot"; |
1926 | status = nfs4_recall_slot(clp); | 1927 | status = nfs4_recall_slot(clp); |
1927 | if (status < 0) | 1928 | if (status < 0) |