diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-12-15 15:21:52 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-12-15 15:21:52 -0500 |
commit | 8e63b6a8adabb0551124c3b78f7f5f36912c3728 (patch) | |
tree | 47043a752823e4aba91f906f95d3c5006f759202 | |
parent | e8794440849d1d15fa11251ef1622e6160614874 (diff) |
NFSv4.1: Move the RPC timestamp out of the slot.
Shave a few bytes off the slot table size by moving the RPC timestamp
into the sequence results.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r-- | fs/nfs/nfs4proc.c | 14 | ||||
-rw-r--r-- | fs/nfs/nfs4session.c | 3 | ||||
-rw-r--r-- | fs/nfs/nfs4session.h | 1 | ||||
-rw-r--r-- | include/linux/nfs_xdr.h | 1 |
4 files changed, 9 insertions, 10 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 9003b8f6b77f..afb428e63b52 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -419,7 +419,6 @@ static int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res * | |||
419 | { | 419 | { |
420 | struct nfs4_session *session; | 420 | struct nfs4_session *session; |
421 | struct nfs4_slot *slot; | 421 | struct nfs4_slot *slot; |
422 | unsigned long timestamp; | ||
423 | struct nfs_client *clp; | 422 | struct nfs_client *clp; |
424 | int ret = 1; | 423 | int ret = 1; |
425 | 424 | ||
@@ -444,9 +443,8 @@ static int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res * | |||
444 | case 0: | 443 | case 0: |
445 | /* Update the slot's sequence and clientid lease timer */ | 444 | /* Update the slot's sequence and clientid lease timer */ |
446 | ++slot->seq_nr; | 445 | ++slot->seq_nr; |
447 | timestamp = slot->renewal_time; | ||
448 | clp = session->clp; | 446 | clp = session->clp; |
449 | do_renew_lease(clp, timestamp); | 447 | do_renew_lease(clp, res->sr_timestamp); |
450 | /* Check sequence flags */ | 448 | /* Check sequence flags */ |
451 | if (res->sr_status_flags != 0) | 449 | if (res->sr_status_flags != 0) |
452 | nfs4_schedule_lease_recovery(clp); | 450 | nfs4_schedule_lease_recovery(clp); |
@@ -473,10 +471,11 @@ static int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res * | |||
473 | * Could this slot have been previously retired? | 471 | * Could this slot have been previously retired? |
474 | * If so, then the server may be expecting seq_nr = 1! | 472 | * If so, then the server may be expecting seq_nr = 1! |
475 | */ | 473 | */ |
476 | if (slot->seq_nr == 1) | 474 | if (slot->seq_nr != 1) { |
477 | break; | 475 | slot->seq_nr = 1; |
478 | slot->seq_nr = 1; | 476 | goto retry_nowait; |
479 | goto retry_nowait; | 477 | } |
478 | break; | ||
480 | case -NFS4ERR_SEQ_FALSE_RETRY: | 479 | case -NFS4ERR_SEQ_FALSE_RETRY: |
481 | ++slot->seq_nr; | 480 | ++slot->seq_nr; |
482 | goto retry_nowait; | 481 | goto retry_nowait; |
@@ -567,6 +566,7 @@ int nfs41_setup_sequence(struct nfs4_session *session, | |||
567 | slot->slot_nr, slot->seq_nr); | 566 | slot->slot_nr, slot->seq_nr); |
568 | 567 | ||
569 | res->sr_slot = slot; | 568 | res->sr_slot = slot; |
569 | res->sr_timestamp = jiffies; | ||
570 | res->sr_status_flags = 0; | 570 | res->sr_status_flags = 0; |
571 | /* | 571 | /* |
572 | * sr_status is only set in decode_sequence, and so will remain | 572 | * sr_status is only set in decode_sequence, and so will remain |
diff --git a/fs/nfs/nfs4session.c b/fs/nfs/nfs4session.c index 1e6c87c443a7..0e1cc1f4e51a 100644 --- a/fs/nfs/nfs4session.c +++ b/fs/nfs/nfs4session.c | |||
@@ -143,7 +143,6 @@ struct nfs4_slot *nfs4_alloc_slot(struct nfs4_slot_table *tbl) | |||
143 | if (slotid > tbl->highest_used_slotid || | 143 | if (slotid > tbl->highest_used_slotid || |
144 | tbl->highest_used_slotid == NFS4_NO_SLOT) | 144 | tbl->highest_used_slotid == NFS4_NO_SLOT) |
145 | tbl->highest_used_slotid = slotid; | 145 | tbl->highest_used_slotid = slotid; |
146 | ret->renewal_time = jiffies; | ||
147 | ret->generation = tbl->generation; | 146 | ret->generation = tbl->generation; |
148 | 147 | ||
149 | out: | 148 | out: |
@@ -228,9 +227,9 @@ static bool nfs41_assign_slot(struct rpc_task *task, void *pslot) | |||
228 | 227 | ||
229 | if (nfs4_session_draining(tbl->session) && !args->sa_privileged) | 228 | if (nfs4_session_draining(tbl->session) && !args->sa_privileged) |
230 | return false; | 229 | return false; |
231 | slot->renewal_time = jiffies; | ||
232 | slot->generation = tbl->generation; | 230 | slot->generation = tbl->generation; |
233 | args->sa_slot = slot; | 231 | args->sa_slot = slot; |
232 | res->sr_timestamp = jiffies; | ||
234 | res->sr_slot = slot; | 233 | res->sr_slot = slot; |
235 | res->sr_status_flags = 0; | 234 | res->sr_status_flags = 0; |
236 | res->sr_status = 1; | 235 | res->sr_status = 1; |
diff --git a/fs/nfs/nfs4session.h b/fs/nfs/nfs4session.h index 04f834cab16c..d17b08091d4b 100644 --- a/fs/nfs/nfs4session.h +++ b/fs/nfs/nfs4session.h | |||
@@ -19,7 +19,6 @@ struct nfs4_slot { | |||
19 | struct nfs4_slot_table *table; | 19 | struct nfs4_slot_table *table; |
20 | struct nfs4_slot *next; | 20 | struct nfs4_slot *next; |
21 | unsigned long generation; | 21 | unsigned long generation; |
22 | unsigned long renewal_time; | ||
23 | u32 slot_nr; | 22 | u32 slot_nr; |
24 | u32 seq_nr; | 23 | u32 seq_nr; |
25 | }; | 24 | }; |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index a55abd499c21..29adb12c7ecf 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -194,6 +194,7 @@ struct nfs4_sequence_args { | |||
194 | 194 | ||
195 | struct nfs4_sequence_res { | 195 | struct nfs4_sequence_res { |
196 | struct nfs4_slot *sr_slot; /* slot used to send request */ | 196 | struct nfs4_slot *sr_slot; /* slot used to send request */ |
197 | unsigned long sr_timestamp; | ||
197 | int sr_status; /* sequence operation status */ | 198 | int sr_status; /* sequence operation status */ |
198 | u32 sr_status_flags; | 199 | u32 sr_status_flags; |
199 | u32 sr_highest_slotid; | 200 | u32 sr_highest_slotid; |