aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2012-12-05 08:34:46 -0500
committerDavid Howells <dhowells@redhat.com>2012-12-20 17:08:05 -0500
commit36a02de5d7981435931d4608ee3e510b752e072b (patch)
treed0d8283ba3ab9bcb9224582677d8ec00ec987ef3 /include/linux
parentb4cf1e08c8ac95eff65faa53904f7f13ac78194b (diff)
FS-Cache: Convert the object event ID #defines into an enum
Convert the fscache_object event IDs from #defines into an enum. Also add an extra label to the enum to carry the event count and redefine the event mask in terms of that. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/fscache-cache.h26
1 files changed, 17 insertions, 9 deletions
diff --git a/include/linux/fscache-cache.h b/include/linux/fscache-cache.h
index 1e454ad7a832..73e68c8d5df4 100644
--- a/include/linux/fscache-cache.h
+++ b/include/linux/fscache-cache.h
@@ -338,6 +338,23 @@ struct fscache_cookie {
338extern struct fscache_cookie fscache_fsdef_index; 338extern struct fscache_cookie fscache_fsdef_index;
339 339
340/* 340/*
341 * Event list for fscache_object::{event_mask,events}
342 */
343enum {
344 FSCACHE_OBJECT_EV_REQUEUE, /* T if object should be requeued */
345 FSCACHE_OBJECT_EV_UPDATE, /* T if object should be updated */
346 FSCACHE_OBJECT_EV_INVALIDATE, /* T if cache requested object invalidation */
347 FSCACHE_OBJECT_EV_CLEARED, /* T if accessors all gone */
348 FSCACHE_OBJECT_EV_ERROR, /* T if fatal error occurred during processing */
349 FSCACHE_OBJECT_EV_RELEASE, /* T if netfs requested object release */
350 FSCACHE_OBJECT_EV_RETIRE, /* T if netfs requested object retirement */
351 FSCACHE_OBJECT_EV_WITHDRAW, /* T if cache requested object withdrawal */
352 NR_FSCACHE_OBJECT_EVENTS
353};
354
355#define FSCACHE_OBJECT_EVENTS_MASK ((1UL << NR_FSCACHE_OBJECT_EVENTS) - 1)
356
357/*
341 * on-disk cache file or index handle 358 * on-disk cache file or index handle
342 */ 359 */
343struct fscache_object { 360struct fscache_object {
@@ -376,15 +393,6 @@ struct fscache_object {
376 unsigned long event_mask; /* events this object is interested in */ 393 unsigned long event_mask; /* events this object is interested in */
377 unsigned long events; /* events to be processed by this object 394 unsigned long events; /* events to be processed by this object
378 * (order is important - using fls) */ 395 * (order is important - using fls) */
379#define FSCACHE_OBJECT_EV_REQUEUE 0 /* T if object should be requeued */
380#define FSCACHE_OBJECT_EV_UPDATE 1 /* T if object should be updated */
381#define FSCACHE_OBJECT_EV_CLEARED 2 /* T if accessors all gone */
382#define FSCACHE_OBJECT_EV_ERROR 3 /* T if fatal error occurred during processing */
383#define FSCACHE_OBJECT_EV_RELEASE 4 /* T if netfs requested object release */
384#define FSCACHE_OBJECT_EV_RETIRE 5 /* T if netfs requested object retirement */
385#define FSCACHE_OBJECT_EV_WITHDRAW 6 /* T if cache requested object withdrawal */
386#define FSCACHE_OBJECT_EV_INVALIDATE 7 /* T if cache requested object invalidation */
387#define FSCACHE_OBJECT_EVENTS_MASK 0xff /* mask of all events*/
388 396
389 unsigned long flags; 397 unsigned long flags;
390#define FSCACHE_OBJECT_LOCK 0 /* T if object is busy being processed */ 398#define FSCACHE_OBJECT_LOCK 0 /* T if object is busy being processed */