include/linux/nfs_page.h

Source file repositories/reference/linux-study-clean/include/linux/nfs_page.h

File Facts

System
Linux kernel
Corpus path
include/linux/nfs_page.h
Extension
.h
Size
8694 bytes
Lines
287
Domain
Core OS
Bucket
Core Kernel Interface
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 nfs_page {
	struct list_head	wb_list;	/* Defines state of page: */
	union {
		struct page	*wb_page;	/* page to read in/write out */
		struct folio	*wb_folio;
	};
	struct nfs_lock_context	*wb_lock_context;	/* lock context info */
	pgoff_t			wb_index;	/* Offset >> PAGE_SHIFT */
	unsigned int		wb_offset,	/* Offset & ~PAGE_MASK */
				wb_pgbase,	/* Start of page data */
				wb_bytes;	/* Length of request */
	struct kref		wb_kref;	/* reference count */
	unsigned long		wb_flags;
	struct nfs_write_verifier	wb_verf;	/* Commit cookie */
	struct nfs_page		*wb_this_page;  /* list of reqs for this page */
	struct nfs_page		*wb_head;       /* head pointer for req list */
	unsigned short		wb_nio;		/* Number of I/O attempts */
};

struct nfs_pgio_mirror;
struct nfs_pageio_descriptor;
struct nfs_pageio_ops {
	void	(*pg_init)(struct nfs_pageio_descriptor *, struct nfs_page *);
	size_t	(*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *,
			   struct nfs_page *);
	int	(*pg_doio)(struct nfs_pageio_descriptor *);
	unsigned int	(*pg_get_mirror_count)(struct nfs_pageio_descriptor *,
				       struct nfs_page *);
	void	(*pg_cleanup)(struct nfs_pageio_descriptor *);
	struct nfs_pgio_mirror *
		(*pg_get_mirror)(struct nfs_pageio_descriptor *, u32);
	u32	(*pg_set_mirror)(struct nfs_pageio_descriptor *, u32);
};

struct nfs_rw_ops {
	struct nfs_pgio_header *(*rw_alloc_header)(void);
	void (*rw_free_header)(struct nfs_pgio_header *);
	int  (*rw_done)(struct rpc_task *, struct nfs_pgio_header *,
			struct inode *);
	void (*rw_result)(struct rpc_task *, struct nfs_pgio_header *);
	void (*rw_initiate)(struct nfs_pgio_header *, struct rpc_message *,
			    const struct nfs_rpc_ops *,
			    struct rpc_task_setup *, int);
};

struct nfs_pgio_mirror {
	struct list_head	pg_list;
	unsigned long		pg_bytes_written;
	size_t			pg_count;
	size_t			pg_bsize;
	unsigned int		pg_base;
	unsigned char		pg_recoalesce : 1;
};

struct nfs_pageio_descriptor {
	struct inode		*pg_inode;
	const struct nfs_pageio_ops *pg_ops;
	const struct nfs_rw_ops *pg_rw_ops;
	int 			pg_ioflags;
	int			pg_error;
	const struct rpc_call_ops *pg_rpc_callops;
	const struct nfs_pgio_completion_ops *pg_completion_ops;
	struct pnfs_layout_segment *pg_lseg;
	struct nfs_io_completion *pg_io_completion;
	struct nfs_direct_req	*pg_dreq;
#ifdef CONFIG_NFS_FSCACHE
	void			*pg_netfs;
#endif
	unsigned int		pg_bsize;	/* default bsize for mirrors */

	u32			pg_mirror_count;
	struct nfs_pgio_mirror	*pg_mirrors;
	struct nfs_pgio_mirror	pg_mirrors_static[1];
	struct nfs_pgio_mirror	*pg_mirrors_dynamic;
	u32			pg_mirror_idx;	/* current mirror */
	unsigned short		pg_maxretrans;
	unsigned char		pg_moreio : 1;
};

/* arbitrarily selected limit to number of mirrors */
#define NFS_PAGEIO_DESCRIPTOR_MIRROR_MAX 16

extern struct nfs_page *nfs_page_create_from_page(struct nfs_open_context *ctx,
						  struct page *page,
						  unsigned int pgbase,
						  loff_t offset,
						  unsigned int count);
extern struct nfs_page *nfs_page_create_from_folio(struct nfs_open_context *ctx,
						   struct folio *folio,
						   unsigned int offset,

Annotation

Implementation Notes