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.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/list.hlinux/pagemap.hlinux/wait.hlinux/sunrpc/auth.hlinux/nfs_xdr.hlinux/kref.h
Detected Declarations
struct nfs_inodestruct nfs_pagestruct nfs_pgio_mirrorstruct nfs_pageio_descriptorstruct nfs_pageio_opsstruct nfs_rw_opsstruct nfs_pgio_mirrorstruct nfs_pageio_descriptorfunction nfs_page_max_lengthfunction nfs_lock_requestfunction nfs_list_add_requestfunction nfs_list_move_requestfunction nfs_list_remove_requestfunction nfs_list_entryfunction req_offsetfunction nfs_req_openctx
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
- Immediate include surface: `linux/list.h`, `linux/pagemap.h`, `linux/wait.h`, `linux/sunrpc/auth.h`, `linux/nfs_xdr.h`, `linux/kref.h`.
- Detected declarations: `struct nfs_inode`, `struct nfs_page`, `struct nfs_pgio_mirror`, `struct nfs_pageio_descriptor`, `struct nfs_pageio_ops`, `struct nfs_rw_ops`, `struct nfs_pgio_mirror`, `struct nfs_pageio_descriptor`, `function nfs_page_max_length`, `function nfs_lock_request`.
- Atlas domain: Core OS / Core Kernel Interface.
- 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.