fs/xfs/xfs_sysfs.h
Source file repositories/reference/linux-study-clean/fs/xfs/xfs_sysfs.h
File Facts
- System
- Linux kernel
- Corpus path
fs/xfs/xfs_sysfs.h- Extension
.h- Size
- 1280 bytes
- Lines
- 59
- 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
- No C-style include directives detected by the generator.
Detected Declarations
function to_kobjfunction xfs_sysfs_releasefunction xfs_sysfs_initfunction xfs_sysfs_del
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2014 Red Hat, Inc.
* All Rights Reserved.
*/
#ifndef __XFS_SYSFS_H__
#define __XFS_SYSFS_H__
extern const struct kobj_type xfs_dbg_ktype; /* debug */
extern const struct kobj_type xfs_log_ktype; /* xlog */
extern const struct kobj_type xfs_stats_ktype; /* stats */
static inline struct xfs_kobj *
to_kobj(struct kobject *kobject)
{
return container_of(kobject, struct xfs_kobj, kobject);
}
static inline void
xfs_sysfs_release(struct kobject *kobject)
{
struct xfs_kobj *kobj = to_kobj(kobject);
complete(&kobj->complete);
}
static inline int
xfs_sysfs_init(
struct xfs_kobj *kobj,
const struct kobj_type *ktype,
struct xfs_kobj *parent_kobj,
const char *name)
{
struct kobject *parent;
int err;
parent = parent_kobj ? &parent_kobj->kobject : NULL;
init_completion(&kobj->complete);
err = kobject_init_and_add(&kobj->kobject, ktype, parent, "%s", name);
if (err)
kobject_put(&kobj->kobject);
return err;
}
static inline void
xfs_sysfs_del(
struct xfs_kobj *kobj)
{
kobject_del(&kobj->kobject);
kobject_put(&kobj->kobject);
wait_for_completion(&kobj->complete);
}
int xfs_mount_sysfs_init(struct xfs_mount *mp);
void xfs_mount_sysfs_del(struct xfs_mount *mp);
#endif /* __XFS_SYSFS_H__ */
Annotation
- Detected declarations: `function to_kobj`, `function xfs_sysfs_release`, `function xfs_sysfs_init`, `function xfs_sysfs_del`.
- 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.