+/** Flag whether a lock is found on server for re-sent RPC. */
+#define LDLM_FL_RESENT 0x0100000000000000ULL // bit 56
+
+/** Flag whether Commit-on-Sharing is enabled, if LDLM_FL_COS_INCOMPAT is set
+ * this flag may not be set because once the former is set this flag won't be
+ * checked, and for cross-MDT lock COS_INCOMPAT is always set but ast handle is
+ * in ldlm context which doesn't know whether COS is enabled or not. */
+#define LDLM_FL_COS_ENABLED 0x0200000000000000ULL /* bit 57 */
+#define ldlm_is_cos_enabled(_l) LDLM_TEST_FLAG((_l), 1ULL << 57)
+#define ldlm_set_cos_enabled(_l) LDLM_SET_FLAG((_l), 1ULL << 57)
+
+/** 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)
+