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.

Dependency Surface

Detected Declarations

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

Implementation Notes