fs/ocfs2/dlm/dlmcommon.h
Source file repositories/reference/linux-study-clean/fs/ocfs2/dlm/dlmcommon.h
File Facts
- System
- Linux kernel
- Corpus path
fs/ocfs2/dlm/dlmcommon.h- Extension
.h- Size
- 28759 bytes
- Lines
- 1133
- Domain
- Core OS
- Bucket
- VFS And Filesystem Core
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kref.h
Detected Declarations
struct dlm_master_list_entrystruct dlm_recovery_ctxtstruct dlm_ctxtstruct dlm_lock_resourcestruct dlm_work_itemstruct dlm_request_all_locks_privstruct dlm_mig_lockres_privstruct dlm_assert_master_privstruct dlm_deref_lockres_privstruct dlm_work_itemstruct dlm_lock_resourcestruct dlm_migratable_lockstruct dlm_lockstruct dlm_node_iterstruct dlm_reco_node_datastruct dlm_master_requeststruct dlm_assert_masterstruct dlm_migrate_requeststruct dlm_master_requerystruct dlm_migratable_lockresstruct dlm_create_lockstruct dlm_convert_lockstruct dlm_unlock_lockstruct dlm_proxy_aststruct dlm_query_join_packetstruct dlm_lock_requeststruct dlm_reco_data_donestruct dlm_begin_recostruct dlm_query_join_requeststruct dlm_assert_joinedstruct dlm_cancel_joinstruct dlm_query_regionstruct dlm_node_infostruct dlm_query_nodeinfostruct dlm_exit_domainstruct dlm_finalize_recostruct dlm_deref_lockresstruct dlm_deref_lockres_doneenum dlm_mle_typeenum dlm_ast_typeenum dlm_ctxt_stateenum dlm_lockres_listenum dlm_query_join_response_codefunction dlm_is_recovery_lockfunction dlm_init_work_itemfunction __dlm_set_joining_nodefunction dlm_lvb_is_emptyfunction dlm_list_idx_to_ptr
Annotated Snippet
struct dlm_master_list_entry {
struct hlist_node master_hash_node;
struct list_head hb_events;
struct dlm_ctxt *dlm;
spinlock_t spinlock;
wait_queue_head_t wq;
atomic_t woken;
struct kref mle_refs;
int inuse;
unsigned long maybe_map[BITS_TO_LONGS(O2NM_MAX_NODES)];
unsigned long vote_map[BITS_TO_LONGS(O2NM_MAX_NODES)];
unsigned long response_map[BITS_TO_LONGS(O2NM_MAX_NODES)];
unsigned long node_map[BITS_TO_LONGS(O2NM_MAX_NODES)];
u8 master;
u8 new_master;
enum dlm_mle_type type;
struct o2hb_callback_func mle_hb_up;
struct o2hb_callback_func mle_hb_down;
struct dlm_lock_resource *mleres;
unsigned char mname[DLM_LOCKID_NAME_MAX];
unsigned int mnamelen;
unsigned int mnamehash;
};
enum dlm_ast_type {
DLM_AST = 0,
DLM_BAST = 1,
DLM_ASTUNLOCK = 2,
};
#define LKM_VALID_FLAGS (LKM_VALBLK | LKM_CONVERT | LKM_UNLOCK | \
LKM_CANCEL | LKM_INVVALBLK | LKM_FORCE | \
LKM_RECOVERY | LKM_LOCAL | LKM_NOQUEUE)
#define DLM_RECOVERY_LOCK_NAME "$RECOVERY"
#define DLM_RECOVERY_LOCK_NAME_LEN 9
static inline int dlm_is_recovery_lock(const char *lock_name, int name_len)
{
if (name_len == DLM_RECOVERY_LOCK_NAME_LEN &&
memcmp(lock_name, DLM_RECOVERY_LOCK_NAME, name_len)==0)
return 1;
return 0;
}
#define DLM_RECO_STATE_ACTIVE 0x0001
#define DLM_RECO_STATE_FINALIZE 0x0002
struct dlm_recovery_ctxt
{
struct list_head resources;
struct list_head node_data;
u8 new_master;
u8 dead_node;
u16 state;
unsigned long node_map[BITS_TO_LONGS(O2NM_MAX_NODES)];
wait_queue_head_t event;
};
enum dlm_ctxt_state {
DLM_CTXT_NEW = 0,
DLM_CTXT_JOINED = 1,
DLM_CTXT_IN_SHUTDOWN = 2,
DLM_CTXT_LEAVING = 3,
};
struct dlm_ctxt
{
struct list_head list;
struct hlist_head **lockres_hash;
struct list_head dirty_list;
struct list_head purge_list;
struct list_head pending_asts;
struct list_head pending_basts;
struct list_head tracking_list;
unsigned int purge_count;
spinlock_t spinlock;
spinlock_t ast_lock;
spinlock_t track_lock;
char *name;
u8 node_num;
u32 key;
u8 joining_node;
u8 migrate_done; /* set to 1 means node has migrated all lock resources */
wait_queue_head_t dlm_join_events;
unsigned long live_nodes_map[BITS_TO_LONGS(O2NM_MAX_NODES)];
unsigned long domain_map[BITS_TO_LONGS(O2NM_MAX_NODES)];
unsigned long exit_domain_map[BITS_TO_LONGS(O2NM_MAX_NODES)];
unsigned long recovery_map[BITS_TO_LONGS(O2NM_MAX_NODES)];
Annotation
- Immediate include surface: `linux/kref.h`.
- Detected declarations: `struct dlm_master_list_entry`, `struct dlm_recovery_ctxt`, `struct dlm_ctxt`, `struct dlm_lock_resource`, `struct dlm_work_item`, `struct dlm_request_all_locks_priv`, `struct dlm_mig_lockres_priv`, `struct dlm_assert_master_priv`, `struct dlm_deref_lockres_priv`, `struct dlm_work_item`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.