diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-11-16 12:12:38 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-11-21 09:29:53 -0500 |
commit | 933602e368c4452260c9bff4fbb3baba35cf987a (patch) | |
tree | 44839731364e55c7d6b4c8ae6f4906386046c8c6 | |
parent | 9216106a847a53e6d0fe6d11dfd9175f2ca7fccf (diff) |
NFSv4.1: Shrink struct nfs4_sequence_res by moving sr_renewal_time
Store the renewal time inside the session slot instead.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r-- | fs/nfs/nfs4proc.c | 15 | ||||
-rw-r--r-- | include/linux/nfs_xdr.h | 2 |
2 files changed, 10 insertions, 7 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 5e5cc5a5065f..14b39742b6e4 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -486,6 +486,7 @@ static void nfs41_sequence_free_slot(struct nfs4_sequence_res *res) | |||
486 | 486 | ||
487 | static int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res *res) | 487 | static int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res *res) |
488 | { | 488 | { |
489 | struct nfs4_slot *slot; | ||
489 | unsigned long timestamp; | 490 | unsigned long timestamp; |
490 | struct nfs_client *clp; | 491 | struct nfs_client *clp; |
491 | 492 | ||
@@ -502,12 +503,14 @@ static int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res * | |||
502 | if (!RPC_WAS_SENT(task)) | 503 | if (!RPC_WAS_SENT(task)) |
503 | goto out; | 504 | goto out; |
504 | 505 | ||
506 | slot = res->sr_slot; | ||
507 | |||
505 | /* Check the SEQUENCE operation status */ | 508 | /* Check the SEQUENCE operation status */ |
506 | switch (res->sr_status) { | 509 | switch (res->sr_status) { |
507 | case 0: | 510 | case 0: |
508 | /* Update the slot's sequence and clientid lease timer */ | 511 | /* Update the slot's sequence and clientid lease timer */ |
509 | ++res->sr_slot->seq_nr; | 512 | ++slot->seq_nr; |
510 | timestamp = res->sr_renewal_time; | 513 | timestamp = slot->renewal_time; |
511 | clp = res->sr_session->clp; | 514 | clp = res->sr_session->clp; |
512 | do_renew_lease(clp, timestamp); | 515 | do_renew_lease(clp, timestamp); |
513 | /* Check sequence flags */ | 516 | /* Check sequence flags */ |
@@ -521,12 +524,12 @@ static int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res * | |||
521 | */ | 524 | */ |
522 | dprintk("%s: slot=%td seq=%d: Operation in progress\n", | 525 | dprintk("%s: slot=%td seq=%d: Operation in progress\n", |
523 | __func__, | 526 | __func__, |
524 | res->sr_slot - res->sr_session->fc_slot_table.slots, | 527 | slot - res->sr_session->fc_slot_table.slots, |
525 | res->sr_slot->seq_nr); | 528 | slot->seq_nr); |
526 | goto out_retry; | 529 | goto out_retry; |
527 | default: | 530 | default: |
528 | /* Just update the slot sequence no. */ | 531 | /* Just update the slot sequence no. */ |
529 | ++res->sr_slot->seq_nr; | 532 | ++slot->seq_nr; |
530 | } | 533 | } |
531 | out: | 534 | out: |
532 | /* The session may be reset by one of the error handlers. */ | 535 | /* The session may be reset by one of the error handlers. */ |
@@ -637,6 +640,7 @@ int nfs41_setup_sequence(struct nfs4_session *session, | |||
637 | 640 | ||
638 | rpc_task_set_priority(task, RPC_PRIORITY_NORMAL); | 641 | rpc_task_set_priority(task, RPC_PRIORITY_NORMAL); |
639 | slot = tbl->slots + slotid; | 642 | slot = tbl->slots + slotid; |
643 | slot->renewal_time = jiffies; | ||
640 | args->sa_session = session; | 644 | args->sa_session = session; |
641 | args->sa_slotid = slotid; | 645 | args->sa_slotid = slotid; |
642 | 646 | ||
@@ -644,7 +648,6 @@ int nfs41_setup_sequence(struct nfs4_session *session, | |||
644 | 648 | ||
645 | res->sr_session = session; | 649 | res->sr_session = session; |
646 | res->sr_slot = slot; | 650 | res->sr_slot = slot; |
647 | res->sr_renewal_time = jiffies; | ||
648 | res->sr_status_flags = 0; | 651 | res->sr_status_flags = 0; |
649 | /* | 652 | /* |
650 | * sr_status is only set in decode_sequence, and so will remain | 653 | * sr_status is only set in decode_sequence, and so will remain |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index a73ea89789d1..9cb1c63a70c2 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -187,6 +187,7 @@ struct nfs4_channel_attrs { | |||
187 | 187 | ||
188 | /* nfs41 sessions slot seqid */ | 188 | /* nfs41 sessions slot seqid */ |
189 | struct nfs4_slot { | 189 | struct nfs4_slot { |
190 | unsigned long renewal_time; | ||
190 | u32 seq_nr; | 191 | u32 seq_nr; |
191 | }; | 192 | }; |
192 | 193 | ||
@@ -200,7 +201,6 @@ struct nfs4_sequence_res { | |||
200 | struct nfs4_session *sr_session; | 201 | struct nfs4_session *sr_session; |
201 | struct nfs4_slot *sr_slot; /* slot used to send request */ | 202 | struct nfs4_slot *sr_slot; /* slot used to send request */ |
202 | int sr_status; /* sequence operation status */ | 203 | int sr_status; /* sequence operation status */ |
203 | unsigned long sr_renewal_time; | ||
204 | u32 sr_status_flags; | 204 | u32 sr_status_flags; |
205 | }; | 205 | }; |
206 | 206 | ||