linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: linux-fsdevel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, linux-cachefs@redhat.com,
	linux-nfs@vger.kernel.org
Subject: [PATCH 12/17] FS-Cache: Convert the object event ID #defines into an enum
Date: Wed, 08 Feb 2012 21:18:44 +0000	[thread overview]
Message-ID: <20120208211844.15607.77232.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <20120208211640.15607.58537.stgit@warthog.procyon.org.uk>

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>
---

 include/linux/fscache-cache.h |   26 +++++++++++++++++---------
 1 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/include/linux/fscache-cache.h b/include/linux/fscache-cache.h
index 1e454ad..73e68c8 100644
--- a/include/linux/fscache-cache.h
+++ b/include/linux/fscache-cache.h
@@ -338,6 +338,23 @@ struct fscache_cookie {
 extern struct fscache_cookie fscache_fsdef_index;
 
 /*
+ * Event list for fscache_object::{event_mask,events}
+ */
+enum {
+	FSCACHE_OBJECT_EV_REQUEUE,	/* T if object should be requeued */
+	FSCACHE_OBJECT_EV_UPDATE,	/* T if object should be updated */
+	FSCACHE_OBJECT_EV_INVALIDATE,	/* T if cache requested object invalidation */
+	FSCACHE_OBJECT_EV_CLEARED,	/* T if accessors all gone */
+	FSCACHE_OBJECT_EV_ERROR,	/* T if fatal error occurred during processing */
+	FSCACHE_OBJECT_EV_RELEASE,	/* T if netfs requested object release */
+	FSCACHE_OBJECT_EV_RETIRE,	/* T if netfs requested object retirement */
+	FSCACHE_OBJECT_EV_WITHDRAW,	/* T if cache requested object withdrawal */
+	NR_FSCACHE_OBJECT_EVENTS
+};
+
+#define FSCACHE_OBJECT_EVENTS_MASK ((1UL << NR_FSCACHE_OBJECT_EVENTS) - 1)
+
+/*
  * on-disk cache file or index handle
  */
 struct fscache_object {
@@ -376,15 +393,6 @@ struct fscache_object {
 	unsigned long		event_mask;	/* events this object is interested in */
 	unsigned long		events;		/* events to be processed by this object
 						 * (order is important - using fls) */
-#define FSCACHE_OBJECT_EV_REQUEUE	0	/* T if object should be requeued */
-#define FSCACHE_OBJECT_EV_UPDATE	1	/* T if object should be updated */
-#define FSCACHE_OBJECT_EV_CLEARED	2	/* T if accessors all gone */
-#define FSCACHE_OBJECT_EV_ERROR		3	/* T if fatal error occurred during processing */
-#define FSCACHE_OBJECT_EV_RELEASE	4	/* T if netfs requested object release */
-#define FSCACHE_OBJECT_EV_RETIRE	5	/* T if netfs requested object retirement */
-#define FSCACHE_OBJECT_EV_WITHDRAW	6	/* T if cache requested object withdrawal */
-#define FSCACHE_OBJECT_EV_INVALIDATE	7	/* T if cache requested object invalidation */
-#define FSCACHE_OBJECT_EVENTS_MASK	0xff	/* mask of all events*/
 
 	unsigned long		flags;
 #define FSCACHE_OBJECT_LOCK		0	/* T if object is busy being processed */


  parent reply	other threads:[~2012-02-08 21:18 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-08 21:16 [PATCH 00/17] Fix assorted FS-Cache problems David Howells
2012-02-08 21:16 ` [PATCH 01/17] CacheFiles: Fix the marking of cached pages David Howells
2012-02-08 21:17 ` [PATCH 02/17] CacheFiles: Downgrade the requirements passed to the allocator David Howells
2012-02-08 21:17 ` [PATCH 03/17] FS-Cache: Check that there are no read ops when cookie relinquished David Howells
2012-02-08 21:17 ` [PATCH 04/17] CacheFiles: Make some debugging statements conditional David Howells
2012-02-08 21:17 ` [PATCH 05/17] FS-Cache: Make cookie relinquishment wait for outstanding reads David Howells
2012-02-08 21:17 ` [PATCH 06/17] FS-Cache: Fix operation state management and accounting David Howells
2012-02-08 21:17 ` [PATCH 07/17] FS-Cache: Provide proper invalidation David Howells
2012-02-08 21:18 ` [PATCH 08/17] VFS: Make more complete truncate operation available to CacheFiles David Howells
2012-02-08 21:18 ` [PATCH 09/17] CacheFiles: Implement invalidation David Howells
2012-02-08 21:18 ` [PATCH 10/17] NFS: Use FS-Cache invalidation David Howells
2012-02-08 21:18 ` [PATCH 11/17] CacheFiles: Add missing retrieval completions David Howells
2012-02-08 21:18 ` David Howells [this message]
2012-02-08 21:18 ` [PATCH 13/17] FS-Cache: Initialise the object event mask with the calculated mask David Howells
2012-02-08 21:19 ` [PATCH 14/17] FS-Cache: Don't mask off the object event mask when printing it David Howells
2012-02-08 21:19 ` [PATCH 15/17] FS-Cache: Limit the number of I/O error reports for a cache David Howells
2012-02-08 21:19 ` [PATCH 16/17] FS-Cache: Exclusive op submission can BUG if there's been an I/O error David Howells
2012-02-08 21:19 ` [PATCH 17/17] NFS: nfs_migrate_page() does not wait for FS-Cache to finish with a page David Howells
2012-07-21 16:57   ` Jonathan Nieder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120208211844.15607.77232.stgit@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=linux-cachefs@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).