Commit df2fabff authored by Trond Myklebust's avatar Trond Myklebust

NFSv4.1: Label each entry in the session slot tables with its slot number

Instead of doing slot table pointer gymnastics every time we want to
know which slot we're using.
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent e3725ec0
...@@ -526,9 +526,9 @@ static int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res * ...@@ -526,9 +526,9 @@ static int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res *
* returned NFS4ERR_DELAY as per Section 2.10.6.2 * returned NFS4ERR_DELAY as per Section 2.10.6.2
* of RFC5661. * of RFC5661.
*/ */
dprintk("%s: slot=%td seq=%d: Operation in progress\n", dprintk("%s: slot=%u seq=%u: Operation in progress\n",
__func__, __func__,
slot - session->fc_slot_table.slots, slot->slot_nr,
slot->seq_nr); slot->seq_nr);
goto out_retry; goto out_retry;
default: default:
...@@ -671,9 +671,9 @@ int nfs4_setup_sequence(const struct nfs_server *server, ...@@ -671,9 +671,9 @@ int nfs4_setup_sequence(const struct nfs_server *server,
if (session == NULL) if (session == NULL)
goto out; goto out;
dprintk("--> %s clp %p session %p sr_slot %td\n", dprintk("--> %s clp %p session %p sr_slot %d\n",
__func__, session->clp, session, res->sr_slot ? __func__, session->clp, session, res->sr_slot ?
res->sr_slot - session->fc_slot_table.slots : -1); res->sr_slot->slot_nr : -1);
ret = nfs41_setup_sequence(session, args, res, task); ret = nfs41_setup_sequence(session, args, res, task);
out: out:
...@@ -5669,8 +5669,10 @@ struct nfs4_slot *nfs4_alloc_slots(struct nfs4_slot_table *table, ...@@ -5669,8 +5669,10 @@ struct nfs4_slot *nfs4_alloc_slots(struct nfs4_slot_table *table,
tbl = kmalloc_array(max_slots, sizeof(*tbl), gfp_flags); tbl = kmalloc_array(max_slots, sizeof(*tbl), gfp_flags);
if (tbl != NULL) { if (tbl != NULL) {
for (i = 0; i < max_slots; i++) for (i = 0; i < max_slots; i++) {
tbl[i].table = table; tbl[i].table = table;
tbl[i].slot_nr = i;
}
} }
return tbl; return tbl;
} }
......
...@@ -5547,7 +5547,7 @@ static int decode_sequence(struct xdr_stream *xdr, ...@@ -5547,7 +5547,7 @@ static int decode_sequence(struct xdr_stream *xdr,
} }
/* slot id */ /* slot id */
dummy = be32_to_cpup(p++); dummy = be32_to_cpup(p++);
if (dummy != res->sr_slot - session->fc_slot_table.slots) { if (dummy != res->sr_slot->slot_nr) {
dprintk("%s Invalid slot id\n", __func__); dprintk("%s Invalid slot id\n", __func__);
goto out_err; goto out_err;
} }
......
...@@ -189,6 +189,7 @@ struct nfs4_channel_attrs { ...@@ -189,6 +189,7 @@ struct nfs4_channel_attrs {
struct nfs4_slot { struct nfs4_slot {
struct nfs4_slot_table *table; struct nfs4_slot_table *table;
unsigned long renewal_time; unsigned long renewal_time;
u32 slot_nr;
u32 seq_nr; u32 seq_nr;
}; };
......
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