fs/nfs/blocklayout/blocklayout.h
Source file repositories/reference/linux-study-clean/fs/nfs/blocklayout/blocklayout.h
File Facts
- System
- Linux kernel
- Corpus path
fs/nfs/blocklayout/blocklayout.h- Extension
.h- Size
- 5923 bytes
- Lines
- 205
- 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/device-mapper.hlinux/nfs_fs.hlinux/sunrpc/rpc_pipe_fs.h../nfs4_fs.h../pnfs.h../netns.h
Detected Declarations
struct pnfs_block_devstruct pnfs_block_volumestruct pnfs_block_dev_mapstruct pnfs_block_devstruct pnfs_block_extentstruct pnfs_block_layoutstruct bl_pipe_msgstruct bl_msg_hdrfunction BLK_LO2EXTfunction BLK_LSEG2EXT
Annotated Snippet
struct pnfs_block_volume {
enum pnfs_block_volume_type type;
union {
struct {
int len;
int nr_sigs;
struct {
u64 offset;
u32 sig_len;
u8 sig[PNFS_BLOCK_UUID_LEN];
} sigs[PNFS_BLOCK_MAX_UUIDS];
} simple;
struct {
u64 start;
u64 len;
u32 volume;
} slice;
struct {
u32 volumes_count;
u32 volumes[PNFS_BLOCK_MAX_DEVICES];
} concat;
struct {
u64 chunk_size;
u32 volumes_count;
u32 volumes[PNFS_BLOCK_MAX_DEVICES];
} stripe;
struct {
enum scsi_code_set code_set;
enum scsi_designator_type designator_type;
int designator_len;
u8 designator[256];
u64 pr_key;
} scsi;
};
};
struct pnfs_block_dev_map {
u64 start;
u64 len;
u64 disk_offset;
struct block_device *bdev;
};
struct pnfs_block_dev {
struct nfs4_deviceid_node node;
u64 start;
u64 len;
enum pnfs_block_volume_type type;
u32 nr_children;
struct pnfs_block_dev *children;
u64 chunk_size;
struct file *bdev_file;
u64 disk_offset;
unsigned long flags;
u64 pr_key;
bool (*map)(struct pnfs_block_dev *dev, u64 offset,
struct pnfs_block_dev_map *map);
};
/* pnfs_block_dev flag bits */
enum {
PNFS_BDEV_REGISTERED = 0,
};
/* sector_t fields are all in 512-byte sectors */
struct pnfs_block_extent {
union {
struct rb_node be_node;
struct list_head be_list;
};
struct nfs4_deviceid_node *be_device;
sector_t be_f_offset; /* the starting offset in the file */
sector_t be_length; /* the size of the extent */
sector_t be_v_offset; /* the starting offset in the volume */
enum pnfs_block_extent_state be_state; /* the state of this extent */
#define EXTENT_WRITTEN 1
#define EXTENT_COMMITTING 2
unsigned int be_tag;
};
struct pnfs_block_layout {
struct pnfs_layout_hdr bl_layout;
struct rb_root bl_ext_rw;
struct rb_root bl_ext_ro;
spinlock_t bl_ext_lock; /* Protects list manipulation */
Annotation
- Immediate include surface: `linux/device-mapper.h`, `linux/nfs_fs.h`, `linux/sunrpc/rpc_pipe_fs.h`, `../nfs4_fs.h`, `../pnfs.h`, `../netns.h`.
- Detected declarations: `struct pnfs_block_dev`, `struct pnfs_block_volume`, `struct pnfs_block_dev_map`, `struct pnfs_block_dev`, `struct pnfs_block_extent`, `struct pnfs_block_layout`, `struct bl_pipe_msg`, `struct bl_msg_hdr`, `function BLK_LO2EXT`, `function BLK_LSEG2EXT`.
- 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.