/* -*- 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.
/**
* \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
* @{
#define ldlm_set_test_lock(_l) LDLM_SET_FLAG(( _l), 1ULL << 19)
#define ldlm_clear_test_lock(_l) LDLM_CLEAR_FLAG((_l), 1ULL << 19)
+/** match lock only */
+#define LDLM_FL_MATCH_LOCK 0x0000000000100000ULL // bit 20
+
/**
* Immediatelly cancel such locks when they block some other locks. Send
* cancel notification to original lock holder, but expect no reply. This
#define ldlm_set_cancel_on_block(_l) LDLM_SET_FLAG(( _l), 1ULL << 23)
#define ldlm_clear_cancel_on_block(_l) LDLM_CLEAR_FLAG((_l), 1ULL << 23)
+/** 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)
+
/**
* measure lock contention and return -EUSERS if locking contention is high */
#define LDLM_FL_DENY_ON_CONTENTION 0x0000000040000000ULL // bit 30
#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
+
+/** 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)
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)