diff options
Diffstat (limited to 'include/linux/fscache-cache.h')
-rw-r--r-- | include/linux/fscache-cache.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/fscache-cache.h b/include/linux/fscache-cache.h index 7a9847ccd192..184cbdfbcc99 100644 --- a/include/linux/fscache-cache.h +++ b/include/linux/fscache-cache.h | |||
@@ -91,6 +91,8 @@ struct fscache_operation { | |||
91 | #define FSCACHE_OP_WAITING 4 /* cleared when op is woken */ | 91 | #define FSCACHE_OP_WAITING 4 /* cleared when op is woken */ |
92 | #define FSCACHE_OP_EXCLUSIVE 5 /* exclusive op, other ops must wait */ | 92 | #define FSCACHE_OP_EXCLUSIVE 5 /* exclusive op, other ops must wait */ |
93 | #define FSCACHE_OP_DEAD 6 /* op is now dead */ | 93 | #define FSCACHE_OP_DEAD 6 /* op is now dead */ |
94 | #define FSCACHE_OP_DEC_READ_CNT 7 /* decrement object->n_reads on destruction */ | ||
95 | #define FSCACHE_OP_KEEP_FLAGS 0xc0 /* flags to keep when repurposing an op */ | ||
94 | 96 | ||
95 | atomic_t usage; | 97 | atomic_t usage; |
96 | unsigned debug_id; /* debugging ID */ | 98 | unsigned debug_id; /* debugging ID */ |
@@ -357,6 +359,7 @@ struct fscache_object { | |||
357 | int n_obj_ops; /* number of object ops outstanding on object */ | 359 | int n_obj_ops; /* number of object ops outstanding on object */ |
358 | int n_in_progress; /* number of ops in progress */ | 360 | int n_in_progress; /* number of ops in progress */ |
359 | int n_exclusive; /* number of exclusive ops queued */ | 361 | int n_exclusive; /* number of exclusive ops queued */ |
362 | atomic_t n_reads; /* number of read ops in progress */ | ||
360 | spinlock_t lock; /* state and operations lock */ | 363 | spinlock_t lock; /* state and operations lock */ |
361 | 364 | ||
362 | unsigned long lookup_jif; /* time at which lookup started */ | 365 | unsigned long lookup_jif; /* time at which lookup started */ |
@@ -370,6 +373,7 @@ struct fscache_object { | |||
370 | #define FSCACHE_OBJECT_EV_RELEASE 4 /* T if netfs requested object release */ | 373 | #define FSCACHE_OBJECT_EV_RELEASE 4 /* T if netfs requested object release */ |
371 | #define FSCACHE_OBJECT_EV_RETIRE 5 /* T if netfs requested object retirement */ | 374 | #define FSCACHE_OBJECT_EV_RETIRE 5 /* T if netfs requested object retirement */ |
372 | #define FSCACHE_OBJECT_EV_WITHDRAW 6 /* T if cache requested object withdrawal */ | 375 | #define FSCACHE_OBJECT_EV_WITHDRAW 6 /* T if cache requested object withdrawal */ |
376 | #define FSCACHE_OBJECT_EVENTS_MASK 0x7f /* mask of all events*/ | ||
373 | 377 | ||
374 | unsigned long flags; | 378 | unsigned long flags; |
375 | #define FSCACHE_OBJECT_LOCK 0 /* T if object is busy being processed */ | 379 | #define FSCACHE_OBJECT_LOCK 0 /* T if object is busy being processed */ |
@@ -385,6 +389,9 @@ struct fscache_object { | |||
385 | struct list_head dependents; /* FIFO of dependent objects */ | 389 | struct list_head dependents; /* FIFO of dependent objects */ |
386 | struct list_head dep_link; /* link in parent's dependents list */ | 390 | struct list_head dep_link; /* link in parent's dependents list */ |
387 | struct list_head pending_ops; /* unstarted operations on this object */ | 391 | struct list_head pending_ops; /* unstarted operations on this object */ |
392 | #ifdef CONFIG_FSCACHE_OBJECT_LIST | ||
393 | struct rb_node objlist_link; /* link in global object list */ | ||
394 | #endif | ||
388 | pgoff_t store_limit; /* current storage limit */ | 395 | pgoff_t store_limit; /* current storage limit */ |
389 | }; | 396 | }; |
390 | 397 | ||
@@ -434,6 +441,12 @@ void fscache_object_init(struct fscache_object *object, | |||
434 | extern void fscache_object_lookup_negative(struct fscache_object *object); | 441 | extern void fscache_object_lookup_negative(struct fscache_object *object); |
435 | extern void fscache_obtained_object(struct fscache_object *object); | 442 | extern void fscache_obtained_object(struct fscache_object *object); |
436 | 443 | ||
444 | #ifdef CONFIG_FSCACHE_OBJECT_LIST | ||
445 | extern void fscache_object_destroy(struct fscache_object *object); | ||
446 | #else | ||
447 | #define fscache_object_destroy(object) do {} while(0) | ||
448 | #endif | ||
449 | |||
437 | /** | 450 | /** |
438 | * fscache_object_destroyed - Note destruction of an object in a cache | 451 | * fscache_object_destroyed - Note destruction of an object in a cache |
439 | * @cache: The cache from which the object came | 452 | * @cache: The cache from which the object came |