fs/btrfs/volumes.h
Source file repositories/reference/linux-study-clean/fs/btrfs/volumes.h
File Facts
- System
- Linux kernel
- Corpus path
fs/btrfs/volumes.h- Extension
.h- Size
- 29383 bytes
- Lines
- 944
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/blk_types.hlinux/blkdev.hlinux/sizes.hlinux/atomic.hlinux/sort.hlinux/list.hlinux/mutex.hlinux/log2.hlinux/kobject.hlinux/refcount.hlinux/completion.hlinux/rbtree.huapi/linux/btrfs.huapi/linux/btrfs_tree.hmessages.hextent-io-tree.hfs.hlinux/seqlock.h
Detected Declarations
struct block_devicestruct bdev_handlestruct btrfs_fs_infostruct btrfs_block_groupstruct btrfs_trans_handlestruct btrfs_transactionstruct btrfs_zoned_device_infostruct btrfs_space_infostruct btrfs_fs_devicesstruct btrfs_devicestruct btrfs_swapfile_pinstruct btrfs_fs_devicesstruct btrfs_io_stripestruct btrfs_discard_stripestruct btrfs_io_contextstruct btrfs_device_infostruct btrfs_raid_attrstruct btrfs_chunk_mapstruct btrfs_balance_controlstruct btrfs_dev_lookup_argsenum btrfs_raid_typesenum btrfs_chunk_allocation_policyenum btrfs_read_policyenum btrfs_map_opfunction btrfs_free_chunk_mapfunction btrfs_opfunction btrfs_chunk_item_sizefunction btrfs_stripe_nr_to_offsetfunction btrfs_dev_stat_incfunction btrfs_dev_stat_readfunction btrfs_dev_stat_read_and_resetfunction btrfs_dev_stat_setfunction btrfs_warn_unknown_chunk_allocationfunction btrfs_fs_devices_inc_holdingfunction btrfs_fs_devices_dec_holdingfunction btrfs_get_per_profile_avail
Annotated Snippet
struct btrfs_device {
struct list_head dev_list; /* device_list_mutex */
struct list_head dev_alloc_list; /* chunk mutex */
struct list_head post_commit_list; /* chunk mutex */
struct btrfs_fs_devices *fs_devices;
struct btrfs_fs_info *fs_info;
/* Device path or NULL if missing. */
const char __rcu *name;
u64 generation;
struct file *bdev_file;
struct block_device *bdev;
struct btrfs_zoned_device_info *zone_info;
unsigned long dev_state;
#ifdef __BTRFS_NEED_DEVICE_DATA_ORDERED
seqcount_t data_seqcount;
#endif
/* the internal btrfs device id */
u64 devid;
/* size of the device in memory */
u64 total_bytes;
/* size of the device on disk */
u64 disk_total_bytes;
/* bytes used */
u64 bytes_used;
/* optimal io alignment for this device */
u32 io_align;
/* optimal io width for this device */
u32 io_width;
/* type and info about this device */
u64 type;
/*
* Counter of super block write errors, values larger than
* BTRFS_SUPER_PRIMARY_WRITE_ERROR encode primary super block write failure.
*/
atomic_t sb_write_errors;
/* minimal io size for this device */
u32 sector_size;
/* physical drive uuid (or lvm uuid) */
u8 uuid[BTRFS_UUID_SIZE];
/*
* size of the device on the current transaction
*
* This variant is update when committing the transaction,
* and protected by chunk mutex
*/
u64 commit_total_bytes;
/* bytes used on the current transaction */
u64 commit_bytes_used;
/* Bio used for flushing device barriers */
struct bio flush_bio;
struct completion flush_wait;
/* per-device scrub information */
struct scrub_ctx *scrub_ctx;
/* disk I/O failure stats. For detailed description refer to
* enum btrfs_dev_stat_values in ioctl.h */
int dev_stats_valid;
/* Counter to record the change of device stats */
atomic_t dev_stats_ccnt;
atomic_t dev_stat_values[BTRFS_DEV_STAT_VALUES_MAX];
/*
* Device's major-minor number. Must be set even if the device is not
* opened (bdev == NULL), unless the device is missing.
*/
dev_t devt;
struct extent_io_tree alloc_state;
struct completion kobj_unregister;
Annotation
- Immediate include surface: `linux/blk_types.h`, `linux/blkdev.h`, `linux/sizes.h`, `linux/atomic.h`, `linux/sort.h`, `linux/list.h`, `linux/mutex.h`, `linux/log2.h`.
- Detected declarations: `struct block_device`, `struct bdev_handle`, `struct btrfs_fs_info`, `struct btrfs_block_group`, `struct btrfs_trans_handle`, `struct btrfs_transaction`, `struct btrfs_zoned_device_info`, `struct btrfs_space_info`, `struct btrfs_fs_devices`, `struct btrfs_device`.
- 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.