fs/btrfs/raid-stripe-tree.h
Source file repositories/reference/linux-study-clean/fs/btrfs/raid-stripe-tree.h
File Facts
- System
- Linux kernel
- Corpus path
fs/btrfs/raid-stripe-tree.h- Extension
.h- Size
- 1661 bytes
- Lines
- 61
- 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
linux/types.huapi/linux/btrfs_tree.hfs.haccessors.h
Detected Declarations
struct btrfs_io_contextstruct btrfs_io_stripestruct btrfs_fs_infostruct btrfs_ordered_extentstruct btrfs_trans_handlefunction btrfs_need_stripe_tree_updatefunction btrfs_num_raid_stripes
Annotated Snippet
#ifndef BTRFS_RAID_STRIPE_TREE_H
#define BTRFS_RAID_STRIPE_TREE_H
#include <linux/types.h>
#include <uapi/linux/btrfs_tree.h>
#include "fs.h"
#include "accessors.h"
#define BTRFS_RST_SUPP_BLOCK_GROUP_MASK (BTRFS_BLOCK_GROUP_DUP | \
BTRFS_BLOCK_GROUP_RAID1_MASK | \
BTRFS_BLOCK_GROUP_RAID0 | \
BTRFS_BLOCK_GROUP_RAID10)
struct btrfs_io_context;
struct btrfs_io_stripe;
struct btrfs_fs_info;
struct btrfs_ordered_extent;
struct btrfs_trans_handle;
int btrfs_delete_raid_extent(struct btrfs_trans_handle *trans, u64 start, u64 length);
int btrfs_get_raid_extent_offset(struct btrfs_fs_info *fs_info,
u64 logical, u64 *length, u64 map_type,
u32 stripe_index, struct btrfs_io_stripe *stripe);
int btrfs_insert_raid_extent(struct btrfs_trans_handle *trans,
struct btrfs_ordered_extent *ordered_extent);
#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
int btrfs_insert_one_raid_extent(struct btrfs_trans_handle *trans,
struct btrfs_io_context *bioc);
#endif
static inline bool btrfs_need_stripe_tree_update(struct btrfs_fs_info *fs_info,
u64 map_type)
{
u64 type = map_type & BTRFS_BLOCK_GROUP_TYPE_MASK;
u64 profile = map_type & BTRFS_BLOCK_GROUP_PROFILE_MASK;
if (!btrfs_fs_incompat(fs_info, RAID_STRIPE_TREE))
return false;
if (type != BTRFS_BLOCK_GROUP_DATA)
return false;
if (profile & BTRFS_RST_SUPP_BLOCK_GROUP_MASK)
return true;
return false;
}
static inline int btrfs_num_raid_stripes(u32 item_size)
{
return item_size / sizeof(struct btrfs_raid_stride);
}
#endif
Annotation
- Immediate include surface: `linux/types.h`, `uapi/linux/btrfs_tree.h`, `fs.h`, `accessors.h`.
- Detected declarations: `struct btrfs_io_context`, `struct btrfs_io_stripe`, `struct btrfs_fs_info`, `struct btrfs_ordered_extent`, `struct btrfs_trans_handle`, `function btrfs_need_stripe_tree_update`, `function btrfs_num_raid_stripes`.
- 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.