Skip to content

Commit ba4bba6

Browse files
neilbrownchucklever
authored andcommitted
SUNRPC: change cache_head.flags bits to enum
When a sequence of numbers are needed for internal-use only, an enum is typically best. The sequence will inevitably need to be changed one day, and having an enum means the developer doesn't need to think about renumbering after insertion or deletion. Such patches will be easier to review. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent c743b42 commit ba4bba6

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

include/linux/sunrpc/cache.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,14 @@ struct cache_head {
5656
struct kref ref;
5757
unsigned long flags;
5858
};
59-
#define CACHE_VALID 0 /* Entry contains valid data */
60-
#define CACHE_NEGATIVE 1 /* Negative entry - there is no match for the key */
61-
#define CACHE_PENDING 2 /* An upcall has been sent but no reply received yet*/
62-
#define CACHE_CLEANED 3 /* Entry has been cleaned from cache */
59+
60+
/* cache_head.flags */
61+
enum {
62+
CACHE_VALID, /* Entry contains valid data */
63+
CACHE_NEGATIVE, /* Negative entry - there is no match for the key */
64+
CACHE_PENDING, /* An upcall has been sent but no reply received yet*/
65+
CACHE_CLEANED, /* Entry has been cleaned from cache */
66+
};
6367

6468
#define CACHE_NEW_EXPIRY 120 /* keep new things pending confirmation for 120 seconds */
6569

0 commit comments

Comments
 (0)