diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/internal.h | 14 | ||||
-rw-r--r-- | fs/nfs/nfs4proc.c | 21 |
2 files changed, 35 insertions, 0 deletions
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index 8d67c2865dc3..12f4c5e6fd39 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h | |||
@@ -230,6 +230,20 @@ static inline int nfs4_has_session(const struct nfs_client *clp) | |||
230 | return 0; | 230 | return 0; |
231 | } | 231 | } |
232 | 232 | ||
233 | #ifdef CONFIG_NFS_V4_1 | ||
234 | extern void nfs41_sequence_free_slot(const struct nfs_client *, | ||
235 | struct nfs4_sequence_res *res); | ||
236 | #endif /* CONFIG_NFS_V4_1 */ | ||
237 | |||
238 | static inline void nfs4_sequence_free_slot(const struct nfs_client *clp, | ||
239 | struct nfs4_sequence_res *res) | ||
240 | { | ||
241 | #ifdef CONFIG_NFS_V4_1 | ||
242 | if (nfs4_has_session(clp)) | ||
243 | nfs41_sequence_free_slot(clp, res); | ||
244 | #endif /* CONFIG_NFS_V4_1 */ | ||
245 | } | ||
246 | |||
233 | /* | 247 | /* |
234 | * Determine the device name as a string | 248 | * Determine the device name as a string |
235 | */ | 249 | */ |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index b6308f6740ec..861b103c9e3c 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -309,6 +309,27 @@ nfs4_free_slot(struct nfs4_slot_table *tbl, u8 free_slotid) | |||
309 | free_slotid, tbl->highest_used_slotid); | 309 | free_slotid, tbl->highest_used_slotid); |
310 | } | 310 | } |
311 | 311 | ||
312 | void nfs41_sequence_free_slot(const struct nfs_client *clp, | ||
313 | struct nfs4_sequence_res *res) | ||
314 | { | ||
315 | struct nfs4_slot_table *tbl; | ||
316 | |||
317 | if (!nfs4_has_session(clp)) { | ||
318 | dprintk("%s: No session\n", __func__); | ||
319 | return; | ||
320 | } | ||
321 | tbl = &clp->cl_session->fc_slot_table; | ||
322 | if (res->sr_slotid == NFS4_MAX_SLOT_TABLE) { | ||
323 | dprintk("%s: No slot\n", __func__); | ||
324 | /* just wake up the next guy waiting since | ||
325 | * we may have not consumed a slot after all */ | ||
326 | rpc_wake_up_next(&tbl->slot_tbl_waitq); | ||
327 | return; | ||
328 | } | ||
329 | nfs4_free_slot(tbl, res->sr_slotid); | ||
330 | res->sr_slotid = NFS4_MAX_SLOT_TABLE; | ||
331 | } | ||
332 | |||
312 | /* | 333 | /* |
313 | * nfs4_find_slot - efficiently look for a free slot | 334 | * nfs4_find_slot - efficiently look for a free slot |
314 | * | 335 | * |