18 #ifndef _LINUX_FSCACHE_CACHE_H
19 #define _LINUX_FSCACHE_CACHE_H
22 #include <linux/sched.h>
25 #define NR_MAXCACHES BITS_PER_LONG
39 #define FSCACHE_TAG_RESERVED 0
64 #define FSCACHE_IOERROR 0
65 #define FSCACHE_CACHE_WITHDRAWN 1
84 #define FSCACHE_OP_TYPE 0x000f
85 #define FSCACHE_OP_ASYNC 0x0001
86 #define FSCACHE_OP_MYTHREAD 0x0002
87 #define FSCACHE_OP_WAITING 4
88 #define FSCACHE_OP_EXCLUSIVE 5
89 #define FSCACHE_OP_DEAD 6
90 #define FSCACHE_OP_DEC_READ_CNT 7
91 #define FSCACHE_OP_KEEP_FLAGS 0xc0
294 #define FSCACHE_COOKIE_PENDING_TAG 0
295 #define FSCACHE_COOKIE_STORING_TAG 1
298 #define FSCACHE_COOKIE_LOOKING_UP 0
299 #define FSCACHE_COOKIE_CREATING 1
300 #define FSCACHE_COOKIE_NO_DATA_YET 2
301 #define FSCACHE_COOKIE_PENDING_FILL 3
302 #define FSCACHE_COOKIE_FILLING 4
303 #define FSCACHE_COOKIE_UNAVAILABLE 5
346 #define FSCACHE_OBJECT_EV_REQUEUE 0
347 #define FSCACHE_OBJECT_EV_UPDATE 1
348 #define FSCACHE_OBJECT_EV_CLEARED 2
349 #define FSCACHE_OBJECT_EV_ERROR 3
350 #define FSCACHE_OBJECT_EV_RELEASE 4
351 #define FSCACHE_OBJECT_EV_RETIRE 5
352 #define FSCACHE_OBJECT_EV_WITHDRAW 6
353 #define FSCACHE_OBJECT_EVENTS_MASK 0x7f
356 #define FSCACHE_OBJECT_LOCK 0
357 #define FSCACHE_OBJECT_PENDING_WRITE 1
358 #define FSCACHE_OBJECT_WAITING 2
369 #ifdef CONFIG_FSCACHE_OBJECT_LIST
378 #define fscache_object_is_active(obj) \
379 (!test_bit(FSCACHE_IOERROR, &(obj)->cache->flags) && \
380 (obj)->state >= FSCACHE_OBJECT_AVAILABLE && \
381 (obj)->state < FSCACHE_OBJECT_DYING)
383 #define fscache_object_is_dead(obj) \
384 (test_bit(FSCACHE_IOERROR, &(obj)->cache->flags) && \
385 (obj)->state >= FSCACHE_OBJECT_DYING)
405 object->state = FSCACHE_OBJECT_INIT;
413 object->n_children = 0;
414 object->n_ops =
object->n_in_progress =
object->n_exclusive = 0;
415 object->events =
object->event_mask = 0;
417 object->store_limit = 0;
418 object->store_limit_l = 0;
419 object->cache =
cache;
421 object->parent =
NULL;
427 #ifdef CONFIG_FSCACHE_OBJECT_LIST
430 #define fscache_object_destroy(object) do {} while(0)
452 static inline void fscache_object_lookup_error(
struct fscache_object *
object)
469 void fscache_set_store_limit(
struct fscache_object *
object, loff_t i_size)
471 object->store_limit_l = i_size;
474 object->store_limit++;
487 struct page *page,
int error)
502 const char *tagname);