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, 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 fscache_put_operation(op); in __fscache_attr_changed()
256 struct fscache_retrieval *op = in fscache_do_cancel_retrieval() local
257 container_of(_op, struct fscache_retrieval, op); in fscache_do_cancel_retrieval()
259 atomic_set(&op->n_pages, 0); in fscache_do_cancel_retrieval()
267 struct fscache_retrieval *op = in fscache_release_retrieval_op() local
268 container_of(_op, struct fscache_retrieval, op); in fscache_release_retrieval_op()
270 _enter("{OP%x}", op->op.debug_id); in fscache_release_retrieval_op()
272 ASSERTIFCMP(op->op.state != FSCACHE_OP_ST_INITIALISED, in fscache_release_retrieval_op()
273 atomic_read(&op->n_pages), ==, 0); in fscache_release_retrieval_op()
275 fscache_hist(fscache_retrieval_histogram, op->start_time); in fscache_release_retrieval_op()
276 if (op->context) in fscache_release_retrieval_op()
277 fscache_put_context(op->cookie, op->context); in fscache_release_retrieval_op()
291 struct fscache_retrieval *op; in fscache_alloc_retrieval() local
294 op = kzalloc(sizeof(*op), GFP_NOIO); in fscache_alloc_retrieval()
295 if (!op) { in fscache_alloc_retrieval()
300 fscache_operation_init(&op->op, NULL, in fscache_alloc_retrieval()
303 op->op.flags = FSCACHE_OP_MYTHREAD | in fscache_alloc_retrieval()
306 op->cookie = cookie; in fscache_alloc_retrieval()
307 op->mapping = mapping; in fscache_alloc_retrieval()
308 op->end_io_func = end_io_func; in fscache_alloc_retrieval()
309 op->context = context; in fscache_alloc_retrieval()
310 op->start_time = jiffies; in fscache_alloc_retrieval()
311 INIT_LIST_HEAD(&op->to_do); in fscache_alloc_retrieval()
317 fscache_get_context(op->cookie, context); in fscache_alloc_retrieval()
318 return op; in fscache_alloc_retrieval()
357 struct fscache_operation *op, in fscache_wait_for_operation_activation() argument
363 if (!test_bit(FSCACHE_OP_WAITING, &op->flags)) in fscache_wait_for_operation_activation()
369 if (wait_on_bit(&op->flags, FSCACHE_OP_WAITING, in fscache_wait_for_operation_activation()
371 ret = fscache_cancel_op(op, false); in fscache_wait_for_operation_activation()
377 wait_on_bit(&op->flags, FSCACHE_OP_WAITING, in fscache_wait_for_operation_activation()
383 if (op->state == FSCACHE_OP_ST_CANCELLED) { in fscache_wait_for_operation_activation()
391 enum fscache_operation_state state = op->state; in fscache_wait_for_operation_activation()
392 fscache_cancel_op(op, true); in fscache_wait_for_operation_activation()
416 struct fscache_retrieval *op; in __fscache_read_or_alloc_page() local
439 op = fscache_alloc_retrieval(cookie, page->mapping, in __fscache_read_or_alloc_page()
441 if (!op) { in __fscache_read_or_alloc_page()
445 atomic_set(&op->n_pages, 1); in __fscache_read_or_alloc_page()
459 __set_bit(FSCACHE_OP_DEC_READ_CNT, &op->op.flags); in __fscache_read_or_alloc_page()
461 if (fscache_submit_op(object, &op->op) < 0) in __fscache_read_or_alloc_page()
470 object, &op->op, in __fscache_read_or_alloc_page()
479 ret = object->cache->ops->allocate_page(op, page, gfp); in __fscache_read_or_alloc_page()
485 ret = object->cache->ops->read_or_alloc_page(op, page, gfp); in __fscache_read_or_alloc_page()
501 fscache_put_retrieval(op); in __fscache_read_or_alloc_page()
512 fscache_put_retrieval(op); in __fscache_read_or_alloc_page()
546 struct fscache_retrieval *op; in __fscache_read_or_alloc_pages() local
570 op = fscache_alloc_retrieval(cookie, mapping, end_io_func, context); in __fscache_read_or_alloc_pages()
571 if (!op) in __fscache_read_or_alloc_pages()
573 atomic_set(&op->n_pages, *nr_pages); in __fscache_read_or_alloc_pages()
585 __set_bit(FSCACHE_OP_DEC_READ_CNT, &op->op.flags); in __fscache_read_or_alloc_pages()
587 if (fscache_submit_op(object, &op->op) < 0) in __fscache_read_or_alloc_pages()
596 object, &op->op, in __fscache_read_or_alloc_pages()
606 op, pages, nr_pages, gfp); in __fscache_read_or_alloc_pages()
611 op, pages, nr_pages, gfp); in __fscache_read_or_alloc_pages()
627 fscache_put_retrieval(op); in __fscache_read_or_alloc_pages()
636 fscache_put_retrieval(op); in __fscache_read_or_alloc_pages()
658 struct fscache_retrieval *op; in __fscache_alloc_page() local
681 op = fscache_alloc_retrieval(cookie, page->mapping, NULL, NULL); in __fscache_alloc_page()
682 if (!op) in __fscache_alloc_page()
684 atomic_set(&op->n_pages, 1); in __fscache_alloc_page()
695 if (fscache_submit_op(object, &op->op) < 0) in __fscache_alloc_page()
702 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 fscache_put_retrieval(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()
788 fscache_op_complete(&op->op, false); in fscache_write_op()
801 fscache_op_complete(&op->op, false); in fscache_write_op()
829 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()
859 fscache_op_complete(&op->op, true); in fscache_write_op()
933 struct fscache_storage *op; in __fscache_write_page() local
950 op = kzalloc(sizeof(*op), GFP_NOIO | __GFP_NOMEMALLOC | __GFP_NORETRY); in __fscache_write_page()
951 if (!op) in __fscache_write_page()
954 fscache_operation_init(&op->op, fscache_write_op, NULL, in __fscache_write_page()
956 op->op.flags = FSCACHE_OP_ASYNC | in __fscache_write_page()
1002 op->op.debug_id = atomic_inc_return(&fscache_op_debug_id); in __fscache_write_page()
1003 op->store_limit = object->store_limit; in __fscache_write_page()
1006 if (fscache_submit_op(object, &op->op) < 0) in __fscache_write_page()
1015 fscache_put_operation(&op->op); in __fscache_write_page()
1026 fscache_put_operation(&op->op); in __fscache_write_page()
1046 fscache_put_operation(&op->op); in __fscache_write_page()
1054 fscache_put_operation(&op->op); in __fscache_write_page()
1120 void fscache_mark_page_cached(struct fscache_retrieval *op, struct page *page) in fscache_mark_page_cached() argument
1122 struct fscache_cookie *cookie = op->op.object->cookie; in fscache_mark_page_cached()
1140 op->mapping, page); in fscache_mark_page_cached()
1152 void fscache_mark_pages_cached(struct fscache_retrieval *op, in fscache_mark_pages_cached() argument
1158 fscache_mark_page_cached(op, pagevec->pages[loop]); in fscache_mark_pages_cached()