@@ -32,7 +32,8 @@ static void fscache_operation_dummy_cancel(struct fscache_operation *op)
32
32
* Do basic initialisation of an operation. The caller must still set flags,
33
33
* object and processor if needed.
34
34
*/
35
- void fscache_operation_init (struct fscache_operation * op ,
35
+ void fscache_operation_init (struct fscache_cookie * cookie ,
36
+ struct fscache_operation * op ,
36
37
fscache_operation_processor_t processor ,
37
38
fscache_operation_cancel_t cancel ,
38
39
fscache_operation_release_t release )
@@ -46,6 +47,7 @@ void fscache_operation_init(struct fscache_operation *op,
46
47
op -> release = release ;
47
48
INIT_LIST_HEAD (& op -> pend_link );
48
49
fscache_stat (& fscache_n_op_initialised );
50
+ trace_fscache_op (cookie , op , fscache_op_init );
49
51
}
50
52
EXPORT_SYMBOL (fscache_operation_init );
51
53
@@ -59,6 +61,8 @@ EXPORT_SYMBOL(fscache_operation_init);
59
61
*/
60
62
void fscache_enqueue_operation (struct fscache_operation * op )
61
63
{
64
+ struct fscache_cookie * cookie = op -> object -> cookie ;
65
+
62
66
_enter ("{OBJ%x OP%x,%u}" ,
63
67
op -> object -> debug_id , op -> debug_id , atomic_read (& op -> usage ));
64
68
@@ -71,12 +75,14 @@ void fscache_enqueue_operation(struct fscache_operation *op)
71
75
fscache_stat (& fscache_n_op_enqueue );
72
76
switch (op -> flags & FSCACHE_OP_TYPE ) {
73
77
case FSCACHE_OP_ASYNC :
78
+ trace_fscache_op (cookie , op , fscache_op_enqueue_async );
74
79
_debug ("queue async" );
75
80
atomic_inc (& op -> usage );
76
81
if (!queue_work (fscache_op_wq , & op -> work ))
77
82
fscache_put_operation (op );
78
83
break ;
79
84
case FSCACHE_OP_MYTHREAD :
85
+ trace_fscache_op (cookie , op , fscache_op_enqueue_mythread );
80
86
_debug ("queue for caller's attention" );
81
87
break ;
82
88
default :
@@ -101,6 +107,8 @@ static void fscache_run_op(struct fscache_object *object,
101
107
wake_up_bit (& op -> flags , FSCACHE_OP_WAITING );
102
108
if (op -> processor )
103
109
fscache_enqueue_operation (op );
110
+ else
111
+ trace_fscache_op (object -> cookie , op , fscache_op_run );
104
112
fscache_stat (& fscache_n_op_run );
105
113
}
106
114
@@ -155,6 +163,8 @@ int fscache_submit_exclusive_op(struct fscache_object *object,
155
163
156
164
_enter ("{OBJ%x OP%x}," , object -> debug_id , op -> debug_id );
157
165
166
+ trace_fscache_op (object -> cookie , op , fscache_op_submit_ex );
167
+
158
168
ASSERTCMP (op -> state , = = , FSCACHE_OP_ST_INITIALISED );
159
169
ASSERTCMP (atomic_read (& op -> usage ), > , 0 );
160
170
@@ -240,6 +250,8 @@ int fscache_submit_op(struct fscache_object *object,
240
250
_enter ("{OBJ%x OP%x},{%u}" ,
241
251
object -> debug_id , op -> debug_id , atomic_read (& op -> usage ));
242
252
253
+ trace_fscache_op (object -> cookie , op , fscache_op_submit );
254
+
243
255
ASSERTCMP (op -> state , = = , FSCACHE_OP_ST_INITIALISED );
244
256
ASSERTCMP (atomic_read (& op -> usage ), > , 0 );
245
257
@@ -357,6 +369,8 @@ int fscache_cancel_op(struct fscache_operation *op,
357
369
358
370
_enter ("OBJ%x OP%x}" , op -> object -> debug_id , op -> debug_id );
359
371
372
+ trace_fscache_op (object -> cookie , op , fscache_op_cancel );
373
+
360
374
ASSERTCMP (op -> state , >=, FSCACHE_OP_ST_PENDING );
361
375
ASSERTCMP (op -> state , != , FSCACHE_OP_ST_CANCELLED );
362
376
ASSERTCMP (atomic_read (& op -> usage ), > , 0 );
@@ -419,6 +433,8 @@ void fscache_cancel_all_ops(struct fscache_object *object)
419
433
fscache_stat (& fscache_n_op_cancelled );
420
434
list_del_init (& op -> pend_link );
421
435
436
+ trace_fscache_op (object -> cookie , op , fscache_op_cancel_all );
437
+
422
438
ASSERTCMP (op -> state , = = , FSCACHE_OP_ST_PENDING );
423
439
op -> cancel (op );
424
440
op -> state = FSCACHE_OP_ST_CANCELLED ;
@@ -454,9 +470,11 @@ void fscache_op_complete(struct fscache_operation *op, bool cancelled)
454
470
spin_lock (& object -> lock );
455
471
456
472
if (!cancelled ) {
473
+ trace_fscache_op (object -> cookie , op , fscache_op_completed );
457
474
op -> state = FSCACHE_OP_ST_COMPLETE ;
458
475
} else {
459
476
op -> cancel (op );
477
+ trace_fscache_op (object -> cookie , op , fscache_op_cancelled );
460
478
op -> state = FSCACHE_OP_ST_CANCELLED ;
461
479
}
462
480
@@ -488,6 +506,8 @@ void fscache_put_operation(struct fscache_operation *op)
488
506
if (!atomic_dec_and_test (& op -> usage ))
489
507
return ;
490
508
509
+ trace_fscache_op (op -> object -> cookie , op , fscache_op_put );
510
+
491
511
_debug ("PUT OP" );
492
512
ASSERTIFCMP (op -> state != FSCACHE_OP_ST_INITIALISED &&
493
513
op -> state != FSCACHE_OP_ST_COMPLETE ,
@@ -563,6 +583,8 @@ void fscache_operation_gc(struct work_struct *work)
563
583
spin_unlock (& cache -> op_gc_list_lock );
564
584
565
585
object = op -> object ;
586
+ trace_fscache_op (object -> cookie , op , fscache_op_gc );
587
+
566
588
spin_lock (& object -> lock );
567
589
568
590
_debug ("GC DEFERRED REL OBJ%x OP%x" ,
@@ -601,6 +623,8 @@ void fscache_op_work_func(struct work_struct *work)
601
623
_enter ("{OBJ%x OP%x,%d}" ,
602
624
op -> object -> debug_id , op -> debug_id , atomic_read (& op -> usage ));
603
625
626
+ trace_fscache_op (op -> object -> cookie , op , fscache_op_work );
627
+
604
628
ASSERT (op -> processor != NULL );
605
629
start = jiffies ;
606
630
op -> processor (op );
0 commit comments