14 #define FSCACHE_DEBUG_LEVEL OPERATION
15 #include <linux/module.h>
17 #include <linux/slab.h>
50 _debug(
"queue for caller's attention");
67 object->n_in_progress++;
87 spin_lock(&object->
lock);
96 object->n_exclusive++;
98 if (object->
n_ops > 1) {
109 fscache_run_op(
object, op);
115 }
else if (object->
state == FSCACHE_OBJECT_CREATING) {
118 object->n_exclusive++;
128 spin_unlock(&object->
lock);
135 static void fscache_report_unexpected_submission(
struct fscache_object *
object,
137 unsigned long ostate)
139 static bool once_only;
147 kdebug(
"unexpected submission OP%x [OBJ%x %s]",
150 kdebug(
"objstate=%s [%s]",
155 kdebug(
"ops=%u inp=%u exc=%u",
183 unsigned long ostate;
186 _enter(
"{OBJ%x OP%x},{%u}",
191 spin_lock(&object->
lock);
196 ostate =
object->state;
214 fscache_run_op(
object, op);
217 }
else if (object->
state == FSCACHE_OBJECT_CREATING) {
224 }
else if (object->
state == FSCACHE_OBJECT_DYING ||
225 object->
state == FSCACHE_OBJECT_LC_DYING ||
226 object->
state == FSCACHE_OBJECT_WITHDRAWING) {
230 fscache_report_unexpected_submission(
object, op, ostate);
237 spin_unlock(&object->
lock);
261 while (!list_empty(&object->
pending_ops) && !stop) {
271 fscache_run_op(
object, op);
279 _debug(
"woke %d ops on OBJ%x",
293 spin_lock(&object->
lock);
301 object->n_exclusive--;
308 spin_unlock(&object->
lock);
349 if (!spin_trylock(&object->
lock)) {
353 cache =
object->cache;
364 object->n_exclusive--;
368 object->n_in_progress--;
374 if (object->
n_ops == 0)
377 spin_unlock(&object->
lock);
411 _debug(
"GC DEFERRED REL OBJ%x OP%x",
417 spin_lock(&object->
lock);
420 object->n_exclusive--;
424 object->n_in_progress--;
430 if (object->
n_ops == 0)
433 spin_unlock(&object->
lock);
435 }
while (count++ < 20);