+/** Flag whether a lock is enqueued from a distributed transaction, and the
+ * requesting lock mode is PW/EX, if so, it will check compatibility with COS
+ * locks, and different from original COS semantic, transactions from the same
+ * client is also treated as lock conflict. */
+#define LDLM_FL_COS_INCOMPAT 0x0000000001000000ULL /* bit 24 */
+#define ldlm_is_cos_incompat(_l) LDLM_TEST_FLAG((_l), 1ULL << 24)
+#define ldlm_set_cos_incompat(_l) LDLM_SET_FLAG((_l), 1ULL << 24)
+#define ldlm_clear_cos_incompat(_l) LDLM_CLEAR_FLAG((_l), 1ULL << 24)
+
+/*
+ * Flag indicates that lock is being converted (downgraded) during the blocking
+ * AST instead of cancelling. Used for IBITS locks now and drops conflicting
+ * bits only keepeing other.
+ */
+#define LDLM_FL_CONVERTING 0x0000000002000000ULL /* bit 25 */
+#define ldlm_is_converting(_l) LDLM_TEST_FLAG((_l), 1ULL << 25)
+#define ldlm_set_converting(_l) LDLM_SET_FLAG((_l), 1ULL << 25)
+#define ldlm_clear_converting(_l) LDLM_CLEAR_FLAG((_l), 1ULL << 25)
+
+/**
+ * Part of original lockahead implementation, OBD_CONNECT_LOCKAHEAD_OLD.
+ * Reserved temporarily to allow those implementations to keep working.
+ * Will be removed after 2.12 release.
+ * */
+#define LDLM_FL_LOCKAHEAD_OLD_RESERVED 0x0000000010000000ULL /* bit 28 */
+#define ldlm_is_do_not_expand_io(_l) LDLM_TEST_FLAG((_l), 1ULL << 28)
+#define ldlm_set_do_not_expand_io(_l) LDLM_SET_FLAG((_l), 1ULL << 28)
+#define ldlm_clear_do_not_expand_io(_l) LDLM_CLEAR_FLAG((_l), 1ULL << 28)
+
+/**
+ * Do not expand this lock. Grant it only on the extent requested.
+ * Used for manually requested locks from the client (LU_LADVISE_LOCKAHEAD).
+ * */
+#define LDLM_FL_NO_EXPANSION 0x0000000020000000ULL /* bit 29 */
+#define ldlm_is_do_not_expand(_l) LDLM_TEST_FLAG((_l), 1ULL << 29)
+#define ldlm_set_do_not_expand(_l) LDLM_SET_FLAG((_l), 1ULL << 29)
+#define ldlm_clear_do_not_expand(_l) LDLM_CLEAR_FLAG((_l), 1ULL << 29)
+