Whamcloud - gitweb
LU-6540 test: fix no %s specifier for the file
[fs/lustre-release.git] / lustre / include / lustre_dlm_flags.h
index 283546d..5357746 100644 (file)
@@ -1,17 +1,10 @@
 /*  -*- buffer-read-only: t -*- vi: set ro:
  *
- * DO NOT EDIT THIS FILE   (lustre_dlm_flags.h)
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 only,
+ * as published by the Free Software Foundation.
  *
- * It has been AutoGen-ed
- * From the definitions    lustre_dlm_flags.def
- * and the template file   lustre_dlm_flags.tpl
- *
- * lustre is free software: you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * lustre is distributed in the hope that it will be useful, but
+ * Lustre is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * See the GNU General Public License for more details.
@@ -22,8 +15,6 @@
 /**
  * \file lustre_dlm_flags.h
  * The flags and collections of flags (masks) for \see struct ldlm_lock.
- * This file is derived from flag definitions in lustre_dlm_flags.def.
- * The format is defined in the lustre_dlm_flags.tpl template file.
  *
  * \addtogroup LDLM Lustre Distributed Lock Manager
  * @{
 /** l_flags bits marked as "all_flags" bits */
 #define LDLM_FL_ALL_FLAGS_MASK          0x00FFFFFFC08F932FULL
 
-/** l_flags bits marked as "ast" bits */
-#define LDLM_FL_AST_MASK                0x0000000080008000ULL
-
-/** l_flags bits marked as "blocked" bits */
-#define LDLM_FL_BLOCKED_MASK            0x000000000000000EULL
-
-/** l_flags bits marked as "gone" bits */
-#define LDLM_FL_GONE_MASK               0x0006004000000000ULL
-
-/** l_flags bits marked as "inherit" bits */
-#define LDLM_FL_INHERIT_MASK            0x0000000000800000ULL
-
-/** l_flags bits marked as "off_wire" bits */
-#define LDLM_FL_OFF_WIRE_MASK           0x00FFFFFF00000000ULL
-
-/** l_flags bits marked as "on_wire" bits */
-#define LDLM_FL_ON_WIRE_MASK            0x00000000C08F932FULL
-
 /** extent, mode, or resource changed */
 #define LDLM_FL_LOCK_CHANGED            0x0000000000000001ULL // bit   0
 #define ldlm_is_lock_changed(_l)        LDLM_TEST_FLAG(( _l), 1ULL <<  0)
 #define ldlm_set_excl(_l)               LDLM_SET_FLAG((  _l), 1ULL << 55)
 #define ldlm_clear_excl(_l)             LDLM_CLEAR_FLAG((_l), 1ULL << 55)
 
+/** Flag whether a lock is found on server for re-sent RPC. */
+#define LDLM_FL_RESENT                   0x0100000000000000ULL // bit  56
+
+/** l_flags bits marked as "ast" bits */
+#define LDLM_FL_AST_MASK                (LDLM_FL_FLOCK_DEADLOCK                |\
+                                        LDLM_FL_AST_DISCARD_DATA)
+
+/** l_flags bits marked as "blocked" bits */
+#define LDLM_FL_BLOCKED_MASK            (LDLM_FL_BLOCK_GRANTED         |\
+                                        LDLM_FL_BLOCK_CONV             |\
+                                        LDLM_FL_BLOCK_WAIT)
+
+/** l_flags bits marked as "gone" bits */
+#define LDLM_FL_GONE_MASK              (LDLM_FL_DESTROYED              |\
+                                        LDLM_FL_FAILED)
+
+/** l_flags bits marked as "inherit" bits */
+/* Flags inherited from wire on enqueue/reply between client/server. */
+/* NO_TIMEOUT flag to force ldlm_lock_match() to wait with no timeout. */
+/* TEST_LOCK flag to not let TEST lock to be granted. */
+#define LDLM_FL_INHERIT_MASK            (LDLM_FL_CANCEL_ON_BLOCK       |\
+                                        LDLM_FL_NO_TIMEOUT             |\
+                                        LDLM_FL_TEST_LOCK)
+
+/** flags returned in @flags parameter on ldlm_lock_enqueue,
+ * to be re-constructed on re-send */
+#define LDLM_FL_SRV_ENQ_MASK   (LDLM_FL_LOCK_CHANGED           |\
+                                LDLM_FL_BLOCKED_MASK           |\
+                                LDLM_FL_NO_TIMEOUT)
+
 /** test for ldlm_lock flag bit set */
 #define LDLM_TEST_FLAG(_l, _b)    (((_l)->l_flags & (_b)) != 0)