samples/kobject/kset-example.c
Source file repositories/reference/linux-study-clean/samples/kobject/kset-example.c
File Facts
- System
- Linux kernel
- Corpus path
samples/kobject/kset-example.c- Extension
.c- Size
- 7706 bytes
- Lines
- 306
- Domain
- Support Tooling And Documentation
- Bucket
- samples
- Inferred role
- Support Tooling And Documentation: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/kobject.hlinux/string.hlinux/sysfs.hlinux/slab.hlinux/module.hlinux/init.h
Detected Declarations
struct foo_objstruct foo_attributefunction foo_attr_showfunction foo_attr_storefunction foo_releasefunction foo_showfunction foo_storefunction b_showfunction b_storefunction foo_default_attrs_is_visiblefunction destroy_foo_objfunction example_initfunction example_exitmodule init example_init
Annotated Snippet
module_init(example_init);
module_exit(example_exit);
MODULE_DESCRIPTION("Sample kset and ktype implementation");
MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Greg Kroah-Hartman <greg@kroah.com>");
Annotation
- Immediate include surface: `linux/kobject.h`, `linux/string.h`, `linux/sysfs.h`, `linux/slab.h`, `linux/module.h`, `linux/init.h`.
- Detected declarations: `struct foo_obj`, `struct foo_attribute`, `function foo_attr_show`, `function foo_attr_store`, `function foo_release`, `function foo_show`, `function foo_store`, `function b_show`, `function b_store`, `function foo_default_attrs_is_visible`.
- Atlas domain: Support Tooling And Documentation / samples.
- Implementation status: integration 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.