Lines Matching refs:object
63 op->object->debug_id, op->debug_id, atomic_read(&op->usage)); in fscache_enqueue_operation()
67 ASSERT(fscache_object_is_available(op->object)); in fscache_enqueue_operation()
93 static void fscache_run_op(struct fscache_object *object, in fscache_run_op() argument
99 object->n_in_progress++; in fscache_run_op()
110 static void fscache_report_unexpected_submission(struct fscache_object *object, in fscache_report_unexpected_submission() argument
123 op->debug_id, object->debug_id, object->state->name); in fscache_report_unexpected_submission()
124 kdebug("objstate=%s [%s]", object->state->name, ostate->name); in fscache_report_unexpected_submission()
125 kdebug("objflags=%lx", object->flags); in fscache_report_unexpected_submission()
126 kdebug("objevent=%lx [%lx]", object->events, object->event_mask); in fscache_report_unexpected_submission()
128 object->n_ops, object->n_in_progress, object->n_exclusive); in fscache_report_unexpected_submission()
130 if (!list_empty(&object->pending_ops)) { in fscache_report_unexpected_submission()
132 list_for_each_entry(p, &object->pending_ops, pend_link) { in fscache_report_unexpected_submission()
133 ASSERTCMP(p->object, ==, object); in fscache_report_unexpected_submission()
149 int fscache_submit_exclusive_op(struct fscache_object *object, in fscache_submit_exclusive_op() argument
156 _enter("{OBJ%x OP%x},", object->debug_id, op->debug_id); in fscache_submit_exclusive_op()
161 spin_lock(&object->lock); in fscache_submit_exclusive_op()
162 ASSERTCMP(object->n_ops, >=, object->n_in_progress); in fscache_submit_exclusive_op()
163 ASSERTCMP(object->n_ops, >=, object->n_exclusive); in fscache_submit_exclusive_op()
166 ostate = object->state; in fscache_submit_exclusive_op()
170 flags = READ_ONCE(object->flags); in fscache_submit_exclusive_op()
176 } else if (unlikely(fscache_cache_is_broken(object))) { in fscache_submit_exclusive_op()
181 op->object = object; in fscache_submit_exclusive_op()
182 object->n_ops++; in fscache_submit_exclusive_op()
183 object->n_exclusive++; /* reads and writes must wait */ in fscache_submit_exclusive_op()
185 if (object->n_in_progress > 0) { in fscache_submit_exclusive_op()
187 list_add_tail(&op->pend_link, &object->pending_ops); in fscache_submit_exclusive_op()
189 } else if (!list_empty(&object->pending_ops)) { in fscache_submit_exclusive_op()
191 list_add_tail(&op->pend_link, &object->pending_ops); in fscache_submit_exclusive_op()
193 fscache_start_operations(object); in fscache_submit_exclusive_op()
195 ASSERTCMP(object->n_in_progress, ==, 0); in fscache_submit_exclusive_op()
196 fscache_run_op(object, op); in fscache_submit_exclusive_op()
200 clear_bit(FSCACHE_OBJECT_PENDING_WRITE, &object->flags); in fscache_submit_exclusive_op()
203 op->object = object; in fscache_submit_exclusive_op()
204 object->n_ops++; in fscache_submit_exclusive_op()
205 object->n_exclusive++; /* reads and writes must wait */ in fscache_submit_exclusive_op()
207 list_add_tail(&op->pend_link, &object->pending_ops); in fscache_submit_exclusive_op()
215 fscache_report_unexpected_submission(object, op, ostate); in fscache_submit_exclusive_op()
221 spin_unlock(&object->lock); in fscache_submit_exclusive_op()
233 int fscache_submit_op(struct fscache_object *object, in fscache_submit_op() argument
241 object->debug_id, op->debug_id, atomic_read(&op->usage)); in fscache_submit_op()
246 spin_lock(&object->lock); in fscache_submit_op()
247 ASSERTCMP(object->n_ops, >=, object->n_in_progress); in fscache_submit_op()
248 ASSERTCMP(object->n_ops, >=, object->n_exclusive); in fscache_submit_op()
251 ostate = object->state; in fscache_submit_op()
255 flags = READ_ONCE(object->flags); in fscache_submit_op()
261 } else if (unlikely(fscache_cache_is_broken(object))) { in fscache_submit_op()
266 op->object = object; in fscache_submit_op()
267 object->n_ops++; in fscache_submit_op()
269 if (object->n_exclusive > 0) { in fscache_submit_op()
271 list_add_tail(&op->pend_link, &object->pending_ops); in fscache_submit_op()
273 } else if (!list_empty(&object->pending_ops)) { in fscache_submit_op()
275 list_add_tail(&op->pend_link, &object->pending_ops); in fscache_submit_op()
277 fscache_start_operations(object); in fscache_submit_op()
279 ASSERTCMP(object->n_exclusive, ==, 0); in fscache_submit_op()
280 fscache_run_op(object, op); in fscache_submit_op()
284 op->object = object; in fscache_submit_op()
285 object->n_ops++; in fscache_submit_op()
287 list_add_tail(&op->pend_link, &object->pending_ops); in fscache_submit_op()
295 fscache_report_unexpected_submission(object, op, ostate); in fscache_submit_op()
296 ASSERT(!fscache_object_is_active(object)); in fscache_submit_op()
302 spin_unlock(&object->lock); in fscache_submit_op()
310 void fscache_abort_object(struct fscache_object *object) in fscache_abort_object() argument
312 _enter("{OBJ%x}", object->debug_id); in fscache_abort_object()
314 fscache_raise_event(object, FSCACHE_OBJECT_EV_ERROR); in fscache_abort_object()
321 void fscache_start_operations(struct fscache_object *object) in fscache_start_operations() argument
326 while (!list_empty(&object->pending_ops) && !stop) { in fscache_start_operations()
327 op = list_entry(object->pending_ops.next, in fscache_start_operations()
331 if (object->n_in_progress > 0) in fscache_start_operations()
336 fscache_run_op(object, op); in fscache_start_operations()
342 ASSERTCMP(object->n_in_progress, <=, object->n_ops); in fscache_start_operations()
345 object->n_in_progress, object->debug_id); in fscache_start_operations()
354 struct fscache_object *object = op->object; in fscache_cancel_op() local
358 _enter("OBJ%x OP%x}", op->object->debug_id, op->debug_id); in fscache_cancel_op()
364 spin_lock(&object->lock); in fscache_cancel_op()
376 object->n_exclusive--; in fscache_cancel_op()
381 ASSERTCMP(object->n_in_progress, >, 0); in fscache_cancel_op()
383 object->n_exclusive--; in fscache_cancel_op()
384 object->n_in_progress--; in fscache_cancel_op()
385 if (object->n_in_progress == 0) in fscache_cancel_op()
386 fscache_start_operations(object); in fscache_cancel_op()
392 object->n_exclusive--; in fscache_cancel_op()
400 spin_unlock(&object->lock); in fscache_cancel_op()
408 void fscache_cancel_all_ops(struct fscache_object *object) in fscache_cancel_all_ops() argument
412 _enter("OBJ%x", object->debug_id); in fscache_cancel_all_ops()
414 spin_lock(&object->lock); in fscache_cancel_all_ops()
416 while (!list_empty(&object->pending_ops)) { in fscache_cancel_all_ops()
417 op = list_entry(object->pending_ops.next, in fscache_cancel_all_ops()
427 object->n_exclusive--; in fscache_cancel_all_ops()
431 cond_resched_lock(&object->lock); in fscache_cancel_all_ops()
434 spin_unlock(&object->lock); in fscache_cancel_all_ops()
443 struct fscache_object *object = op->object; in fscache_op_complete() local
445 _enter("OBJ%x", object->debug_id); in fscache_op_complete()
448 ASSERTCMP(object->n_in_progress, >, 0); in fscache_op_complete()
450 object->n_exclusive, >, 0); in fscache_op_complete()
452 object->n_in_progress, ==, 1); in fscache_op_complete()
454 spin_lock(&object->lock); in fscache_op_complete()
464 object->n_exclusive--; in fscache_op_complete()
465 object->n_in_progress--; in fscache_op_complete()
466 if (object->n_in_progress == 0) in fscache_op_complete()
467 fscache_start_operations(object); in fscache_op_complete()
469 spin_unlock(&object->lock); in fscache_op_complete()
480 struct fscache_object *object; in fscache_put_operation() local
484 op->object->debug_id, op->debug_id, atomic_read(&op->usage)); in fscache_put_operation()
504 object = op->object; in fscache_put_operation()
505 if (likely(object)) { in fscache_put_operation()
507 atomic_dec(&object->n_reads); in fscache_put_operation()
509 fscache_unuse_cookie(object); in fscache_put_operation()
514 if (!spin_trylock(&object->lock)) { in fscache_put_operation()
518 cache = object->cache; in fscache_put_operation()
527 ASSERTCMP(object->n_ops, >, 0); in fscache_put_operation()
528 object->n_ops--; in fscache_put_operation()
529 if (object->n_ops == 0) in fscache_put_operation()
530 fscache_raise_event(object, FSCACHE_OBJECT_EV_CLEARED); in fscache_put_operation()
532 spin_unlock(&object->lock); in fscache_put_operation()
546 struct fscache_object *object; in fscache_operation_gc() local
565 object = op->object; in fscache_operation_gc()
566 spin_lock(&object->lock); in fscache_operation_gc()
569 object->debug_id, op->debug_id); in fscache_operation_gc()
575 ASSERTCMP(object->n_ops, >, 0); in fscache_operation_gc()
576 object->n_ops--; in fscache_operation_gc()
577 if (object->n_ops == 0) in fscache_operation_gc()
578 fscache_raise_event(object, FSCACHE_OBJECT_EV_CLEARED); in fscache_operation_gc()
580 spin_unlock(&object->lock); in fscache_operation_gc()
602 op->object->debug_id, op->debug_id, atomic_read(&op->usage)); in fscache_op_work_func()