staging: lustre: ptlrpc: Move IT_* definitions to lustre_idl.h
authorBen Evans <bevans@cray.com>
Thu, 10 Nov 2016 17:30:50 +0000 (12:30 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Nov 2016 15:13:58 +0000 (16:13 +0100)
Put IT_* definitions into an enum, as they're sent over the wire,
adjust calls, print statements, etc. to use the new enum.

Signed-off-by: Ben Evans <bevans@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6746
Reviewed-on: http://review.whamcloud.com/16228
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
drivers/staging/lustre/lustre/include/lustre_dlm.h
drivers/staging/lustre/lustre/include/obd.h
drivers/staging/lustre/lustre/ldlm/ldlm_lock.c

index 222b6bfba66c74379256ebad88e75858e44c2758..1aa66ad4b03050abd23104263a3c33f262abf3b8 100644 (file)
@@ -2624,6 +2624,24 @@ union ldlm_gl_desc {
 
 void lustre_swab_gl_desc(union ldlm_gl_desc *);
 
+enum ldlm_intent_flags {
+       IT_OPEN         = BIT(0),
+       IT_CREAT        = BIT(1),
+       IT_OPEN_CREAT   = BIT(1) | BIT(0),
+       IT_READDIR      = BIT(2),
+       IT_GETATTR      = BIT(3),
+       IT_LOOKUP       = BIT(4),
+       IT_UNLINK       = BIT(5),
+       IT_TRUNC        = BIT(6),
+       IT_GETXATTR     = BIT(7),
+       IT_EXEC         = BIT(8),
+       IT_PIN          = BIT(9),
+       IT_LAYOUT       = BIT(10),
+       IT_QUOTA_DQACQ  = BIT(11),
+       IT_QUOTA_CONN   = BIT(12),
+       IT_SETXATTR     = BIT(13),
+};
+
 struct ldlm_intent {
        __u64 opc;
 };
index f770b864a5c6d619787dce1365267bf81a26ceb9..d94237d97a554b78f0527306d583e3a5de5325e9 100644 (file)
@@ -977,7 +977,7 @@ struct ldlm_enqueue_info {
 extern struct obd_ops ldlm_obd_ops;
 
 extern char *ldlm_lockname[];
-char *ldlm_it2str(int it);
+const char *ldlm_it2str(enum ldlm_intent_flags it);
 
 /**
  * Just a fancy CDEBUG call with log level preset to LDLM_DEBUG.
index c8a6e23f279efd62bd6ac8bf65981dcbabc6346e..09649ef395034219066110a95663998118d46b9d 100644 (file)
@@ -636,22 +636,6 @@ enum obd_cleanup_stage {
 
 struct lu_context;
 
-/* /!\ must be coherent with include/linux/namei.h on patched kernel */
-#define IT_OPEN     (1 << 0)
-#define IT_CREAT    (1 << 1)
-#define IT_READDIR  (1 << 2)
-#define IT_GETATTR  (1 << 3)
-#define IT_LOOKUP   (1 << 4)
-#define IT_UNLINK   (1 << 5)
-#define IT_TRUNC    (1 << 6)
-#define IT_GETXATTR (1 << 7)
-#define IT_EXEC     (1 << 8)
-#define IT_PIN      (1 << 9)
-#define IT_LAYOUT   (1 << 10)
-#define IT_QUOTA_DQACQ (1 << 11)
-#define IT_QUOTA_CONN  (1 << 12)
-#define IT_SETXATTR (1 << 13)
-
 static inline int it_to_lock_mode(struct lookup_intent *it)
 {
        /* CREAT needs to be tested before open (both could be set) */
index f2044ecd9505734b9c23152b431b49b135e8bd3a..17d532e89c9a0ec684c3fc32fb39199a3f55d74a 100644 (file)
@@ -105,7 +105,7 @@ void ldlm_convert_policy_to_local(struct obd_export *exp, enum ldlm_type type,
        convert(wpolicy, lpolicy);
 }
 
-char *ldlm_it2str(int it)
+const char *ldlm_it2str(enum ldlm_intent_flags it)
 {
        switch (it) {
        case IT_OPEN:
@@ -127,7 +127,7 @@ char *ldlm_it2str(int it)
        case IT_LAYOUT:
                return "layout";
        default:
-               CERROR("Unknown intent %d\n", it);
+               CERROR("Unknown intent 0x%08x\n", it);
                return "UNKNOWN";
        }
 }