fs/ocfs2/filecheck.c
Source file repositories/reference/linux-study-clean/fs/ocfs2/filecheck.c
File Facts
- System
- Linux kernel
- Corpus path
fs/ocfs2/filecheck.c- Extension
.c- Size
- 12183 bytes
- Lines
- 510
- 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/list.hlinux/spinlock.hlinux/module.hlinux/slab.hlinux/kmod.hlinux/fs.hlinux/kobject.hlinux/sysfs.hlinux/sysctl.hcluster/masklog.hocfs2.hocfs2_fs.hstackglue.hinode.hfilecheck.h
Detected Declarations
struct ocfs2_filecheck_entrystruct ocfs2_filecheck_argsfunction ocfs2_filecheck_errorfunction ocfs2_filecheck_releasefunction ocfs2_filecheck_showfunction ocfs2_filecheck_storefunction ocfs2_filecheck_sysfs_freefunction ocfs2_filecheck_create_sysfsfunction ocfs2_filecheck_remove_sysfsfunction ocfs2_filecheck_adjust_maxfunction ocfs2_filecheck_args_get_longfunction ocfs2_filecheck_type_parsefunction ocfs2_filecheck_args_parsefunction ocfs2_filecheck_attr_showfunction ocfs2_filecheck_is_dup_entryfunction list_for_each_entryfunction ocfs2_filecheck_erase_entryfunction list_for_each_entryfunction ocfs2_filecheck_erase_entriesfunction ocfs2_filecheck_done_entryfunction ocfs2_filecheck_handlefunction ocfs2_filecheck_handle_entryfunction ocfs2_filecheck_attr_store
Annotated Snippet
struct ocfs2_filecheck_entry {
struct list_head fe_list;
unsigned long fe_ino;
unsigned int fe_type;
unsigned int fe_done:1;
unsigned int fe_status:31;
};
struct ocfs2_filecheck_args {
unsigned int fa_type;
union {
unsigned long fa_ino;
unsigned int fa_len;
};
};
static const char *
ocfs2_filecheck_error(int errno)
{
if (!errno)
return ocfs2_filecheck_errs[errno];
BUG_ON(errno < OCFS2_FILECHECK_ERR_START ||
errno > OCFS2_FILECHECK_ERR_END);
return ocfs2_filecheck_errs[errno - OCFS2_FILECHECK_ERR_START + 1];
}
static ssize_t ocfs2_filecheck_attr_show(struct kobject *kobj,
struct kobj_attribute *attr,
char *buf);
static ssize_t ocfs2_filecheck_attr_store(struct kobject *kobj,
struct kobj_attribute *attr,
const char *buf, size_t count);
static struct kobj_attribute ocfs2_filecheck_attr_chk =
__ATTR(check, S_IRUSR | S_IWUSR,
ocfs2_filecheck_attr_show,
ocfs2_filecheck_attr_store);
static struct kobj_attribute ocfs2_filecheck_attr_fix =
__ATTR(fix, S_IRUSR | S_IWUSR,
ocfs2_filecheck_attr_show,
ocfs2_filecheck_attr_store);
static struct kobj_attribute ocfs2_filecheck_attr_set =
__ATTR(set, S_IRUSR | S_IWUSR,
ocfs2_filecheck_attr_show,
ocfs2_filecheck_attr_store);
static struct attribute *ocfs2_filecheck_attrs[] = {
&ocfs2_filecheck_attr_chk.attr,
&ocfs2_filecheck_attr_fix.attr,
&ocfs2_filecheck_attr_set.attr,
NULL
};
ATTRIBUTE_GROUPS(ocfs2_filecheck);
static void ocfs2_filecheck_release(struct kobject *kobj)
{
struct ocfs2_filecheck_sysfs_entry *entry = container_of(kobj,
struct ocfs2_filecheck_sysfs_entry, fs_kobj);
complete(&entry->fs_kobj_unregister);
}
static ssize_t
ocfs2_filecheck_show(struct kobject *kobj, struct attribute *attr, char *buf)
{
ssize_t ret = -EIO;
struct kobj_attribute *kattr = container_of(attr,
struct kobj_attribute, attr);
kobject_get(kobj);
if (kattr->show)
ret = kattr->show(kobj, kattr, buf);
kobject_put(kobj);
return ret;
}
static ssize_t
ocfs2_filecheck_store(struct kobject *kobj, struct attribute *attr,
const char *buf, size_t count)
{
ssize_t ret = -EIO;
struct kobj_attribute *kattr = container_of(attr,
struct kobj_attribute, attr);
kobject_get(kobj);
if (kattr->store)
ret = kattr->store(kobj, kattr, buf, count);
kobject_put(kobj);
return ret;
}
Annotation
- Immediate include surface: `linux/list.h`, `linux/spinlock.h`, `linux/module.h`, `linux/slab.h`, `linux/kmod.h`, `linux/fs.h`, `linux/kobject.h`, `linux/sysfs.h`.
- Detected declarations: `struct ocfs2_filecheck_entry`, `struct ocfs2_filecheck_args`, `function ocfs2_filecheck_error`, `function ocfs2_filecheck_release`, `function ocfs2_filecheck_show`, `function ocfs2_filecheck_store`, `function ocfs2_filecheck_sysfs_free`, `function ocfs2_filecheck_create_sysfs`, `function ocfs2_filecheck_remove_sysfs`, `function ocfs2_filecheck_adjust_max`.
- 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.