Documentation/translations/zh_TW/filesystems/sysfs.txt
Source file repositories/reference/linux-study-clean/Documentation/translations/zh_TW/filesystems/sysfs.txt
File Facts
- System
- Linux kernel
- Corpus path
Documentation/translations/zh_TW/filesystems/sysfs.txt- Extension
.txt- Size
- 12594 bytes
- Lines
- 378
- Domain
- Support Tooling And Documentation
- Bucket
- Documentation
- Inferred role
- Support Tooling And Documentation: operation-table or driver-model contract
- Status
- pattern 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.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- 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
struct attributestruct device_attributestruct sysfs_opsstruct device_attributestruct bus_attributestruct driver_attributefunction dev_attr_showfunction scnprintffunction store_name
Annotated Snippet
ssize_t (*show)(const struct bus_type *, char * buf);
ssize_t (*store)(const struct bus_type *, const char * buf, size_t count);
};
聲明:
BUS_ATTR(_name, _mode, _show, _store)
增/刪屬性:
int bus_create_file(struct bus_type *, struct bus_attribute *);
void bus_remove_file(struct bus_type *, struct bus_attribute *);
- 設備驅動程序 (include/linux/device.h)
-----------------------------------------
結構體:
struct driver_attribute {
struct attribute attr;
ssize_t (*show)(struct device_driver *, char * buf);
ssize_t (*store)(struct device_driver *, const char * buf,
size_t count);
};
聲明:
DRIVER_ATTR(_name, _mode, _show, _store)
增/刪屬性:
int driver_create_file(struct device_driver *, const struct driver_attribute *);
void driver_remove_file(struct device_driver *, const struct driver_attribute *);
文檔
~~~~
sysfs 目錄結構以及其中包含的屬性定義了一個內核與用戶空間之間的 ABI。
對於任何 ABI,其自身的穩定和適當的文檔是非常重要的。所有新的 sysfs
屬性必須在 Documentation/ABI 中有文檔。詳見 Documentation/ABI/README。
Annotation
- Detected declarations: `struct attribute`, `struct device_attribute`, `struct sysfs_ops`, `struct device_attribute`, `struct bus_attribute`, `struct driver_attribute`, `function dev_attr_show`, `function scnprintf`, `function store_name`.
- Atlas domain: Support Tooling And Documentation / Documentation.
- Implementation status: pattern 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.