fs/dlm/dlm_internal.h
Source file repositories/reference/linux-study-clean/fs/dlm/dlm_internal.h
File Facts
- System
- Linux kernel
- Corpus path
fs/dlm/dlm_internal.h- Extension
.h- Size
- 23125 bytes
- Lines
- 834
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
uapi/linux/dlm_device.hlinux/slab.hlinux/sched.hlinux/types.hlinux/ctype.hlinux/spinlock.hlinux/vmalloc.hlinux/list.hlinux/errno.hlinux/random.hlinux/delay.hlinux/socket.hlinux/kthread.hlinux/kobject.hlinux/kref.hlinux/kernel.hlinux/jhash.hlinux/miscdevice.hlinux/rhashtable.hlinux/mutex.hlinux/xarray.hlinux/ratelimit.hlinux/uaccess.hlinux/dlm.hconfig.h
Detected Declarations
struct dlm_lsstruct dlm_lkbstruct dlm_rsbstruct dlm_memberstruct dlm_rsbtablestruct dlm_recoverstruct dlm_headerstruct dlm_messagestruct dlm_rcomstruct dlm_mhandlestruct dlm_msgstruct dlm_memberstruct dlm_recoverstruct dlm_argsstruct dlm_user_argsstruct dlm_callbackstruct dlm_lkbstruct dlm_rsbstruct dlm_headerstruct dlm_messagestruct dlm_rcomstruct dlm_opt_headerstruct dlm_optsstruct rcom_statusstruct rcom_configstruct rcom_slotstruct rcom_lockstruct dlm_lsstruct dlm_user_procenum rsb_flagsfunction rsb_set_flagfunction rsb_clear_flagfunction rsb_flagfunction dlm_locking_stoppedfunction dlm_recovery_stoppedfunction dlm_no_directoryfunction dlm_flags_valfunction for_each_set_bit_fromfunction dlm_iflags_valfunction dlm_dflags_valfunction BITfunction dlm_set_flags_valfunction dlm_set_dflags_valfunction dlm_set_sbflags_valfunction dlm_register_debugfsfunction dlm_delete_debug_comms_file
Annotated Snippet
struct dlm_member {
struct list_head list;
int nodeid;
int weight;
int slot;
int slot_prev;
int comm_seq;
uint32_t generation;
};
/*
* Save and manage recovery state for a lockspace.
*/
struct dlm_recover {
struct list_head list;
struct dlm_config_node *nodes;
int nodes_count;
uint64_t seq;
};
/*
* Pass input args to second stage locking function.
*/
struct dlm_args {
uint32_t flags;
void (*astfn) (void *astparam);
void *astparam;
void (*bastfn) (void *astparam, int mode);
int mode;
struct dlm_lksb *lksb;
};
/*
* Lock block
*
* A lock can be one of three types:
*
* local copy lock is mastered locally
* (lkb_nodeid is zero and DLM_LKF_MSTCPY is not set)
* process copy lock is mastered on a remote node
* (lkb_nodeid is non-zero and DLM_LKF_MSTCPY is not set)
* master copy master node's copy of a lock owned by remote node
* (lkb_nodeid is non-zero and DLM_LKF_MSTCPY is set)
*
* lkb_exflags: a copy of the most recent flags arg provided to dlm_lock or
* dlm_unlock. The dlm does not modify these or use any private flags in
* this field; it only contains DLM_LKF_ flags from dlm.h. These flags
* are sent as-is to the remote master when the lock is remote.
*
* lkb_flags: internal dlm flags (DLM_IFL_ prefix) from dlm_internal.h.
* Some internal flags are shared between the master and process nodes;
* these shared flags are kept in the lower two bytes. One of these
* flags set on the master copy will be propagated to the process copy
* and v.v. Other internal flags are private to the master or process
* node (e.g. DLM_IFL_MSTCPY). These are kept in the high two bytes.
*
* lkb_sbflags: status block flags. These flags are copied directly into
* the caller's lksb.sb_flags prior to the dlm_lock/dlm_unlock completion
* ast. All defined in dlm.h with DLM_SBF_ prefix.
*
* lkb_status: the lock status indicates which rsb queue the lock is
* on, grant, convert, or wait. DLM_LKSTS_ WAITING/GRANTED/CONVERT
*
* lkb_wait_type: the dlm message type (DLM_MSG_ prefix) for which a
* reply is needed. Only set when the lkb is on the lockspace waiters
* list awaiting a reply from a remote node.
*
* lkb_nodeid: when the lkb is a local copy, nodeid is 0; when the lkb
* is a master copy, nodeid specifies the remote lock holder, when the
* lkb is a process copy, the nodeid specifies the lock master.
*/
/* lkb_status */
#define DLM_LKSTS_WAITING 1
#define DLM_LKSTS_GRANTED 2
#define DLM_LKSTS_CONVERT 3
/* lkb_iflags */
#define DLM_IFL_MSTCPY_BIT 16
#define __DLM_IFL_MIN_BIT DLM_IFL_MSTCPY_BIT
#define DLM_IFL_RESEND_BIT 17
#define DLM_IFL_DEAD_BIT 18
#define DLM_IFL_OVERLAP_UNLOCK_BIT 19
#define DLM_IFL_OVERLAP_CANCEL_BIT 20
#define DLM_IFL_ENDOFLIFE_BIT 21
Annotation
- Immediate include surface: `uapi/linux/dlm_device.h`, `linux/slab.h`, `linux/sched.h`, `linux/types.h`, `linux/ctype.h`, `linux/spinlock.h`, `linux/vmalloc.h`, `linux/list.h`.
- Detected declarations: `struct dlm_ls`, `struct dlm_lkb`, `struct dlm_rsb`, `struct dlm_member`, `struct dlm_rsbtable`, `struct dlm_recover`, `struct dlm_header`, `struct dlm_message`, `struct dlm_rcom`, `struct dlm_mhandle`.
- 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.