include/linux/configfs.h
Source file repositories/reference/linux-study-clean/include/linux/configfs.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/configfs.h- Extension
.h- Size
- 8852 bytes
- Lines
- 278
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- 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/stat.hlinux/types.hlinux/list.hlinux/kref.hlinux/mutex.h
Detected Declarations
struct modulestruct configfs_item_operationsstruct configfs_group_operationsstruct configfs_attributestruct configfs_bin_attributestruct configfs_subsystemstruct config_itemstruct config_item_typestruct config_groupstruct configfs_attributestruct filestruct vm_area_structstruct configfs_bin_attributestruct configfs_item_operationsstruct configfs_group_operationsstruct configfs_subsystemfunction config_group_putfunction configfs_add_default_groupfunction configfs_undepend_item_unlocked
Annotated Snippet
struct config_item {
char *ci_name;
char ci_namebuf[CONFIGFS_ITEM_NAME_LEN];
struct kref ci_kref;
struct list_head ci_entry;
struct config_item *ci_parent;
struct config_group *ci_group;
const struct config_item_type *ci_type;
struct dentry *ci_dentry;
};
extern __printf(2, 3)
int config_item_set_name(struct config_item *, const char *, ...);
static inline char *config_item_name(struct config_item * item)
{
return item->ci_name;
}
extern void config_item_init_type_name(struct config_item *item,
const char *name,
const struct config_item_type *type);
extern struct config_item *config_item_get(struct config_item *);
extern struct config_item *config_item_get_unless_zero(struct config_item *);
extern void config_item_put(struct config_item *);
struct config_item_type {
struct module *ct_owner;
const struct configfs_item_operations *ct_item_ops;
const struct configfs_group_operations *ct_group_ops;
struct configfs_attribute **ct_attrs;
struct configfs_bin_attribute **ct_bin_attrs;
};
/**
* group - a group of config_items of a specific type, belonging
* to a specific subsystem.
*/
struct config_group {
struct config_item cg_item;
struct list_head cg_children;
struct configfs_subsystem *cg_subsys;
struct list_head default_groups;
struct list_head group_entry;
};
extern void config_group_init(struct config_group *group);
extern void config_group_init_type_name(struct config_group *group,
const char *name,
const struct config_item_type *type);
static inline struct config_group *to_config_group(struct config_item *item)
{
return item ? container_of(item,struct config_group,cg_item) : NULL;
}
static inline struct config_group *config_group_get(struct config_group *group)
{
return group ? to_config_group(config_item_get(&group->cg_item)) : NULL;
}
static inline void config_group_put(struct config_group *group)
{
config_item_put(&group->cg_item);
}
extern struct config_item *config_group_find_item(struct config_group *,
const char *);
static inline void configfs_add_default_group(struct config_group *new_group,
struct config_group *group)
{
list_add_tail(&new_group->group_entry, &group->default_groups);
}
struct configfs_attribute {
const char *ca_name;
struct module *ca_owner;
umode_t ca_mode;
ssize_t (*show)(struct config_item *, char *);
ssize_t (*store)(struct config_item *, const char *, size_t);
};
#define CONFIGFS_ATTR_PERM(_pfx, _name, _perm) \
static struct configfs_attribute _pfx##attr_##_name = { \
.ca_name = __stringify(_name), \
.ca_mode = _perm, \
.ca_owner = THIS_MODULE, \
Annotation
- Immediate include surface: `linux/stat.h`, `linux/types.h`, `linux/list.h`, `linux/kref.h`, `linux/mutex.h`.
- Detected declarations: `struct module`, `struct configfs_item_operations`, `struct configfs_group_operations`, `struct configfs_attribute`, `struct configfs_bin_attribute`, `struct configfs_subsystem`, `struct config_item`, `struct config_item_type`, `struct config_group`, `struct configfs_attribute`.
- Atlas domain: Core OS / Core Kernel Interface.
- 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.