summaryrefslogtreecommitdiff
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
authorAnna Schumaker <Anna.Schumaker@Netapp.com>2017-01-10 20:01:46 +0300
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2017-01-30 21:14:50 +0300
commit9dd9107f330c5d371c62b460975a32d8bd5712b4 (patch)
treec209788ed4ddfb889707c8cea106f5292c6233eb /fs/nfs/nfs4proc.c
parent7981c8a659143173882dda43b3056a777faeeb7b (diff)
downloadlinux-9dd9107f330c5d371c62b460975a32d8bd5712b4.tar.xz
NFS: Move slot-already-allocated check into nfs_setup_sequence()
This puts the check in a single place, rather than needing to implement it twice for v4.0 and v4.1. Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index e6f563c1689e..dcb2f73c7d4c 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -629,10 +629,6 @@ static int nfs40_setup_sequence(struct nfs4_slot_table *tbl,
{
struct nfs4_slot *slot;
- /* slot already allocated? */
- if (res->sr_slot != NULL)
- goto out_start;
-
spin_lock(&tbl->slot_tbl_lock);
if (nfs4_slot_tbl_draining(tbl) && !args->sa_privileged)
goto out_sleep;
@@ -649,7 +645,6 @@ static int nfs40_setup_sequence(struct nfs4_slot_table *tbl,
args->sa_slot = slot;
res->sr_slot = slot;
-out_start:
rpc_call_start(task);
return 0;
@@ -890,10 +885,6 @@ static int nfs41_setup_sequence(struct nfs4_session *session,
struct nfs4_slot_table *tbl;
dprintk("--> %s\n", __func__);
- /* slot already allocated? */
- if (res->sr_slot != NULL)
- goto out_success;
-
tbl = &session->fc_slot_table;
task->tk_timeout = 0;
@@ -931,7 +922,6 @@ static int nfs41_setup_sequence(struct nfs4_session *session,
*/
res->sr_status = 1;
trace_nfs4_setup_sequence(session, args);
-out_success:
rpc_call_start(task);
return 0;
out_sleep:
@@ -996,12 +986,21 @@ int nfs4_setup_sequence(const struct nfs_client *client,
{
#if defined(CONFIG_NFS_V4_1)
struct nfs4_session *session = nfs4_get_session(client);
+#endif /* CONFIG_NFS_V4_1 */
+ /* slot already allocated? */
+ if (res->sr_slot != NULL)
+ goto out_start;
+
+#if defined(CONFIG_NFS_V4_1)
if (session)
return nfs41_setup_sequence(session, args, res, task);
#endif /* CONFIG_NFS_V4_1 */
return nfs40_setup_sequence(client->cl_slot_tbl, args, res, task);
+out_start:
+ rpc_call_start(task);
+ return 0;
}
EXPORT_SYMBOL_GPL(nfs4_setup_sequence);