fs/dlm/config.c
Source file repositories/reference/linux-study-clean/fs/dlm/config.c
File Facts
- System
- Linux kernel
- Corpus path
fs/dlm/config.c- Extension
.c- Size
- 24544 bytes
- Lines
- 1054
- 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
linux/kernel.hlinux/init.hlinux/configfs.hlinux/slab.hlinux/in.hlinux/in6.hlinux/dlmconstants.hnet/ipv6.hnet/sock.hconfig.hmidcomms.hlowcomms.h
Detected Declarations
struct dlm_clustersstruct dlm_clusterstruct dlm_spacesstruct dlm_spacestruct dlm_commsstruct dlm_commstruct dlm_nodesstruct dlm_nodestruct dlm_clusterstruct dlm_clustersstruct dlm_spacesstruct dlm_spacestruct dlm_commsstruct dlm_commstruct dlm_nodesstruct dlm_nodestruct dlm_member_gonefunction cluster_cluster_name_showfunction cluster_cluster_name_storefunction cluster_tcp_port_showfunction dlm_check_zero_and_dlm_runningfunction cluster_tcp_port_storefunction cluster_setfunction dlm_check_protocol_and_dlm_runningfunction dlm_check_zerofunction dlm_check_buffer_sizefunction drop_clusterfunction release_clusterfunction drop_spacefunction release_spacefunction drop_commfunction release_commfunction drop_nodefunction release_nodefunction dlm_config_initfunction dlm_config_exitfunction comm_nodeid_showfunction comm_nodeid_storefunction comm_local_showfunction comm_local_storefunction comm_addr_storefunction comm_addr_list_showfunction comm_mark_showfunction comm_mark_storefunction node_nodeid_showfunction node_nodeid_storefunction node_weight_showfunction node_weight_store
Annotated Snippet
struct dlm_cluster {
struct config_group group;
struct dlm_spaces *sps;
struct dlm_comms *cms;
};
static struct dlm_cluster *config_item_to_cluster(struct config_item *i)
{
return i ? container_of(to_config_group(i), struct dlm_cluster, group) :
NULL;
}
enum {
CLUSTER_ATTR_TCP_PORT = 0,
CLUSTER_ATTR_BUFFER_SIZE,
CLUSTER_ATTR_RSBTBL_SIZE,
CLUSTER_ATTR_RECOVER_TIMER,
CLUSTER_ATTR_TOSS_SECS,
CLUSTER_ATTR_SCAN_SECS,
CLUSTER_ATTR_LOG_DEBUG,
CLUSTER_ATTR_LOG_INFO,
CLUSTER_ATTR_PROTOCOL,
CLUSTER_ATTR_MARK,
CLUSTER_ATTR_NEW_RSB_COUNT,
CLUSTER_ATTR_RECOVER_CALLBACKS,
CLUSTER_ATTR_CLUSTER_NAME,
};
static ssize_t cluster_cluster_name_show(struct config_item *item, char *buf)
{
return sprintf(buf, "%s\n", dlm_config.ci_cluster_name);
}
static ssize_t cluster_cluster_name_store(struct config_item *item,
const char *buf, size_t len)
{
strscpy(dlm_config.ci_cluster_name, buf,
sizeof(dlm_config.ci_cluster_name));
return len;
}
CONFIGFS_ATTR(cluster_, cluster_name);
static ssize_t cluster_tcp_port_show(struct config_item *item, char *buf)
{
return sprintf(buf, "%u\n", be16_to_cpu(dlm_config.ci_tcp_port));
}
static int dlm_check_zero_and_dlm_running(unsigned int x)
{
if (!x)
return -EINVAL;
if (dlm_lowcomms_is_running())
return -EBUSY;
return 0;
}
static ssize_t cluster_tcp_port_store(struct config_item *item,
const char *buf, size_t len)
{
int rc;
u16 x;
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
rc = kstrtou16(buf, 0, &x);
if (rc)
return rc;
rc = dlm_check_zero_and_dlm_running(x);
if (rc)
return rc;
dlm_config.ci_tcp_port = cpu_to_be16(x);
return len;
}
CONFIGFS_ATTR(cluster_, tcp_port);
static ssize_t cluster_set(unsigned int *info_field,
int (*check_cb)(unsigned int x),
const char *buf, size_t len)
{
unsigned int x;
int rc;
if (!capable(CAP_SYS_ADMIN))
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/init.h`, `linux/configfs.h`, `linux/slab.h`, `linux/in.h`, `linux/in6.h`, `linux/dlmconstants.h`, `net/ipv6.h`.
- Detected declarations: `struct dlm_clusters`, `struct dlm_cluster`, `struct dlm_spaces`, `struct dlm_space`, `struct dlm_comms`, `struct dlm_comm`, `struct dlm_nodes`, `struct dlm_node`, `struct dlm_cluster`, `struct dlm_clusters`.
- 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.