diff options
Diffstat (limited to 'fs/lockd/svclock.c')
-rw-r--r-- | fs/lockd/svclock.c | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c index 7209712f3832..1f91567a1b88 100644 --- a/fs/lockd/svclock.c +++ b/fs/lockd/svclock.c | |||
@@ -265,24 +265,20 @@ static void nlmsvc_release_block(struct nlm_block *block) | |||
265 | kref_put(&block->b_count, nlmsvc_free_block); | 265 | kref_put(&block->b_count, nlmsvc_free_block); |
266 | } | 266 | } |
267 | 267 | ||
268 | static void nlmsvc_act_mark(struct nlm_host *host, struct nlm_file *file) | 268 | /* |
269 | { | 269 | * Loop over all blocks and delete blocks held by |
270 | struct nlm_block *block; | 270 | * a matching host. |
271 | 271 | */ | |
272 | down(&file->f_sema); | 272 | void nlmsvc_traverse_blocks(struct nlm_host *host, |
273 | list_for_each_entry(block, &file->f_blocks, b_flist) | 273 | struct nlm_file *file, |
274 | block->b_host->h_inuse = 1; | 274 | nlm_host_match_fn_t match) |
275 | up(&file->f_sema); | ||
276 | } | ||
277 | |||
278 | static void nlmsvc_act_unlock(struct nlm_host *host, struct nlm_file *file) | ||
279 | { | 275 | { |
280 | struct nlm_block *block, *next; | 276 | struct nlm_block *block, *next; |
281 | 277 | ||
282 | restart: | 278 | restart: |
283 | down(&file->f_sema); | 279 | down(&file->f_sema); |
284 | list_for_each_entry_safe(block, next, &file->f_blocks, b_flist) { | 280 | list_for_each_entry_safe(block, next, &file->f_blocks, b_flist) { |
285 | if (host != NULL && host != block->b_host) | 281 | if (!match(block->b_host, host)) |
286 | continue; | 282 | continue; |
287 | /* Do not destroy blocks that are not on | 283 | /* Do not destroy blocks that are not on |
288 | * the global retry list - why? */ | 284 | * the global retry list - why? */ |
@@ -298,19 +294,6 @@ restart: | |||
298 | } | 294 | } |
299 | 295 | ||
300 | /* | 296 | /* |
301 | * Loop over all blocks and perform the action specified. | ||
302 | * (NLM_ACT_CHECK handled by nlmsvc_inspect_file). | ||
303 | */ | ||
304 | void | ||
305 | nlmsvc_traverse_blocks(struct nlm_host *host, struct nlm_file *file, int action) | ||
306 | { | ||
307 | if (action == NLM_ACT_MARK) | ||
308 | nlmsvc_act_mark(host, file); | ||
309 | else | ||
310 | nlmsvc_act_unlock(host, file); | ||
311 | } | ||
312 | |||
313 | /* | ||
314 | * Initialize arguments for GRANTED call. The nlm_rqst structure | 297 | * Initialize arguments for GRANTED call. The nlm_rqst structure |
315 | * has been cleared already. | 298 | * has been cleared already. |
316 | */ | 299 | */ |