fs/ntfs/sysctl.c
Source file repositories/reference/linux-study-clean/fs/ntfs/sysctl.c
File Facts
- System
- Linux kernel
- Corpus path
fs/ntfs/sysctl.c- Extension
.c- Size
- 1226 bytes
- Lines
- 55
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/proc_fs.hlinux/sysctl.hsysctl.hdebug.h
Detected Declarations
function ntfs_sysctl
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Code for sysctl handling in NTFS Linux kernel driver.
*
* Copyright (C) 1997 Martin von Löwis, Régis Duchesne
* Copyright (c) 2002-2005 Anton Altaparmakov
*/
#ifdef DEBUG
#include <linux/module.h>
#ifdef CONFIG_SYSCTL
#include <linux/proc_fs.h>
#include <linux/sysctl.h>
#include "sysctl.h"
#include "debug.h"
/* Definition of the ntfs sysctl. */
static const struct ctl_table ntfs_sysctls[] = {
{
.procname = "ntfs-debug",
.data = &debug_msgs, /* Data pointer and size. */
.maxlen = sizeof(debug_msgs),
.mode = 0644, /* Mode, proc handler. */
.proc_handler = proc_dointvec
},
};
/* Storage for the sysctls header. */
static struct ctl_table_header *sysctls_root_table;
/*
* ntfs_sysctl - add or remove the debug sysctl
* @add: add (1) or remove (0) the sysctl
*
* Add or remove the debug sysctl. Return 0 on success or -errno on error.
*/
int ntfs_sysctl(int add)
{
if (add) {
sysctls_root_table = register_sysctl("fs/ntfs", ntfs_sysctls);
if (!sysctls_root_table)
return -ENOMEM;
} else {
unregister_sysctl_table(sysctls_root_table);
sysctls_root_table = NULL;
}
return 0;
}
#endif /* CONFIG_SYSCTL */
#endif /* DEBUG */
Annotation
- Immediate include surface: `linux/module.h`, `linux/proc_fs.h`, `linux/sysctl.h`, `sysctl.h`, `debug.h`.
- Detected declarations: `function ntfs_sysctl`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: source implementation candidate.
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.