fs/ocfs2/dlmglue.c
Source file repositories/reference/linux-study-clean/fs/ocfs2/dlmglue.c
File Facts
- System
- Linux kernel
- Corpus path
fs/ocfs2/dlmglue.c- Extension
.c- Size
- 129304 bytes
- Lines
- 4486
- Domain
- Core OS
- Bucket
- VFS And Filesystem Core
- Inferred role
- Core OS: operation-table or driver-model contract
- Status
- pattern 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.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- 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
linux/types.hlinux/slab.hlinux/highmem.hlinux/mm.hlinux/kthread.hlinux/pagemap.hlinux/debugfs.hlinux/seq_file.hlinux/time.hlinux/delay.hlinux/quotaops.hlinux/sched/signal.hlinux/string_choices.hcluster/masklog.hocfs2.hocfs2_lockingver.halloc.hdcache.hdlmglue.hextent_map.hfile.hheartbeat.hinode.hjournal.hstackglue.hslot_map.hsuper.huptodate.hquota.hrefcounttree.hacl.hbuffer_head_io.h
Detected Declarations
struct ocfs2_mask_waiterstruct ocfs2_unblock_ctlstruct ocfs2_lock_res_opsstruct ocfs2_dlm_seq_privenum ocfs2_unblock_actionfunction ocfs2_dump_meta_lvb_infofunction ocfs2_is_inode_lockfunction ocfs2_lock_res_refcount_treefunction ocfs2_cluster_unlockfunction ocfs2_build_lock_namefunction ocfs2_add_lockres_trackingfunction ocfs2_remove_lockres_trackingfunction ocfs2_init_lock_statsfunction ocfs2_update_lock_statsfunction ocfs2_track_lock_refreshfunction ocfs2_track_lock_waitfunction ocfs2_init_start_timefunction ocfs2_init_lock_statsfunction ocfs2_lock_res_init_oncefunction ocfs2_inode_lock_res_initfunction ocfs2_get_dentry_lock_inofunction ocfs2_dentry_lock_res_initfunction ocfs2_super_lock_res_initfunction ocfs2_rename_lock_res_initfunction ocfs2_nfs_sync_lock_res_initfunction ocfs2_nfs_sync_lock_initfunction ocfs2_trim_fs_lock_res_initfunction ocfs2_trim_fs_lock_res_uninitfunction ocfs2_orphan_scan_lock_res_initfunction ocfs2_file_lock_res_initfunction ocfs2_qinfo_lock_res_initfunction ocfs2_refcount_lock_res_initfunction ocfs2_lock_res_freefunction ocfs2_add_holderfunction ocfs2_pid_holderfunction ocfs2_remove_holderfunction ocfs2_inc_holdersfunction ocfs2_dec_holdersfunction ocfs2_highest_compat_lock_levelfunction lockres_set_flagsfunction list_for_each_entry_safefunction lockres_or_flagsfunction lockres_clear_flagsfunction ocfs2_generic_handle_downconvert_actionfunction ocfs2_highest_compat_lock_levelfunction ocfs2_generic_handle_convert_actionfunction ocfs2_generic_handle_attach_actionfunction ocfs2_generic_handle_bast
Annotated Snippet
static const struct file_operations ocfs2_dlm_debug_fops = {
.open = ocfs2_dlm_debug_open,
.release = ocfs2_dlm_debug_release,
.read = seq_read,
.llseek = seq_lseek,
};
static void ocfs2_dlm_init_debug(struct ocfs2_super *osb)
{
struct ocfs2_dlm_debug *dlm_debug = osb->osb_dlm_debug;
debugfs_create_file("locking_state", S_IFREG|S_IRUSR,
osb->osb_debug_root, osb, &ocfs2_dlm_debug_fops);
debugfs_create_u32("locking_filter", 0600, osb->osb_debug_root,
&dlm_debug->d_filter_secs);
ocfs2_get_dlm_debug(dlm_debug);
}
static void ocfs2_dlm_shutdown_debug(struct ocfs2_super *osb)
{
struct ocfs2_dlm_debug *dlm_debug = osb->osb_dlm_debug;
if (dlm_debug)
ocfs2_put_dlm_debug(dlm_debug);
}
int ocfs2_dlm_init(struct ocfs2_super *osb)
{
int status = 0;
struct ocfs2_cluster_connection *conn = NULL;
if (ocfs2_mount_local(osb)) {
osb->node_num = 0;
goto local;
}
ocfs2_dlm_init_debug(osb);
/* launch downconvert thread */
osb->dc_task = kthread_run(ocfs2_downconvert_thread, osb, "ocfs2dc-%s",
osb->uuid_str);
if (IS_ERR(osb->dc_task)) {
status = PTR_ERR(osb->dc_task);
osb->dc_task = NULL;
mlog_errno(status);
goto bail;
}
/* for now, uuid == domain */
status = ocfs2_cluster_connect(osb->osb_cluster_stack,
osb->osb_cluster_name,
strlen(osb->osb_cluster_name),
osb->uuid_str,
strlen(osb->uuid_str),
&lproto, ocfs2_do_node_down, osb,
&conn);
if (status) {
mlog_errno(status);
goto bail;
}
status = ocfs2_cluster_this_node(conn, &osb->node_num);
if (status < 0) {
mlog_errno(status);
mlog(ML_ERROR,
"could not find this host's node number\n");
ocfs2_cluster_disconnect(conn, 0);
goto bail;
}
local:
ocfs2_super_lock_res_init(&osb->osb_super_lockres, osb);
ocfs2_rename_lock_res_init(&osb->osb_rename_lockres, osb);
ocfs2_nfs_sync_lock_init(osb);
ocfs2_orphan_scan_lock_res_init(&osb->osb_orphan_scan.os_lockres, osb);
osb->cconn = conn;
bail:
if (status < 0) {
ocfs2_dlm_shutdown_debug(osb);
if (osb->dc_task)
kthread_stop(osb->dc_task);
}
return status;
}
void ocfs2_dlm_shutdown(struct ocfs2_super *osb,
int hangup_pending)
Annotation
- Immediate include surface: `linux/types.h`, `linux/slab.h`, `linux/highmem.h`, `linux/mm.h`, `linux/kthread.h`, `linux/pagemap.h`, `linux/debugfs.h`, `linux/seq_file.h`.
- Detected declarations: `struct ocfs2_mask_waiter`, `struct ocfs2_unblock_ctl`, `struct ocfs2_lock_res_ops`, `struct ocfs2_dlm_seq_priv`, `enum ocfs2_unblock_action`, `function ocfs2_dump_meta_lvb_info`, `function ocfs2_is_inode_lock`, `function ocfs2_lock_res_refcount_tree`, `function ocfs2_cluster_unlock`, `function ocfs2_build_lock_name`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: pattern 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.