aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fscache/page.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fscache/page.c')
-rw-r--r--fs/fscache/page.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/fs/fscache/page.c b/fs/fscache/page.c
index 8a92b9fabe83..ff000e52072d 100644
--- a/fs/fscache/page.c
+++ b/fs/fscache/page.c
@@ -303,6 +303,17 @@ static int fscache_wait_for_deferred_lookup(struct fscache_cookie *cookie)
303} 303}
304 304
305/* 305/*
306 * Handle cancellation of a pending retrieval op
307 */
308static void fscache_do_cancel_retrieval(struct fscache_operation *_op)
309{
310 struct fscache_retrieval *op =
311 container_of(_op, struct fscache_retrieval, op);
312
313 op->n_pages = 0;
314}
315
316/*
306 * wait for an object to become active (or dead) 317 * wait for an object to become active (or dead)
307 */ 318 */
308static int fscache_wait_for_retrieval_activation(struct fscache_object *object, 319static int fscache_wait_for_retrieval_activation(struct fscache_object *object,
@@ -320,7 +331,7 @@ static int fscache_wait_for_retrieval_activation(struct fscache_object *object,
320 if (wait_on_bit(&op->op.flags, FSCACHE_OP_WAITING, 331 if (wait_on_bit(&op->op.flags, FSCACHE_OP_WAITING,
321 fscache_wait_bit_interruptible, 332 fscache_wait_bit_interruptible,
322 TASK_INTERRUPTIBLE) != 0) { 333 TASK_INTERRUPTIBLE) != 0) {
323 ret = fscache_cancel_op(&op->op); 334 ret = fscache_cancel_op(&op->op, fscache_do_cancel_retrieval);
324 if (ret == 0) 335 if (ret == 0)
325 return -ERESTARTSYS; 336 return -ERESTARTSYS;
326 337
@@ -338,8 +349,8 @@ check_if_dead:
338 return -ENOBUFS; 349 return -ENOBUFS;
339 } 350 }
340 if (unlikely(fscache_object_is_dead(object))) { 351 if (unlikely(fscache_object_is_dead(object))) {
341 pr_err("%s() = -ENOBUFS [obj dead %d]", __func__, op->op.state); 352 pr_err("%s() = -ENOBUFS [obj dead %d]\n", __func__, op->op.state);
342 fscache_cancel_op(&op->op); 353 fscache_cancel_op(&op->op, fscache_do_cancel_retrieval);
343 fscache_stat(stat_object_dead); 354 fscache_stat(stat_object_dead);
344 return -ENOBUFS; 355 return -ENOBUFS;
345 } 356 }