Lines Matching refs:op
191 static void fscache_attr_changed_op(struct fscache_operation *op) in fscache_attr_changed_op() argument
193 struct fscache_object *object = op->object; in fscache_attr_changed_op()
196 _enter("{OBJ%x OP%x}", object->debug_id, op->debug_id); in fscache_attr_changed_op()
206 fscache_op_complete(op, ret < 0); in fscache_attr_changed_op()
208 fscache_op_complete(op, true); in fscache_attr_changed_op()
219 struct fscache_operation *op; in __fscache_attr_changed() local
229 op = kzalloc(sizeof(*op), GFP_KERNEL); in __fscache_attr_changed()
230 if (!op) { in __fscache_attr_changed()
236 fscache_operation_init(cookie, op, fscache_attr_changed_op, NULL, NULL); in __fscache_attr_changed()
237 trace_fscache_page_op(cookie, NULL, op, fscache_page_op_attr_changed); in __fscache_attr_changed()
238 op->flags = FSCACHE_OP_ASYNC | in __fscache_attr_changed()
251 if (fscache_submit_exclusive_op(object, op) < 0) in __fscache_attr_changed()
255 fscache_put_operation(op); in __fscache_attr_changed()
263 fscache_put_operation(op); in __fscache_attr_changed()
277 struct fscache_retrieval *op = in fscache_do_cancel_retrieval() local
278 container_of(_op, struct fscache_retrieval, op); in fscache_do_cancel_retrieval()
280 atomic_set(&op->n_pages, 0); in fscache_do_cancel_retrieval()
288 struct fscache_retrieval *op = in fscache_release_retrieval_op() local
289 container_of(_op, struct fscache_retrieval, op); in fscache_release_retrieval_op()
291 _enter("{OP%x}", op->op.debug_id); in fscache_release_retrieval_op()
293 ASSERTIFCMP(op->op.state != FSCACHE_OP_ST_INITIALISED, in fscache_release_retrieval_op()
294 atomic_read(&op->n_pages), ==, 0); in fscache_release_retrieval_op()
296 fscache_hist(fscache_retrieval_histogram, op->start_time); in fscache_release_retrieval_op()
297 if (op->context) in fscache_release_retrieval_op()
298 fscache_put_context(op->cookie, op->context); in fscache_release_retrieval_op()
312 struct fscache_retrieval *op; in fscache_alloc_retrieval() local
315 op = kzalloc(sizeof(*op), GFP_NOIO); in fscache_alloc_retrieval()
316 if (!op) { in fscache_alloc_retrieval()
321 fscache_operation_init(cookie, &op->op, NULL, in fscache_alloc_retrieval()
324 op->op.flags = FSCACHE_OP_MYTHREAD | in fscache_alloc_retrieval()
327 op->cookie = cookie; in fscache_alloc_retrieval()
328 op->mapping = mapping; in fscache_alloc_retrieval()
329 op->end_io_func = end_io_func; in fscache_alloc_retrieval()
330 op->context = context; in fscache_alloc_retrieval()
331 op->start_time = jiffies; in fscache_alloc_retrieval()
332 INIT_LIST_HEAD(&op->to_do); in fscache_alloc_retrieval()
338 fscache_get_context(op->cookie, context); in fscache_alloc_retrieval()
339 return op; in fscache_alloc_retrieval()
378 struct fscache_operation *op, in fscache_wait_for_operation_activation() argument
384 if (!test_bit(FSCACHE_OP_WAITING, &op->flags)) in fscache_wait_for_operation_activation()
390 if (wait_on_bit(&op->flags, FSCACHE_OP_WAITING, in fscache_wait_for_operation_activation()
392 trace_fscache_op(object->cookie, op, fscache_op_signal); in fscache_wait_for_operation_activation()
393 ret = fscache_cancel_op(op, false); in fscache_wait_for_operation_activation()
399 wait_on_bit(&op->flags, FSCACHE_OP_WAITING, in fscache_wait_for_operation_activation()
405 if (op->state == FSCACHE_OP_ST_CANCELLED) { in fscache_wait_for_operation_activation()
413 enum fscache_operation_state state = op->state; in fscache_wait_for_operation_activation()
414 trace_fscache_op(object->cookie, op, fscache_op_signal); in fscache_wait_for_operation_activation()
415 fscache_cancel_op(op, true); in fscache_wait_for_operation_activation()
439 struct fscache_retrieval *op; in __fscache_read_or_alloc_page() local
462 op = fscache_alloc_retrieval(cookie, page->mapping, in __fscache_read_or_alloc_page()
464 if (!op) { in __fscache_read_or_alloc_page()
468 atomic_set(&op->n_pages, 1); in __fscache_read_or_alloc_page()
469 trace_fscache_page_op(cookie, page, &op->op, fscache_page_op_retr_one); in __fscache_read_or_alloc_page()
483 __set_bit(FSCACHE_OP_DEC_READ_CNT, &op->op.flags); in __fscache_read_or_alloc_page()
485 if (fscache_submit_op(object, &op->op) < 0) in __fscache_read_or_alloc_page()
494 object, &op->op, in __fscache_read_or_alloc_page()
503 ret = object->cache->ops->allocate_page(op, page, gfp); in __fscache_read_or_alloc_page()
509 ret = object->cache->ops->read_or_alloc_page(op, page, gfp); in __fscache_read_or_alloc_page()
525 fscache_put_retrieval(op); in __fscache_read_or_alloc_page()
536 fscache_put_retrieval(op); in __fscache_read_or_alloc_page()
570 struct fscache_retrieval *op; in __fscache_read_or_alloc_pages() local
594 op = fscache_alloc_retrieval(cookie, mapping, end_io_func, context); in __fscache_read_or_alloc_pages()
595 if (!op) in __fscache_read_or_alloc_pages()
597 atomic_set(&op->n_pages, *nr_pages); in __fscache_read_or_alloc_pages()
598 trace_fscache_page_op(cookie, NULL, &op->op, fscache_page_op_retr_multi); in __fscache_read_or_alloc_pages()
610 __set_bit(FSCACHE_OP_DEC_READ_CNT, &op->op.flags); in __fscache_read_or_alloc_pages()
612 if (fscache_submit_op(object, &op->op) < 0) in __fscache_read_or_alloc_pages()
621 object, &op->op, in __fscache_read_or_alloc_pages()
631 op, pages, nr_pages, gfp); in __fscache_read_or_alloc_pages()
636 op, pages, nr_pages, gfp); in __fscache_read_or_alloc_pages()
652 fscache_put_retrieval(op); in __fscache_read_or_alloc_pages()
661 fscache_put_retrieval(op); in __fscache_read_or_alloc_pages()
683 struct fscache_retrieval *op; in __fscache_alloc_page() local
706 op = fscache_alloc_retrieval(cookie, page->mapping, NULL, NULL); in __fscache_alloc_page()
707 if (!op) in __fscache_alloc_page()
709 atomic_set(&op->n_pages, 1); in __fscache_alloc_page()
710 trace_fscache_page_op(cookie, page, &op->op, fscache_page_op_alloc_one); in __fscache_alloc_page()
721 if (fscache_submit_op(object, &op->op) < 0) in __fscache_alloc_page()
728 object, &op->op, in __fscache_alloc_page()
736 ret = object->cache->ops->allocate_page(op, page, gfp); in __fscache_alloc_page()
747 fscache_put_retrieval(op); in __fscache_alloc_page()
755 fscache_put_retrieval(op); in __fscache_alloc_page()
794 struct fscache_storage *op = in fscache_write_op() local
795 container_of(_op, struct fscache_storage, op); in fscache_write_op()
796 struct fscache_object *object = op->op.object; in fscache_write_op()
803 _enter("{OP%x,%d}", op->op.debug_id, atomic_read(&op->op.usage)); in fscache_write_op()
815 fscache_op_complete(&op->op, true); in fscache_write_op()
828 fscache_op_complete(&op->op, true); in fscache_write_op()
844 trace_fscache_gang_lookup(cookie, &op->op, results, n, op->store_limit); in fscache_write_op()
859 if (page->index >= op->store_limit) in fscache_write_op()
864 ret = object->cache->ops->write_page(op, page); in fscache_write_op()
866 trace_fscache_wrote_page(cookie, page, &op->op, ret); in fscache_write_op()
870 fscache_op_complete(&op->op, true); in fscache_write_op()
872 fscache_enqueue_operation(&op->op); in fscache_write_op()
880 trace_fscache_wrote_page(cookie, page, &op->op, -ENOBUFS); in fscache_write_op()
891 fscache_op_complete(&op->op, false); in fscache_write_op()
969 struct fscache_storage *op; in __fscache_write_page() local
986 op = kzalloc(sizeof(*op), GFP_NOIO | __GFP_NOMEMALLOC | __GFP_NORETRY); in __fscache_write_page()
987 if (!op) in __fscache_write_page()
990 fscache_operation_init(cookie, &op->op, fscache_write_op, NULL, in __fscache_write_page()
992 op->op.flags = FSCACHE_OP_ASYNC | in __fscache_write_page()
1000 trace_fscache_page_op(cookie, page, &op->op, fscache_page_op_write_one); in __fscache_write_page()
1048 op->op.debug_id = atomic_inc_return(&fscache_op_debug_id); in __fscache_write_page()
1049 op->store_limit = object->store_limit; in __fscache_write_page()
1052 if (fscache_submit_op(object, &op->op) < 0) in __fscache_write_page()
1061 fscache_put_operation(&op->op); in __fscache_write_page()
1072 fscache_put_operation(&op->op); in __fscache_write_page()
1093 fscache_put_operation(&op->op); in __fscache_write_page()
1101 fscache_put_operation(&op->op); in __fscache_write_page()
1169 void fscache_mark_page_cached(struct fscache_retrieval *op, struct page *page) in fscache_mark_page_cached() argument
1171 struct fscache_cookie *cookie = op->op.object->cookie; in fscache_mark_page_cached()
1191 op->mapping, page); in fscache_mark_page_cached()
1203 void fscache_mark_pages_cached(struct fscache_retrieval *op, in fscache_mark_pages_cached() argument
1209 fscache_mark_page_cached(op, pagevec->pages[loop]); in fscache_mark_pages_cached()