Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+17 -9
+17 -9
include/linux/fscache-cache.h
··· 338 338 extern struct fscache_cookie fscache_fsdef_index; 339 339 340 340 /* 341 + * Event list for fscache_object::{event_mask,events} 342 + */ 343 + enum { 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 358 * on-disk cache file or index handle 342 359 */ 343 360 struct fscache_object { ··· 393 376 unsigned long event_mask; /* events this object is interested in */ 394 377 unsigned long events; /* events to be processed by this object 395 378 * (order is important - using fls) */ 396 - #define FSCACHE_OBJECT_EV_REQUEUE 0 /* T if object should be requeued */ 397 - #define FSCACHE_OBJECT_EV_UPDATE 1 /* T if object should be updated */ 398 - #define FSCACHE_OBJECT_EV_CLEARED 2 /* T if accessors all gone */ 399 - #define FSCACHE_OBJECT_EV_ERROR 3 /* T if fatal error occurred during processing */ 400 - #define FSCACHE_OBJECT_EV_RELEASE 4 /* T if netfs requested object release */ 401 - #define FSCACHE_OBJECT_EV_RETIRE 5 /* T if netfs requested object retirement */ 402 - #define FSCACHE_OBJECT_EV_WITHDRAW 6 /* T if cache requested object withdrawal */ 403 - #define FSCACHE_OBJECT_EV_INVALIDATE 7 /* T if cache requested object invalidation */ 404 - #define FSCACHE_OBJECT_EVENTS_MASK 0xff /* mask of all events*/ 405 379 406 380 unsigned long flags; 407 381 #define FSCACHE_OBJECT_LOCK 0 /* T if object is busy being processed */