Lines Matching refs:op
187 static void fscache_attr_changed_op(struct fscache_operation *op) in fscache_attr_changed_op() argument
189 struct fscache_object *object = op->object; in fscache_attr_changed_op()
192 _enter("{OBJ%x OP%x}", object->debug_id, op->debug_id); in fscache_attr_changed_op()
202 fscache_op_complete(op, ret < 0); in fscache_attr_changed_op()
204 fscache_op_complete(op, true); in fscache_attr_changed_op()
215 struct fscache_operation *op; in __fscache_attr_changed() local
225 op = kzalloc(sizeof(*op), GFP_KERNEL); in __fscache_attr_changed()
226 if (!op) { in __fscache_attr_changed()
232 fscache_operation_init(cookie, op, fscache_attr_changed_op, NULL, NULL); in __fscache_attr_changed()
233 trace_fscache_page_op(cookie, NULL, op, fscache_page_op_attr_changed); in __fscache_attr_changed()
234 op->flags = FSCACHE_OP_ASYNC | in __fscache_attr_changed()
247 if (fscache_submit_exclusive_op(object, op) < 0) in __fscache_attr_changed()
251 fscache_put_operation(op); in __fscache_attr_changed()
259 fscache_put_operation(op); in __fscache_attr_changed()
273 struct fscache_retrieval *op = in fscache_do_cancel_retrieval() local
274 container_of(_op, struct fscache_retrieval, op); in fscache_do_cancel_retrieval()
276 atomic_set(&op->n_pages, 0); in fscache_do_cancel_retrieval()
284 struct fscache_retrieval *op = in fscache_release_retrieval_op() local
285 container_of(_op, struct fscache_retrieval, op); in fscache_release_retrieval_op()
287 _enter("{OP%x}", op->op.debug_id); in fscache_release_retrieval_op()
289 ASSERTIFCMP(op->op.state != FSCACHE_OP_ST_INITIALISED, in fscache_release_retrieval_op()
290 atomic_read(&op->n_pages), ==, 0); in fscache_release_retrieval_op()
292 fscache_hist(fscache_retrieval_histogram, op->start_time); in fscache_release_retrieval_op()
293 if (op->context) in fscache_release_retrieval_op()
294 fscache_put_context(op->cookie, op->context); in fscache_release_retrieval_op()
308 struct fscache_retrieval *op; in fscache_alloc_retrieval() local
311 op = kzalloc(sizeof(*op), GFP_NOIO); in fscache_alloc_retrieval()
312 if (!op) { in fscache_alloc_retrieval()
317 fscache_operation_init(cookie, &op->op, NULL, in fscache_alloc_retrieval()
320 op->op.flags = FSCACHE_OP_MYTHREAD | in fscache_alloc_retrieval()
323 op->cookie = cookie; in fscache_alloc_retrieval()
324 op->mapping = mapping; in fscache_alloc_retrieval()
325 op->end_io_func = end_io_func; in fscache_alloc_retrieval()
326 op->context = context; in fscache_alloc_retrieval()
327 op->start_time = jiffies; in fscache_alloc_retrieval()
328 INIT_LIST_HEAD(&op->to_do); in fscache_alloc_retrieval()
334 fscache_get_context(op->cookie, context); in fscache_alloc_retrieval()
335 return op; in fscache_alloc_retrieval()
374 struct fscache_operation *op, in fscache_wait_for_operation_activation() argument
380 if (!test_bit(FSCACHE_OP_WAITING, &op->flags)) in fscache_wait_for_operation_activation()
386 if (wait_on_bit(&op->flags, FSCACHE_OP_WAITING, in fscache_wait_for_operation_activation()
388 trace_fscache_op(object->cookie, op, fscache_op_signal); in fscache_wait_for_operation_activation()
389 ret = fscache_cancel_op(op, false); in fscache_wait_for_operation_activation()
395 wait_on_bit(&op->flags, FSCACHE_OP_WAITING, in fscache_wait_for_operation_activation()
401 if (op->state == FSCACHE_OP_ST_CANCELLED) { in fscache_wait_for_operation_activation()
409 enum fscache_operation_state state = op->state; in fscache_wait_for_operation_activation()
410 trace_fscache_op(object->cookie, op, fscache_op_signal); in fscache_wait_for_operation_activation()
411 fscache_cancel_op(op, true); in fscache_wait_for_operation_activation()
435 struct fscache_retrieval *op; in __fscache_read_or_alloc_page() local
458 op = fscache_alloc_retrieval(cookie, page->mapping, in __fscache_read_or_alloc_page()
460 if (!op) { in __fscache_read_or_alloc_page()
464 atomic_set(&op->n_pages, 1); in __fscache_read_or_alloc_page()
465 trace_fscache_page_op(cookie, page, &op->op, fscache_page_op_retr_one); in __fscache_read_or_alloc_page()
479 __set_bit(FSCACHE_OP_DEC_READ_CNT, &op->op.flags); in __fscache_read_or_alloc_page()
481 if (fscache_submit_op(object, &op->op) < 0) in __fscache_read_or_alloc_page()
490 object, &op->op, in __fscache_read_or_alloc_page()
499 ret = object->cache->ops->allocate_page(op, page, gfp); in __fscache_read_or_alloc_page()
505 ret = object->cache->ops->read_or_alloc_page(op, page, gfp); in __fscache_read_or_alloc_page()
521 fscache_put_retrieval(op); in __fscache_read_or_alloc_page()
532 fscache_put_retrieval(op); in __fscache_read_or_alloc_page()
566 struct fscache_retrieval *op; in __fscache_read_or_alloc_pages() local
590 op = fscache_alloc_retrieval(cookie, mapping, end_io_func, context); in __fscache_read_or_alloc_pages()
591 if (!op) in __fscache_read_or_alloc_pages()
593 atomic_set(&op->n_pages, *nr_pages); in __fscache_read_or_alloc_pages()
594 trace_fscache_page_op(cookie, NULL, &op->op, fscache_page_op_retr_multi); in __fscache_read_or_alloc_pages()
606 __set_bit(FSCACHE_OP_DEC_READ_CNT, &op->op.flags); in __fscache_read_or_alloc_pages()
608 if (fscache_submit_op(object, &op->op) < 0) in __fscache_read_or_alloc_pages()
617 object, &op->op, in __fscache_read_or_alloc_pages()
627 op, pages, nr_pages, gfp); in __fscache_read_or_alloc_pages()
632 op, pages, nr_pages, gfp); in __fscache_read_or_alloc_pages()
648 fscache_put_retrieval(op); in __fscache_read_or_alloc_pages()
657 fscache_put_retrieval(op); in __fscache_read_or_alloc_pages()
679 struct fscache_retrieval *op; in __fscache_alloc_page() local
702 op = fscache_alloc_retrieval(cookie, page->mapping, NULL, NULL); in __fscache_alloc_page()
703 if (!op) in __fscache_alloc_page()
705 atomic_set(&op->n_pages, 1); in __fscache_alloc_page()
706 trace_fscache_page_op(cookie, page, &op->op, fscache_page_op_alloc_one); in __fscache_alloc_page()
717 if (fscache_submit_op(object, &op->op) < 0) in __fscache_alloc_page()
724 object, &op->op, in __fscache_alloc_page()
732 ret = object->cache->ops->allocate_page(op, page, gfp); in __fscache_alloc_page()
743 fscache_put_retrieval(op); in __fscache_alloc_page()
751 fscache_put_retrieval(op); in __fscache_alloc_page()
790 struct fscache_storage *op = in fscache_write_op() local
791 container_of(_op, struct fscache_storage, op); in fscache_write_op()
792 struct fscache_object *object = op->op.object; in fscache_write_op()
799 _enter("{OP%x,%d}", op->op.debug_id, atomic_read(&op->op.usage)); in fscache_write_op()
811 fscache_op_complete(&op->op, true); in fscache_write_op()
824 fscache_op_complete(&op->op, true); in fscache_write_op()
840 trace_fscache_gang_lookup(cookie, &op->op, results, n, op->store_limit); in fscache_write_op()
855 if (page->index >= op->store_limit) in fscache_write_op()
860 ret = object->cache->ops->write_page(op, page); in fscache_write_op()
862 trace_fscache_wrote_page(cookie, page, &op->op, ret); in fscache_write_op()
866 fscache_op_complete(&op->op, true); in fscache_write_op()
868 fscache_enqueue_operation(&op->op); in fscache_write_op()
876 trace_fscache_wrote_page(cookie, page, &op->op, -ENOBUFS); in fscache_write_op()
887 fscache_op_complete(&op->op, false); in fscache_write_op()
965 struct fscache_storage *op; in __fscache_write_page() local
982 op = kzalloc(sizeof(*op), GFP_NOIO | __GFP_NOMEMALLOC | __GFP_NORETRY); in __fscache_write_page()
983 if (!op) in __fscache_write_page()
986 fscache_operation_init(cookie, &op->op, fscache_write_op, NULL, in __fscache_write_page()
988 op->op.flags = FSCACHE_OP_ASYNC | in __fscache_write_page()
996 trace_fscache_page_op(cookie, page, &op->op, fscache_page_op_write_one); in __fscache_write_page()
1044 op->op.debug_id = atomic_inc_return(&fscache_op_debug_id); in __fscache_write_page()
1045 op->store_limit = object->store_limit; in __fscache_write_page()
1048 if (fscache_submit_op(object, &op->op) < 0) in __fscache_write_page()
1057 fscache_put_operation(&op->op); in __fscache_write_page()
1068 fscache_put_operation(&op->op); in __fscache_write_page()
1089 fscache_put_operation(&op->op); in __fscache_write_page()
1097 fscache_put_operation(&op->op); in __fscache_write_page()
1165 void fscache_mark_page_cached(struct fscache_retrieval *op, struct page *page) in fscache_mark_page_cached() argument
1167 struct fscache_cookie *cookie = op->op.object->cookie; in fscache_mark_page_cached()
1187 op->mapping, page); in fscache_mark_page_cached()
1199 void fscache_mark_pages_cached(struct fscache_retrieval *op, in fscache_mark_pages_cached() argument
1205 fscache_mark_page_cached(op, pagevec->pages[loop]); in fscache_mark_pages_cached()