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.

Dependency Surface

Detected Declarations

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

Implementation Notes