fs/nfs/pnfs.h
Source file repositories/reference/linux-study-clean/fs/nfs/pnfs.h
File Facts
- System
- Linux kernel
- Corpus path
fs/nfs/pnfs.h- Extension
.h- Size
- 28358 bytes
- Lines
- 929
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/refcount.hlinux/nfs_fs.hlinux/nfs_page.hlinux/workqueue.h
Detected Declarations
struct nfs4_exceptionstruct nfs4_opendatastruct nfs4_pnfs_ds_addrstruct nfs4_pnfs_dsstruct pnfs_layout_segmentstruct nfs4_deviceid_nodestruct pnfs_layoutdriver_typestruct pnfs_commit_opsstruct pnfs_layout_hdrstruct pnfs_devicestruct pnfs_deviceliststruct nfs4_deviceid_nodeenum pnfs_try_statusenum layoutdriver_policy_flagsenum pnfs_layout_destroy_modefunction nfs_have_layoutfunction pnfs_layout_is_validfunction nfs4_get_deviceidfunction pnfs_get_lsegfunction pnfs_is_valid_lsegfunction pnfs_enabled_sbfunction pnfs_commit_listfunction pnfs_get_ds_infofunction pnfs_init_ds_commit_info_opsfunction pnfs_init_ds_commit_infofunction pnfs_release_ds_infofunction pnfs_generic_mark_devid_invalidfunction pnfs_mark_request_commitfunction pnfs_clear_request_commitfunction pnfs_scan_commit_listsfunction pnfs_recover_commit_reqsfunction pnfs_ld_layoutret_on_setattrfunction pnfs_ld_read_whole_pagefunction pnfs_sync_inodefunction pnfs_layoutcommit_outstandingfunction pnfs_return_layoutfunction pnfs_use_thresholdfunction pnfs_calc_offset_endfunction pnfs_calc_offset_lengthfunction pnfs_copy_rangefunction pnfs_end_offsetfunction pnfs_is_range_intersectingfunction pnfs_lseg_range_intersectingfunction pnfs_lseg_request_intersectingfunction pnfs_lseg_cancel_iofunction nfs4_print_deviceidfunction pnfs_destroy_all_layoutsfunction pnfs_get_lseg
Annotated Snippet
struct nfs4_pnfs_ds_addr {
struct sockaddr_storage da_addr;
size_t da_addrlen;
struct list_head da_node; /* nfs4_pnfs_dev_hlist dev_dslist */
char *da_remotestr; /* human readable addr+port */
const char *da_netid;
int da_transport;
};
struct nfs4_pnfs_ds {
struct list_head ds_node; /* nfs4_pnfs_dev_hlist dev_dslist */
char *ds_remotestr; /* comma sep list of addrs */
struct list_head ds_addrs;
const struct net *ds_net;
struct nfs_client *ds_clp;
refcount_t ds_count;
unsigned long ds_state;
#define NFS4DS_CONNECTING 0 /* ds is establishing connection */
};
struct pnfs_layout_segment {
struct list_head pls_list;
struct list_head pls_lc_list;
struct list_head pls_commits;
struct pnfs_layout_range pls_range;
refcount_t pls_refcount;
u32 pls_seq;
unsigned long pls_flags;
struct pnfs_layout_hdr *pls_layout;
};
enum pnfs_try_status {
PNFS_ATTEMPTED = 0,
PNFS_NOT_ATTEMPTED = 1,
PNFS_TRY_AGAIN = 2,
};
#if IS_ENABLED(CONFIG_NFS_V4)
#define LAYOUT_NFSV4_1_MODULE_PREFIX "nfs-layouttype4"
/*
* Default data server connection timeout and retrans vaules.
* Set by module parameters dataserver_timeo and dataserver_retrans.
*/
#define NFS4_DEF_DS_TIMEO 600 /* in tenths of a second */
#define NFS4_DEF_DS_RETRANS 5
#define PNFS_DEVICE_RETRY_TIMEOUT (120*HZ)
enum {
NFS_LAYOUT_RO_FAILED = 0, /* get ro layout failed stop trying */
NFS_LAYOUT_RW_FAILED, /* get rw layout failed stop trying */
NFS_LAYOUT_BULK_RECALL, /* bulk recall affecting layout */
NFS_LAYOUT_RETURN, /* layoutreturn in progress */
NFS_LAYOUT_RETURN_LOCK, /* Serialise layoutreturn */
NFS_LAYOUT_RETURN_REQUESTED, /* Return this layout ASAP */
NFS_LAYOUT_INVALID_STID, /* layout stateid id is invalid */
NFS_LAYOUT_FIRST_LAYOUTGET, /* Serialize first layoutget */
NFS_LAYOUT_INODE_FREEING, /* The inode is being freed */
NFS_LAYOUT_HASHED, /* The layout visible */
NFS_LAYOUT_DRAIN,
};
enum layoutdriver_policy_flags {
/* Should the pNFS client commit and return the layout upon truncate to
* a smaller size */
PNFS_LAYOUTRET_ON_SETATTR = 1 << 0,
PNFS_LAYOUTRET_ON_ERROR = 1 << 1,
PNFS_READ_WHOLE_PAGE = 1 << 2,
PNFS_LAYOUTGET_ON_OPEN = 1 << 3,
};
enum pnfs_layout_destroy_mode {
PNFS_LAYOUT_INVALIDATE = 0,
PNFS_LAYOUT_BULK_RETURN,
PNFS_LAYOUT_FILE_BULK_RETURN,
};
struct nfs4_deviceid_node;
/* Per-layout driver specific registration structure */
struct pnfs_layoutdriver_type {
struct list_head pnfs_tblid;
const u32 id;
const char *name;
struct module *owner;
unsigned flags;
unsigned max_layoutget_response;
int (*set_layoutdriver) (struct nfs_server *, const struct nfs_fh *);
Annotation
- Immediate include surface: `linux/refcount.h`, `linux/nfs_fs.h`, `linux/nfs_page.h`, `linux/workqueue.h`.
- Detected declarations: `struct nfs4_exception`, `struct nfs4_opendata`, `struct nfs4_pnfs_ds_addr`, `struct nfs4_pnfs_ds`, `struct pnfs_layout_segment`, `struct nfs4_deviceid_node`, `struct pnfs_layoutdriver_type`, `struct pnfs_commit_ops`, `struct pnfs_layout_hdr`, `struct pnfs_device`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.