diff options
author | Andy Adamson <andros@netapp.com> | 2010-01-14 17:45:07 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-02-10 08:30:58 -0500 |
commit | b2f28bd78354b9bbcd178bf6bbf6b2277cd9b761 (patch) | |
tree | 2f323c6f7c4b05252711dffdbe54e478806841f0 /fs/nfs/callback_proc.c | |
parent | e95e60daee44fade63f32429ddcf1c2012a95632 (diff) |
nfs41: prepare for back channel drc
Make all cb_sequence arguments available to verify_seqid which will make
replay decisions.
Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/callback_proc.c')
-rw-r--r-- | fs/nfs/callback_proc.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c index 49c4b548b4d0..3d7edd65577b 100644 --- a/fs/nfs/callback_proc.c +++ b/fs/nfs/callback_proc.c | |||
@@ -153,34 +153,34 @@ int nfs41_validate_delegation_stateid(struct nfs_delegation *delegation, const n | |||
153 | * a single outstanding callback request at a time. | 153 | * a single outstanding callback request at a time. |
154 | */ | 154 | */ |
155 | static int | 155 | static int |
156 | validate_seqid(struct nfs4_slot_table *tbl, u32 slotid, u32 seqid) | 156 | validate_seqid(struct nfs4_slot_table *tbl, struct cb_sequenceargs * args) |
157 | { | 157 | { |
158 | struct nfs4_slot *slot; | 158 | struct nfs4_slot *slot; |
159 | 159 | ||
160 | dprintk("%s enter. slotid %d seqid %d\n", | 160 | dprintk("%s enter. slotid %d seqid %d\n", |
161 | __func__, slotid, seqid); | 161 | __func__, args->csa_slotid, args->csa_sequenceid); |
162 | 162 | ||
163 | if (slotid > NFS41_BC_MAX_CALLBACKS) | 163 | if (args->csa_slotid > NFS41_BC_MAX_CALLBACKS) |
164 | return htonl(NFS4ERR_BADSLOT); | 164 | return htonl(NFS4ERR_BADSLOT); |
165 | 165 | ||
166 | slot = tbl->slots + slotid; | 166 | slot = tbl->slots + args->csa_slotid; |
167 | dprintk("%s slot table seqid: %d\n", __func__, slot->seq_nr); | 167 | dprintk("%s slot table seqid: %d\n", __func__, slot->seq_nr); |
168 | 168 | ||
169 | /* Normal */ | 169 | /* Normal */ |
170 | if (likely(seqid == slot->seq_nr + 1)) { | 170 | if (likely(args->csa_sequenceid == slot->seq_nr + 1)) { |
171 | slot->seq_nr++; | 171 | slot->seq_nr++; |
172 | return htonl(NFS4_OK); | 172 | return htonl(NFS4_OK); |
173 | } | 173 | } |
174 | 174 | ||
175 | /* Replay */ | 175 | /* Replay */ |
176 | if (seqid == slot->seq_nr) { | 176 | if (args->csa_sequenceid == slot->seq_nr) { |
177 | dprintk("%s seqid %d is a replay - no DRC available\n", | 177 | dprintk("%s seqid %d is a replay - no DRC available\n", |
178 | __func__, seqid); | 178 | __func__, args->csa_sequenceid); |
179 | return htonl(NFS4_OK); | 179 | return htonl(NFS4_OK); |
180 | } | 180 | } |
181 | 181 | ||
182 | /* Wraparound */ | 182 | /* Wraparound */ |
183 | if (seqid == 1 && (slot->seq_nr + 1) == 0) { | 183 | if (args->csa_sequenceid == 1 && (slot->seq_nr + 1) == 0) { |
184 | slot->seq_nr = 1; | 184 | slot->seq_nr = 1; |
185 | return htonl(NFS4_OK); | 185 | return htonl(NFS4_OK); |
186 | } | 186 | } |
@@ -291,8 +291,7 @@ unsigned nfs4_callback_sequence(struct cb_sequenceargs *args, | |||
291 | if (clp == NULL) | 291 | if (clp == NULL) |
292 | goto out; | 292 | goto out; |
293 | 293 | ||
294 | status = validate_seqid(&clp->cl_session->bc_slot_table, | 294 | status = validate_seqid(&clp->cl_session->bc_slot_table, args); |
295 | args->csa_slotid, args->csa_sequenceid); | ||
296 | if (status) | 295 | if (status) |
297 | goto out_putclient; | 296 | goto out_putclient; |
298 | 297 | ||