Lines Matching refs:op

173 static void fscache_attr_changed_op(struct fscache_operation *op)  in fscache_attr_changed_op()  argument
175 struct fscache_object *object = op->object; in fscache_attr_changed_op()
178 _enter("{OBJ%x OP%x}", object->debug_id, op->debug_id); in fscache_attr_changed_op()
190 fscache_op_complete(op, true); in fscache_attr_changed_op()
199 struct fscache_operation *op; in __fscache_attr_changed() local
209 op = kzalloc(sizeof(*op), GFP_KERNEL); in __fscache_attr_changed()
210 if (!op) { in __fscache_attr_changed()
216 fscache_operation_init(op, fscache_attr_changed_op, NULL); in __fscache_attr_changed()
217 op->flags = FSCACHE_OP_ASYNC | in __fscache_attr_changed()
230 if (fscache_submit_exclusive_op(object, op) < 0) in __fscache_attr_changed()
234 fscache_put_operation(op); in __fscache_attr_changed()
242 kfree(op); in __fscache_attr_changed()
256 struct fscache_retrieval *op = in fscache_release_retrieval_op() local
257 container_of(_op, struct fscache_retrieval, op); in fscache_release_retrieval_op()
259 _enter("{OP%x}", op->op.debug_id); in fscache_release_retrieval_op()
261 ASSERTCMP(atomic_read(&op->n_pages), ==, 0); in fscache_release_retrieval_op()
263 fscache_hist(fscache_retrieval_histogram, op->start_time); in fscache_release_retrieval_op()
264 if (op->context) in fscache_release_retrieval_op()
265 fscache_put_context(op->op.object->cookie, op->context); in fscache_release_retrieval_op()
279 struct fscache_retrieval *op; in fscache_alloc_retrieval() local
282 op = kzalloc(sizeof(*op), GFP_NOIO); in fscache_alloc_retrieval()
283 if (!op) { in fscache_alloc_retrieval()
288 fscache_operation_init(&op->op, NULL, fscache_release_retrieval_op); in fscache_alloc_retrieval()
289 op->op.flags = FSCACHE_OP_MYTHREAD | in fscache_alloc_retrieval()
292 op->mapping = mapping; in fscache_alloc_retrieval()
293 op->end_io_func = end_io_func; in fscache_alloc_retrieval()
294 op->context = context; in fscache_alloc_retrieval()
295 op->start_time = jiffies; in fscache_alloc_retrieval()
296 INIT_LIST_HEAD(&op->to_do); in fscache_alloc_retrieval()
297 return op; in fscache_alloc_retrieval()
337 struct fscache_retrieval *op = in fscache_do_cancel_retrieval() local
338 container_of(_op, struct fscache_retrieval, op); in fscache_do_cancel_retrieval()
340 atomic_set(&op->n_pages, 0); in fscache_do_cancel_retrieval()
347 struct fscache_operation *op, in fscache_wait_for_operation_activation() argument
354 if (!test_bit(FSCACHE_OP_WAITING, &op->flags)) in fscache_wait_for_operation_activation()
360 if (wait_on_bit(&op->flags, FSCACHE_OP_WAITING, in fscache_wait_for_operation_activation()
362 ret = fscache_cancel_op(op, do_cancel); in fscache_wait_for_operation_activation()
368 wait_on_bit(&op->flags, FSCACHE_OP_WAITING, in fscache_wait_for_operation_activation()
374 if (op->state == FSCACHE_OP_ST_CANCELLED) { in fscache_wait_for_operation_activation()
381 pr_err("%s() = -ENOBUFS [obj dead %d]\n", __func__, op->state); in fscache_wait_for_operation_activation()
382 fscache_cancel_op(op, do_cancel); in fscache_wait_for_operation_activation()
405 struct fscache_retrieval *op; in __fscache_read_or_alloc_page() local
428 op = fscache_alloc_retrieval(cookie, page->mapping, in __fscache_read_or_alloc_page()
430 if (!op) { in __fscache_read_or_alloc_page()
434 atomic_set(&op->n_pages, 1); in __fscache_read_or_alloc_page()
448 __set_bit(FSCACHE_OP_DEC_READ_CNT, &op->op.flags); in __fscache_read_or_alloc_page()
450 if (fscache_submit_op(object, &op->op) < 0) in __fscache_read_or_alloc_page()
458 fscache_get_context(object->cookie, op->context); in __fscache_read_or_alloc_page()
463 object, &op->op, in __fscache_read_or_alloc_page()
473 ret = object->cache->ops->allocate_page(op, page, gfp); in __fscache_read_or_alloc_page()
479 ret = object->cache->ops->read_or_alloc_page(op, page, gfp); in __fscache_read_or_alloc_page()
495 fscache_put_retrieval(op); in __fscache_read_or_alloc_page()
506 kfree(op); in __fscache_read_or_alloc_page()
540 struct fscache_retrieval *op; in __fscache_read_or_alloc_pages() local
564 op = fscache_alloc_retrieval(cookie, mapping, end_io_func, context); in __fscache_read_or_alloc_pages()
565 if (!op) in __fscache_read_or_alloc_pages()
567 atomic_set(&op->n_pages, *nr_pages); in __fscache_read_or_alloc_pages()
579 __set_bit(FSCACHE_OP_DEC_READ_CNT, &op->op.flags); in __fscache_read_or_alloc_pages()
581 if (fscache_submit_op(object, &op->op) < 0) in __fscache_read_or_alloc_pages()
589 fscache_get_context(object->cookie, op->context); in __fscache_read_or_alloc_pages()
594 object, &op->op, in __fscache_read_or_alloc_pages()
605 op, pages, nr_pages, gfp); in __fscache_read_or_alloc_pages()
610 op, pages, nr_pages, gfp); in __fscache_read_or_alloc_pages()
626 fscache_put_retrieval(op); in __fscache_read_or_alloc_pages()
635 kfree(op); in __fscache_read_or_alloc_pages()
657 struct fscache_retrieval *op; in __fscache_alloc_page() local
680 op = fscache_alloc_retrieval(cookie, page->mapping, NULL, NULL); in __fscache_alloc_page()
681 if (!op) in __fscache_alloc_page()
683 atomic_set(&op->n_pages, 1); in __fscache_alloc_page()
694 if (fscache_submit_op(object, &op->op) < 0) in __fscache_alloc_page()
701 object, &op->op, in __fscache_alloc_page()
710 ret = object->cache->ops->allocate_page(op, page, gfp); in __fscache_alloc_page()
721 fscache_put_retrieval(op); in __fscache_alloc_page()
729 kfree(op); in __fscache_alloc_page()
768 struct fscache_storage *op = in fscache_write_op() local
769 container_of(_op, struct fscache_storage, op); in fscache_write_op()
770 struct fscache_object *object = op->op.object; in fscache_write_op()
777 _enter("{OP%x,%d}", op->op.debug_id, atomic_read(&op->op.usage)); in fscache_write_op()
787 fscache_op_complete(&op->op, false); in fscache_write_op()
800 fscache_op_complete(&op->op, false); in fscache_write_op()
819 if (page->index > op->store_limit) { in fscache_write_op()
834 ret = object->cache->ops->write_page(op, page); in fscache_write_op()
839 fscache_op_complete(&op->op, true); in fscache_write_op()
841 fscache_enqueue_operation(&op->op); in fscache_write_op()
854 fscache_op_complete(&op->op, true); in fscache_write_op()
926 struct fscache_storage *op; in __fscache_write_page() local
943 op = kzalloc(sizeof(*op), GFP_NOIO | __GFP_NOMEMALLOC | __GFP_NORETRY); in __fscache_write_page()
944 if (!op) in __fscache_write_page()
947 fscache_operation_init(&op->op, fscache_write_op, in __fscache_write_page()
949 op->op.flags = FSCACHE_OP_ASYNC | in __fscache_write_page()
995 op->op.debug_id = atomic_inc_return(&fscache_op_debug_id); in __fscache_write_page()
996 op->store_limit = object->store_limit; in __fscache_write_page()
999 if (fscache_submit_op(object, &op->op) < 0) in __fscache_write_page()
1008 fscache_put_operation(&op->op); in __fscache_write_page()
1019 kfree(op); in __fscache_write_page()
1039 kfree(op); in __fscache_write_page()
1047 kfree(op); in __fscache_write_page()
1113 void fscache_mark_page_cached(struct fscache_retrieval *op, struct page *page) in fscache_mark_page_cached() argument
1115 struct fscache_cookie *cookie = op->op.object->cookie; in fscache_mark_page_cached()
1133 op->mapping, page); in fscache_mark_page_cached()
1145 void fscache_mark_pages_cached(struct fscache_retrieval *op, in fscache_mark_pages_cached() argument
1151 fscache_mark_page_cached(op, pagevec->pages[loop]); in fscache_mark_pages_cached()