Commit 933602e3 authored by Trond Myklebust's avatar Trond Myklebust

NFSv4.1: Shrink struct nfs4_sequence_res by moving sr_renewal_time

Store the renewal time inside the session slot instead.
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 9216106a
...@@ -486,6 +486,7 @@ static void nfs41_sequence_free_slot(struct nfs4_sequence_res *res) ...@@ -486,6 +486,7 @@ static void nfs41_sequence_free_slot(struct nfs4_sequence_res *res)
static int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res *res) static int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res *res)
{ {
struct nfs4_slot *slot;
unsigned long timestamp; unsigned long timestamp;
struct nfs_client *clp; struct nfs_client *clp;
...@@ -502,12 +503,14 @@ static int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res * ...@@ -502,12 +503,14 @@ static int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res *
if (!RPC_WAS_SENT(task)) if (!RPC_WAS_SENT(task))
goto out; goto out;
slot = res->sr_slot;
/* Check the SEQUENCE operation status */ /* Check the SEQUENCE operation status */
switch (res->sr_status) { switch (res->sr_status) {
case 0: case 0:
/* Update the slot's sequence and clientid lease timer */ /* Update the slot's sequence and clientid lease timer */
++res->sr_slot->seq_nr; ++slot->seq_nr;
timestamp = res->sr_renewal_time; timestamp = slot->renewal_time;
clp = res->sr_session->clp; clp = res->sr_session->clp;
do_renew_lease(clp, timestamp); do_renew_lease(clp, timestamp);
/* Check sequence flags */ /* Check sequence flags */
...@@ -521,12 +524,12 @@ static int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res * ...@@ -521,12 +524,12 @@ static int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res *
*/ */
dprintk("%s: slot=%td seq=%d: Operation in progress\n", dprintk("%s: slot=%td seq=%d: Operation in progress\n",
__func__, __func__,
res->sr_slot - res->sr_session->fc_slot_table.slots, slot - res->sr_session->fc_slot_table.slots,
res->sr_slot->seq_nr); slot->seq_nr);
goto out_retry; goto out_retry;
default: default:
/* Just update the slot sequence no. */ /* Just update the slot sequence no. */
++res->sr_slot->seq_nr; ++slot->seq_nr;
} }
out: out:
/* The session may be reset by one of the error handlers. */ /* The session may be reset by one of the error handlers. */
...@@ -637,6 +640,7 @@ int nfs41_setup_sequence(struct nfs4_session *session, ...@@ -637,6 +640,7 @@ int nfs41_setup_sequence(struct nfs4_session *session,
rpc_task_set_priority(task, RPC_PRIORITY_NORMAL); rpc_task_set_priority(task, RPC_PRIORITY_NORMAL);
slot = tbl->slots + slotid; slot = tbl->slots + slotid;
slot->renewal_time = jiffies;
args->sa_session = session; args->sa_session = session;
args->sa_slotid = slotid; args->sa_slotid = slotid;
...@@ -644,7 +648,6 @@ int nfs41_setup_sequence(struct nfs4_session *session, ...@@ -644,7 +648,6 @@ int nfs41_setup_sequence(struct nfs4_session *session,
res->sr_session = session; res->sr_session = session;
res->sr_slot = slot; res->sr_slot = slot;
res->sr_renewal_time = jiffies;
res->sr_status_flags = 0; res->sr_status_flags = 0;
/* /*
* sr_status is only set in decode_sequence, and so will remain * sr_status is only set in decode_sequence, and so will remain
......
...@@ -187,6 +187,7 @@ struct nfs4_channel_attrs { ...@@ -187,6 +187,7 @@ struct nfs4_channel_attrs {
/* nfs41 sessions slot seqid */ /* nfs41 sessions slot seqid */
struct nfs4_slot { struct nfs4_slot {
unsigned long renewal_time;
u32 seq_nr; u32 seq_nr;
}; };
...@@ -200,7 +201,6 @@ struct nfs4_sequence_res { ...@@ -200,7 +201,6 @@ struct nfs4_sequence_res {
struct nfs4_session *sr_session; struct nfs4_session *sr_session;
struct nfs4_slot *sr_slot; /* slot used to send request */ struct nfs4_slot *sr_slot; /* slot used to send request */
int sr_status; /* sequence operation status */ int sr_status; /* sequence operation status */
unsigned long sr_renewal_time;
u32 sr_status_flags; u32 sr_status_flags;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment