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 if (op->context) in fscache_release_retrieval_op()
293 fscache_put_context(op->cookie, op->context); in fscache_release_retrieval_op()
307 struct fscache_retrieval *op; in fscache_alloc_retrieval() local
310 op = kzalloc(sizeof(*op), GFP_NOIO); in fscache_alloc_retrieval()
311 if (!op) { in fscache_alloc_retrieval()
316 fscache_operation_init(cookie, &op->op, NULL, in fscache_alloc_retrieval()
319 op->op.flags = FSCACHE_OP_MYTHREAD | in fscache_alloc_retrieval()
322 op->cookie = cookie; in fscache_alloc_retrieval()
323 op->mapping = mapping; in fscache_alloc_retrieval()
324 op->end_io_func = end_io_func; in fscache_alloc_retrieval()
325 op->context = context; in fscache_alloc_retrieval()
326 INIT_LIST_HEAD(&op->to_do); in fscache_alloc_retrieval()
332 fscache_get_context(op->cookie, context); in fscache_alloc_retrieval()
333 return op; in fscache_alloc_retrieval()
368 struct fscache_operation *op, in fscache_wait_for_operation_activation() argument
374 if (!test_bit(FSCACHE_OP_WAITING, &op->flags)) in fscache_wait_for_operation_activation()
380 if (wait_on_bit(&op->flags, FSCACHE_OP_WAITING, in fscache_wait_for_operation_activation()
382 trace_fscache_op(object->cookie, op, fscache_op_signal); in fscache_wait_for_operation_activation()
383 ret = fscache_cancel_op(op, false); in fscache_wait_for_operation_activation()
389 wait_on_bit(&op->flags, FSCACHE_OP_WAITING, in fscache_wait_for_operation_activation()
395 if (op->state == FSCACHE_OP_ST_CANCELLED) { in fscache_wait_for_operation_activation()
403 enum fscache_operation_state state = op->state; in fscache_wait_for_operation_activation()
404 trace_fscache_op(object->cookie, op, fscache_op_signal); in fscache_wait_for_operation_activation()
405 fscache_cancel_op(op, true); in fscache_wait_for_operation_activation()
429 struct fscache_retrieval *op; in __fscache_read_or_alloc_page() local
452 op = fscache_alloc_retrieval(cookie, page->mapping, in __fscache_read_or_alloc_page()
454 if (!op) { in __fscache_read_or_alloc_page()
458 atomic_set(&op->n_pages, 1); in __fscache_read_or_alloc_page()
459 trace_fscache_page_op(cookie, page, &op->op, fscache_page_op_retr_one); in __fscache_read_or_alloc_page()
473 __set_bit(FSCACHE_OP_DEC_READ_CNT, &op->op.flags); in __fscache_read_or_alloc_page()
475 if (fscache_submit_op(object, &op->op) < 0) in __fscache_read_or_alloc_page()
484 object, &op->op, in __fscache_read_or_alloc_page()
493 ret = object->cache->ops->allocate_page(op, page, gfp); in __fscache_read_or_alloc_page()
499 ret = object->cache->ops->read_or_alloc_page(op, page, gfp); in __fscache_read_or_alloc_page()
515 fscache_put_retrieval(op); in __fscache_read_or_alloc_page()
526 fscache_put_retrieval(op); in __fscache_read_or_alloc_page()
560 struct fscache_retrieval *op; in __fscache_read_or_alloc_pages() local
584 op = fscache_alloc_retrieval(cookie, mapping, end_io_func, context); in __fscache_read_or_alloc_pages()
585 if (!op) in __fscache_read_or_alloc_pages()
587 atomic_set(&op->n_pages, *nr_pages); in __fscache_read_or_alloc_pages()
588 trace_fscache_page_op(cookie, NULL, &op->op, fscache_page_op_retr_multi); in __fscache_read_or_alloc_pages()
600 __set_bit(FSCACHE_OP_DEC_READ_CNT, &op->op.flags); in __fscache_read_or_alloc_pages()
602 if (fscache_submit_op(object, &op->op) < 0) in __fscache_read_or_alloc_pages()
611 object, &op->op, in __fscache_read_or_alloc_pages()
621 op, pages, nr_pages, gfp); in __fscache_read_or_alloc_pages()
626 op, pages, nr_pages, gfp); in __fscache_read_or_alloc_pages()
642 fscache_put_retrieval(op); in __fscache_read_or_alloc_pages()
651 fscache_put_retrieval(op); in __fscache_read_or_alloc_pages()
673 struct fscache_retrieval *op; in __fscache_alloc_page() local
696 op = fscache_alloc_retrieval(cookie, page->mapping, NULL, NULL); in __fscache_alloc_page()
697 if (!op) in __fscache_alloc_page()
699 atomic_set(&op->n_pages, 1); in __fscache_alloc_page()
700 trace_fscache_page_op(cookie, page, &op->op, fscache_page_op_alloc_one); in __fscache_alloc_page()
711 if (fscache_submit_op(object, &op->op) < 0) in __fscache_alloc_page()
718 object, &op->op, in __fscache_alloc_page()
726 ret = object->cache->ops->allocate_page(op, page, gfp); in __fscache_alloc_page()
737 fscache_put_retrieval(op); in __fscache_alloc_page()
745 fscache_put_retrieval(op); in __fscache_alloc_page()
784 struct fscache_storage *op = in fscache_write_op() local
785 container_of(_op, struct fscache_storage, op); in fscache_write_op()
786 struct fscache_object *object = op->op.object; in fscache_write_op()
793 _enter("{OP%x,%d}", op->op.debug_id, atomic_read(&op->op.usage)); in fscache_write_op()
805 fscache_op_complete(&op->op, true); in fscache_write_op()
818 fscache_op_complete(&op->op, true); in fscache_write_op()
834 trace_fscache_gang_lookup(cookie, &op->op, results, n, op->store_limit); in fscache_write_op()
849 if (page->index >= op->store_limit) in fscache_write_op()
854 ret = object->cache->ops->write_page(op, page); in fscache_write_op()
856 trace_fscache_wrote_page(cookie, page, &op->op, ret); in fscache_write_op()
860 fscache_op_complete(&op->op, true); in fscache_write_op()
862 fscache_enqueue_operation(&op->op); in fscache_write_op()
870 trace_fscache_wrote_page(cookie, page, &op->op, -ENOBUFS); in fscache_write_op()
881 fscache_op_complete(&op->op, false); in fscache_write_op()
959 struct fscache_storage *op; in __fscache_write_page() local
976 op = kzalloc(sizeof(*op), GFP_NOIO | __GFP_NOMEMALLOC | __GFP_NORETRY); in __fscache_write_page()
977 if (!op) in __fscache_write_page()
980 fscache_operation_init(cookie, &op->op, fscache_write_op, NULL, in __fscache_write_page()
982 op->op.flags = FSCACHE_OP_ASYNC | in __fscache_write_page()
990 trace_fscache_page_op(cookie, page, &op->op, fscache_page_op_write_one); in __fscache_write_page()
1038 op->op.debug_id = atomic_inc_return(&fscache_op_debug_id); in __fscache_write_page()
1039 op->store_limit = object->store_limit; in __fscache_write_page()
1042 if (fscache_submit_op(object, &op->op) < 0) in __fscache_write_page()
1051 fscache_put_operation(&op->op); in __fscache_write_page()
1062 fscache_put_operation(&op->op); in __fscache_write_page()
1083 fscache_put_operation(&op->op); in __fscache_write_page()
1091 fscache_put_operation(&op->op); in __fscache_write_page()
1159 void fscache_mark_page_cached(struct fscache_retrieval *op, struct page *page) in fscache_mark_page_cached() argument
1161 struct fscache_cookie *cookie = op->op.object->cookie; in fscache_mark_page_cached()
1181 op->mapping, page); in fscache_mark_page_cached()
1193 void fscache_mark_pages_cached(struct fscache_retrieval *op, in fscache_mark_pages_cached() argument
1199 fscache_mark_page_cached(op, pagevec->pages[loop]); in fscache_mark_pages_cached()