fs/nfsd/state.h
Source file repositories/reference/linux-study-clean/fs/nfsd/state.h
File Facts
- System
- Linux kernel
- Corpus path
fs/nfsd/state.h- Extension
.h- Size
- 30436 bytes
- Lines
- 915
- 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.
- 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
crypto/md5.hlinux/idr.hlinux/refcount.hlinux/sunrpc/svc_xprt.hnfsfh.hnfsd.h
Detected Declarations
struct nfsd4_referring_callstruct nfsd4_referring_call_liststruct nfsd4_callbackstruct nfsd4_callback_opsstruct nfs4_stidstruct nfs4_cpntf_statestruct nfs4_cb_fattrstruct nfs4_delegationstruct nfs4_cb_connstruct nfsd4_slotstruct nfsd4_channel_attrsstruct nfsd4_cb_secstruct nfsd4_create_sessionstruct nfsd4_backchannel_ctlstruct nfsd4_bind_conn_to_sessionstruct nfsd4_clid_slotstruct nfsd4_connstruct nfsd4_sessionstruct nfsd4_sessionidstruct nfs4_clientstruct nfs4_client_reclaimstruct nfs4_replaystruct nfs4_stateownerstruct nfs4_stateowner_operationsstruct nfs4_stateownerstruct nfs4_openownerstruct nfs4_lockownerstruct nfs4_clnt_odstatestruct nfs4_filestruct nfs4_ol_stateidstruct nfs4_layout_stateidstruct nfsd4_blocked_lockstruct nfsd4_compound_statestruct nfsd_netstruct nfsd4_copystruct nfsd4_get_dir_delegationenum nfsd4_cb_opfunction deleg_is_readfunction deleg_is_writefunction deleg_attrs_delegfunction openownerfunction lockownerfunction nfsd4_stateid_generation_afterfunction nfsd4_try_run_cbfunction get_nfs4_filefunction nfsd4_revoke_statesfunction nfsd_net_cb_shutdownfunction try_to_expire_client
Annotated Snippet
struct nfsd4_referring_call {
struct list_head __list;
u32 rc_sequenceid;
u32 rc_slotid;
};
struct nfsd4_referring_call_list {
struct list_head __list;
struct nfs4_sessionid rcl_sessionid;
int __nr_referring_calls;
struct list_head rcl_referring_calls;
};
struct nfsd4_callback {
struct nfs4_client *cb_clp;
struct rpc_message cb_msg;
#define NFSD4_CALLBACK_RUNNING (0)
#define NFSD4_CALLBACK_WAKE (1)
#define NFSD4_CALLBACK_REQUEUE (2)
unsigned long cb_flags;
const struct nfsd4_callback_ops *cb_ops;
struct work_struct cb_work;
int cb_seq_status;
int cb_status;
int cb_held_slot;
int cb_nr_referring_call_list;
struct list_head cb_referring_call_list;
};
struct nfsd4_callback_ops {
void (*prepare)(struct nfsd4_callback *);
int (*done)(struct nfsd4_callback *, struct rpc_task *);
void (*release)(struct nfsd4_callback *);
uint32_t opcode;
};
/*
* A core object that represents a "common" stateid. These are generally
* embedded within the different (more specific) stateid objects and contain
* fields that are of general use to any stateid.
*/
struct nfs4_stid {
refcount_t sc_count;
/* A new stateid is added to the cl_stateids idr early before it
* is fully initialised. Its sc_type is then zero. After
* initialisation the sc_type it set under cl_lock, and then
* never changes.
*/
#define SC_TYPE_OPEN BIT(0)
#define SC_TYPE_LOCK BIT(1)
#define SC_TYPE_DELEG BIT(2)
#define SC_TYPE_LAYOUT BIT(3)
unsigned short sc_type;
/* nn->deleg_lock protects sc_status for delegation stateids.
* ->cl_lock protects sc_status for open and lock stateids.
* ->st_mutex also protect sc_status for open stateids.
* ->ls_lock protects sc_status for layout stateids.
*/
/*
* For an open stateid kept around *only* to process close replays.
* For deleg stateid, kept in idr until last reference is dropped.
*/
#define SC_STATUS_CLOSED BIT(0)
/* For a deleg stateid kept around only to process free_stateid's: */
#define SC_STATUS_REVOKED BIT(1)
#define SC_STATUS_ADMIN_REVOKED BIT(2)
#define SC_STATUS_FREEABLE BIT(3)
#define SC_STATUS_FREED BIT(4)
unsigned short sc_status;
struct list_head sc_cp_list;
stateid_t sc_stateid;
spinlock_t sc_lock;
struct nfs4_client *sc_client;
struct nfs4_file *sc_file;
struct svc_export *sc_export;
void (*sc_free)(struct nfs4_stid *);
};
/* Keep a list of stateids issued by the COPY_NOTIFY, associate it with the
* parent OPEN/LOCK/DELEG stateid.
*/
struct nfs4_cpntf_state {
copy_stateid_t cp_stateid;
struct list_head cp_list; /* per parent nfs4_stid */
Annotation
- Immediate include surface: `crypto/md5.h`, `linux/idr.h`, `linux/refcount.h`, `linux/sunrpc/svc_xprt.h`, `nfsfh.h`, `nfsd.h`.
- Detected declarations: `struct nfsd4_referring_call`, `struct nfsd4_referring_call_list`, `struct nfsd4_callback`, `struct nfsd4_callback_ops`, `struct nfs4_stid`, `struct nfs4_cpntf_state`, `struct nfs4_cb_fattr`, `struct nfs4_delegation`, `struct nfs4_cb_conn`, `struct nfsd4_slot`.
- 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.