diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-06-16 09:52:25 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-06-22 13:24:01 -0400 |
commit | d185a334c748b3ca9de1f3a293fd8a9cf68378ab (patch) | |
tree | 0633b26aeeb56667f821d0828725d9c837d02163 /fs/nfs | |
parent | 2a6e26cdb8f17b1075c2dfd8f2f3c341bac4f441 (diff) |
NFSv4.1: Simplify nfs41_sequence_done()
Nobody uses the rpc_status parameter.
It is not obvious why we need the struct nfs_client argument either, when
we already have that information in the session.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/nfs4proc.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 4bfc0b7c428f..fc653c3bc557 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -370,12 +370,11 @@ static void nfs41_check_drain_session_complete(struct nfs4_session *ses) | |||
370 | complete(&ses->complete); | 370 | complete(&ses->complete); |
371 | } | 371 | } |
372 | 372 | ||
373 | static void nfs41_sequence_free_slot(const struct nfs_client *clp, | 373 | static void nfs41_sequence_free_slot(struct nfs4_sequence_res *res) |
374 | struct nfs4_sequence_res *res) | ||
375 | { | 374 | { |
376 | struct nfs4_slot_table *tbl; | 375 | struct nfs4_slot_table *tbl; |
377 | 376 | ||
378 | tbl = &clp->cl_session->fc_slot_table; | 377 | tbl = &res->sr_session->fc_slot_table; |
379 | if (res->sr_slotid == NFS4_MAX_SLOT_TABLE) { | 378 | if (res->sr_slotid == NFS4_MAX_SLOT_TABLE) { |
380 | /* just wake up the next guy waiting since | 379 | /* just wake up the next guy waiting since |
381 | * we may have not consumed a slot after all */ | 380 | * we may have not consumed a slot after all */ |
@@ -385,14 +384,12 @@ static void nfs41_sequence_free_slot(const struct nfs_client *clp, | |||
385 | 384 | ||
386 | spin_lock(&tbl->slot_tbl_lock); | 385 | spin_lock(&tbl->slot_tbl_lock); |
387 | nfs4_free_slot(tbl, res->sr_slotid); | 386 | nfs4_free_slot(tbl, res->sr_slotid); |
388 | nfs41_check_drain_session_complete(clp->cl_session); | 387 | nfs41_check_drain_session_complete(res->sr_session); |
389 | spin_unlock(&tbl->slot_tbl_lock); | 388 | spin_unlock(&tbl->slot_tbl_lock); |
390 | res->sr_slotid = NFS4_MAX_SLOT_TABLE; | 389 | res->sr_slotid = NFS4_MAX_SLOT_TABLE; |
391 | } | 390 | } |
392 | 391 | ||
393 | static void nfs41_sequence_done(struct nfs_client *clp, | 392 | static void nfs41_sequence_done(struct nfs4_sequence_res *res) |
394 | struct nfs4_sequence_res *res, | ||
395 | int rpc_status) | ||
396 | { | 393 | { |
397 | unsigned long timestamp; | 394 | unsigned long timestamp; |
398 | struct nfs4_slot_table *tbl; | 395 | struct nfs4_slot_table *tbl; |
@@ -413,7 +410,8 @@ static void nfs41_sequence_done(struct nfs_client *clp, | |||
413 | 410 | ||
414 | /* Check the SEQUENCE operation status */ | 411 | /* Check the SEQUENCE operation status */ |
415 | if (res->sr_status == 0) { | 412 | if (res->sr_status == 0) { |
416 | tbl = &clp->cl_session->fc_slot_table; | 413 | struct nfs_client *clp = res->sr_session->clp; |
414 | tbl = &res->sr_session->fc_slot_table; | ||
417 | slot = tbl->slots + res->sr_slotid; | 415 | slot = tbl->slots + res->sr_slotid; |
418 | /* Update the slot's sequence and clientid lease timer */ | 416 | /* Update the slot's sequence and clientid lease timer */ |
419 | ++slot->seq_nr; | 417 | ++slot->seq_nr; |
@@ -429,7 +427,7 @@ static void nfs41_sequence_done(struct nfs_client *clp, | |||
429 | out: | 427 | out: |
430 | /* The session may be reset by one of the error handlers. */ | 428 | /* The session may be reset by one of the error handlers. */ |
431 | dprintk("%s: Error %d free the slot \n", __func__, res->sr_status); | 429 | dprintk("%s: Error %d free the slot \n", __func__, res->sr_status); |
432 | nfs41_sequence_free_slot(clp, res); | 430 | nfs41_sequence_free_slot(res); |
433 | } | 431 | } |
434 | 432 | ||
435 | /* | 433 | /* |
@@ -582,7 +580,7 @@ static void nfs41_call_sync_done(struct rpc_task *task, void *calldata) | |||
582 | { | 580 | { |
583 | struct nfs41_call_sync_data *data = calldata; | 581 | struct nfs41_call_sync_data *data = calldata; |
584 | 582 | ||
585 | nfs41_sequence_done(data->clp, data->seq_res, task->tk_status); | 583 | nfs41_sequence_done(data->seq_res); |
586 | } | 584 | } |
587 | 585 | ||
588 | struct rpc_call_ops nfs41_call_sync_ops = { | 586 | struct rpc_call_ops nfs41_call_sync_ops = { |
@@ -662,7 +660,7 @@ static void nfs4_sequence_done(const struct nfs_server *server, | |||
662 | { | 660 | { |
663 | #ifdef CONFIG_NFS_V4_1 | 661 | #ifdef CONFIG_NFS_V4_1 |
664 | if (nfs4_has_session(server->nfs_client)) | 662 | if (nfs4_has_session(server->nfs_client)) |
665 | nfs41_sequence_done(server->nfs_client, res, rpc_status); | 663 | nfs41_sequence_done(res); |
666 | #endif /* CONFIG_NFS_V4_1 */ | 664 | #endif /* CONFIG_NFS_V4_1 */ |
667 | } | 665 | } |
668 | 666 | ||
@@ -4606,7 +4604,7 @@ static void nfs4_get_lease_time_done(struct rpc_task *task, void *calldata) | |||
4606 | (struct nfs4_get_lease_time_data *)calldata; | 4604 | (struct nfs4_get_lease_time_data *)calldata; |
4607 | 4605 | ||
4608 | dprintk("--> %s\n", __func__); | 4606 | dprintk("--> %s\n", __func__); |
4609 | nfs41_sequence_done(data->clp, &data->res->lr_seq_res, task->tk_status); | 4607 | nfs41_sequence_done(&data->res->lr_seq_res); |
4610 | switch (task->tk_status) { | 4608 | switch (task->tk_status) { |
4611 | case -NFS4ERR_DELAY: | 4609 | case -NFS4ERR_DELAY: |
4612 | case -NFS4ERR_GRACE: | 4610 | case -NFS4ERR_GRACE: |
@@ -5095,7 +5093,7 @@ static void nfs41_sequence_call_done(struct rpc_task *task, void *data) | |||
5095 | struct nfs4_sequence_data *calldata = data; | 5093 | struct nfs4_sequence_data *calldata = data; |
5096 | struct nfs_client *clp = calldata->clp; | 5094 | struct nfs_client *clp = calldata->clp; |
5097 | 5095 | ||
5098 | nfs41_sequence_done(clp, task->tk_msg.rpc_resp, task->tk_status); | 5096 | nfs41_sequence_done(task->tk_msg.rpc_resp); |
5099 | 5097 | ||
5100 | if (task->tk_status < 0) { | 5098 | if (task->tk_status < 0) { |
5101 | dprintk("%s ERROR %d\n", __func__, task->tk_status); | 5099 | dprintk("%s ERROR %d\n", __func__, task->tk_status); |
@@ -5184,7 +5182,7 @@ static void nfs4_reclaim_complete_done(struct rpc_task *task, void *data) | |||
5184 | struct nfs4_sequence_res *res = &calldata->res.seq_res; | 5182 | struct nfs4_sequence_res *res = &calldata->res.seq_res; |
5185 | 5183 | ||
5186 | dprintk("--> %s\n", __func__); | 5184 | dprintk("--> %s\n", __func__); |
5187 | nfs41_sequence_done(clp, res, task->tk_status); | 5185 | nfs41_sequence_done(res); |
5188 | switch (task->tk_status) { | 5186 | switch (task->tk_status) { |
5189 | case 0: | 5187 | case 0: |
5190 | case -NFS4ERR_COMPLETE_ALREADY: | 5188 | case -NFS4ERR_COMPLETE_ALREADY: |