xref: /openbmc/linux/fs/nfs/nfs4_fs.h (revision 961a828d)
14ce79717STrond Myklebust /*
24ce79717STrond Myklebust  * linux/fs/nfs/nfs4_fs.h
34ce79717STrond Myklebust  *
44ce79717STrond Myklebust  * Copyright (C) 2005 Trond Myklebust
54ce79717STrond Myklebust  *
64ce79717STrond Myklebust  * NFSv4-specific filesystem definitions and declarations
74ce79717STrond Myklebust  */
84ce79717STrond Myklebust 
94ce79717STrond Myklebust #ifndef __LINUX_FS_NFS_NFS4_FS_H
104ce79717STrond Myklebust #define __LINUX_FS_NFS_NFS4_FS_H
114ce79717STrond Myklebust 
124ce79717STrond Myklebust #ifdef CONFIG_NFS_V4
134ce79717STrond Myklebust 
144ce79717STrond Myklebust struct idmap;
154ce79717STrond Myklebust 
164ce79717STrond Myklebust enum nfs4_client_state {
17e005e804STrond Myklebust 	NFS4CLNT_MANAGER_RUNNING  = 0,
18e598d843STrond Myklebust 	NFS4CLNT_CHECK_LEASE,
1958d9714aSTrond Myklebust 	NFS4CLNT_LEASE_EXPIRED,
20b79a4a1bSTrond Myklebust 	NFS4CLNT_RECLAIM_REBOOT,
21b79a4a1bSTrond Myklebust 	NFS4CLNT_RECLAIM_NOGRACE,
22707fb4b3STrond Myklebust 	NFS4CLNT_DELEGRETURN,
2343f1b3daSFred Isaman 	NFS4CLNT_LAYOUTRECALL,
246df08189SAndy Adamson 	NFS4CLNT_SESSION_RESET,
25b9efa1b2SAndy Adamson 	NFS4CLNT_RECALL_SLOT,
26fd954ae1STrond Myklebust 	NFS4CLNT_LEASE_CONFIRM,
2778fe0f41SWeston Andros Adamson 	NFS4CLNT_SERVER_SCOPE_MISMATCH,
284ce79717STrond Myklebust };
294ce79717STrond Myklebust 
30a2118c33STrond Myklebust enum nfs4_session_state {
311055d76dSTrond Myklebust 	NFS4_SESSION_INITING,
32a2118c33STrond Myklebust 	NFS4_SESSION_DRAINING,
33a2118c33STrond Myklebust };
34a2118c33STrond Myklebust 
352f60ea6bSTrond Myklebust #define NFS4_RENEW_TIMEOUT		0x01
362f60ea6bSTrond Myklebust #define NFS4_RENEW_DELEGATION_CB	0x02
372f60ea6bSTrond Myklebust 
3897dc1359STrond Myklebust struct nfs4_minor_version_ops {
3997dc1359STrond Myklebust 	u32	minor_version;
4097dc1359STrond Myklebust 
417c513058SBryan Schumaker 	int	(*call_sync)(struct rpc_clnt *clnt,
427c513058SBryan Schumaker 			struct nfs_server *server,
4397dc1359STrond Myklebust 			struct rpc_message *msg,
4497dc1359STrond Myklebust 			struct nfs4_sequence_args *args,
4597dc1359STrond Myklebust 			struct nfs4_sequence_res *res,
4697dc1359STrond Myklebust 			int cache_reply);
47e047a10cSTrond Myklebust 	int	(*validate_stateid)(struct nfs_delegation *,
48e047a10cSTrond Myklebust 			const nfs4_stateid *);
49fca78d6dSBryan Schumaker 	int	(*find_root_sec)(struct nfs_server *, struct nfs_fh *,
50fca78d6dSBryan Schumaker 			struct nfs_fsinfo *);
51c48f4f35STrond Myklebust 	const struct nfs4_state_recovery_ops *reboot_recovery_ops;
52c48f4f35STrond Myklebust 	const struct nfs4_state_recovery_ops *nograce_recovery_ops;
53c48f4f35STrond Myklebust 	const struct nfs4_state_maintenance_ops *state_renewal_ops;
5497dc1359STrond Myklebust };
5597dc1359STrond Myklebust 
5648c22eb2STrond Myklebust struct nfs_unique_id {
5748c22eb2STrond Myklebust 	struct rb_node rb_node;
5848c22eb2STrond Myklebust 	__u64 id;
5948c22eb2STrond Myklebust };
6048c22eb2STrond Myklebust 
61cee54fc9STrond Myklebust #define NFS_SEQID_CONFIRMED 1
62cee54fc9STrond Myklebust struct nfs_seqid_counter {
6348c22eb2STrond Myklebust 	int owner_id;
64cee54fc9STrond Myklebust 	int flags;
65cee54fc9STrond Myklebust 	u32 counter;
667ba127abSTrond Myklebust 	spinlock_t lock;		/* Protects the list */
677ba127abSTrond Myklebust 	struct list_head list;		/* Defines sequence of RPC calls */
687ba127abSTrond Myklebust 	struct rpc_wait_queue	wait;	/* RPC call delay queue */
69cee54fc9STrond Myklebust };
70cee54fc9STrond Myklebust 
71cee54fc9STrond Myklebust struct nfs_seqid {
72cee54fc9STrond Myklebust 	struct nfs_seqid_counter *sequence;
734e51336aSTrond Myklebust 	struct list_head list;
74cee54fc9STrond Myklebust };
75cee54fc9STrond Myklebust 
76cee54fc9STrond Myklebust static inline void nfs_confirm_seqid(struct nfs_seqid_counter *seqid, int status)
77cee54fc9STrond Myklebust {
78cee54fc9STrond Myklebust 	if (seqid_mutating_err(-status))
79cee54fc9STrond Myklebust 		seqid->flags |= NFS_SEQID_CONFIRMED;
80cee54fc9STrond Myklebust }
81cee54fc9STrond Myklebust 
82cee54fc9STrond Myklebust /*
834ce79717STrond Myklebust  * NFS4 state_owners and lock_owners are simply labels for ordered
844ce79717STrond Myklebust  * sequences of RPC calls. Their sole purpose is to provide once-only
854ce79717STrond Myklebust  * semantics by allowing the server to identify replayed requests.
864ce79717STrond Myklebust  */
874ce79717STrond Myklebust struct nfs4_state_owner {
886f2e64d3STrond Myklebust 	struct nfs_server    *so_server;
890aaaf5c4SChuck Lever 	struct list_head     so_lru;
900aaaf5c4SChuck Lever 	unsigned long        so_expires;
9124d292b8SChuck Lever 	struct rb_node	     so_server_node;
924ce79717STrond Myklebust 
934ce79717STrond Myklebust 	struct rpc_cred	     *so_cred;	 /* Associated cred */
949f958ab8STrond Myklebust 
959f958ab8STrond Myklebust 	spinlock_t	     so_lock;
969f958ab8STrond Myklebust 	atomic_t	     so_count;
977eff03aeSTrond Myklebust 	unsigned long	     so_flags;
984ce79717STrond Myklebust 	struct list_head     so_states;
99cee54fc9STrond Myklebust 	struct nfs_seqid_counter so_seqid;
1004ce79717STrond Myklebust };
1014ce79717STrond Myklebust 
1027eff03aeSTrond Myklebust enum {
1037eff03aeSTrond Myklebust 	NFS_OWNER_RECLAIM_REBOOT,
1047eff03aeSTrond Myklebust 	NFS_OWNER_RECLAIM_NOGRACE
1057eff03aeSTrond Myklebust };
1067eff03aeSTrond Myklebust 
107afe6c27cSAlexandros Batsakis #define NFS_LOCK_NEW		0
108afe6c27cSAlexandros Batsakis #define NFS_LOCK_RECLAIM	1
109afe6c27cSAlexandros Batsakis #define NFS_LOCK_EXPIRED	2
110afe6c27cSAlexandros Batsakis 
1114ce79717STrond Myklebust /*
1124ce79717STrond Myklebust  * struct nfs4_state maintains the client-side state for a given
1134ce79717STrond Myklebust  * (state_owner,inode) tuple (OPEN) or state_owner (LOCK).
1144ce79717STrond Myklebust  *
1154ce79717STrond Myklebust  * OPEN:
1164ce79717STrond Myklebust  * In order to know when to OPEN_DOWNGRADE or CLOSE the state on the server,
1174ce79717STrond Myklebust  * we need to know how many files are open for reading or writing on a
1184ce79717STrond Myklebust  * given inode. This information too is stored here.
1194ce79717STrond Myklebust  *
1204ce79717STrond Myklebust  * LOCK: one nfs4_state (LOCK) to hold the lock stateid nfs4_state(OPEN)
1214ce79717STrond Myklebust  */
1224ce79717STrond Myklebust 
12377041ed9STrond Myklebust struct nfs4_lock_owner {
12477041ed9STrond Myklebust 	unsigned int lo_type;
12577041ed9STrond Myklebust #define NFS4_ANY_LOCK_TYPE	(0U)
12677041ed9STrond Myklebust #define NFS4_FLOCK_LOCK_TYPE	(1U << 0)
12777041ed9STrond Myklebust #define NFS4_POSIX_LOCK_TYPE	(1U << 1)
12877041ed9STrond Myklebust 	union {
12977041ed9STrond Myklebust 		fl_owner_t posix_owner;
13077041ed9STrond Myklebust 		pid_t flock_owner;
13177041ed9STrond Myklebust 	} lo_u;
13277041ed9STrond Myklebust };
13377041ed9STrond Myklebust 
1344ce79717STrond Myklebust struct nfs4_lock_state {
1354ce79717STrond Myklebust 	struct list_head	ls_locks;	/* Other lock stateids */
1368d0a8a9dSTrond Myklebust 	struct nfs4_state *	ls_state;	/* Pointer to open state */
1374ce79717STrond Myklebust #define NFS_LOCK_INITIALIZED 1
1384ce79717STrond Myklebust 	int			ls_flags;
139cee54fc9STrond Myklebust 	struct nfs_seqid_counter	ls_seqid;
1404ce79717STrond Myklebust 	nfs4_stateid		ls_stateid;
1414ce79717STrond Myklebust 	atomic_t		ls_count;
14277041ed9STrond Myklebust 	struct nfs4_lock_owner	ls_owner;
1434ce79717STrond Myklebust };
1444ce79717STrond Myklebust 
1454ce79717STrond Myklebust /* bits for nfs4_state->flags */
1464ce79717STrond Myklebust enum {
1474ce79717STrond Myklebust 	LK_STATE_IN_USE,
148003707c7STrond Myklebust 	NFS_DELEGATED_STATE,		/* Current stateid is delegation */
149003707c7STrond Myklebust 	NFS_O_RDONLY_STATE,		/* OPEN stateid has read-only state */
150003707c7STrond Myklebust 	NFS_O_WRONLY_STATE,		/* OPEN stateid has write-only state */
151003707c7STrond Myklebust 	NFS_O_RDWR_STATE,		/* OPEN stateid has read/write state */
152b79a4a1bSTrond Myklebust 	NFS_STATE_RECLAIM_REBOOT,	/* OPEN stateid server rebooted */
153b79a4a1bSTrond Myklebust 	NFS_STATE_RECLAIM_NOGRACE,	/* OPEN stateid needs to recover state */
1548e469ebdSTrond Myklebust 	NFS_STATE_POSIX_LOCKS,		/* Posix locks are supported */
1554ce79717STrond Myklebust };
1564ce79717STrond Myklebust 
1574ce79717STrond Myklebust struct nfs4_state {
1584ce79717STrond Myklebust 	struct list_head open_states;	/* List of states for the same state_owner */
1594ce79717STrond Myklebust 	struct list_head inode_states;	/* List of states for the same inode */
1604ce79717STrond Myklebust 	struct list_head lock_states;	/* List of subservient lock stateids */
1614ce79717STrond Myklebust 
1624ce79717STrond Myklebust 	struct nfs4_state_owner *owner;	/* Pointer to the open owner */
1634ce79717STrond Myklebust 	struct inode *inode;		/* Pointer to the inode */
1644ce79717STrond Myklebust 
1654ce79717STrond Myklebust 	unsigned long flags;		/* Do we hold any locks? */
1668d0a8a9dSTrond Myklebust 	spinlock_t state_lock;		/* Protects the lock_states list */
1674ce79717STrond Myklebust 
1688bda4e4cSTrond Myklebust 	seqlock_t seqlock;		/* Protects the stateid/open_stateid */
169003707c7STrond Myklebust 	nfs4_stateid stateid;		/* Current stateid: may be delegation */
170003707c7STrond Myklebust 	nfs4_stateid open_stateid;	/* OPEN stateid */
1714ce79717STrond Myklebust 
1728bda4e4cSTrond Myklebust 	/* The following 3 fields are protected by owner->so_lock */
173003707c7STrond Myklebust 	unsigned int n_rdonly;		/* Number of read-only references */
174003707c7STrond Myklebust 	unsigned int n_wronly;		/* Number of write-only references */
175003707c7STrond Myklebust 	unsigned int n_rdwr;		/* Number of read/write references */
176dc0b027dSTrond Myklebust 	fmode_t state;			/* State on the server (R,W, or RW) */
1774ce79717STrond Myklebust 	atomic_t count;
1784ce79717STrond Myklebust };
1794ce79717STrond Myklebust 
1804ce79717STrond Myklebust 
1814ce79717STrond Myklebust struct nfs4_exception {
1824ce79717STrond Myklebust 	long timeout;
1834ce79717STrond Myklebust 	int retry;
1849e33bed5STrond Myklebust 	struct nfs4_state *state;
1854ce79717STrond Myklebust };
1864ce79717STrond Myklebust 
1874ce79717STrond Myklebust struct nfs4_state_recovery_ops {
1887eff03aeSTrond Myklebust 	int owner_flag_bit;
189b79a4a1bSTrond Myklebust 	int state_flag_bit;
1904ce79717STrond Myklebust 	int (*recover_open)(struct nfs4_state_owner *, struct nfs4_state *);
1914ce79717STrond Myklebust 	int (*recover_lock)(struct nfs4_state *, struct file_lock *);
192591d71cbSAndy Adamson 	int (*establish_clid)(struct nfs_client *, struct rpc_cred *);
19390a16617SAndy Adamson 	struct rpc_cred * (*get_clid_cred)(struct nfs_client *);
194fce5c838SRicardo Labiaga 	int (*reclaim_complete)(struct nfs_client *);
1954ce79717STrond Myklebust };
1964ce79717STrond Myklebust 
19729fba38bSBenny Halevy struct nfs4_state_maintenance_ops {
1982f60ea6bSTrond Myklebust 	int (*sched_state_renewal)(struct nfs_client *, struct rpc_cred *, unsigned);
199a7b72103SAndy Adamson 	struct rpc_cred * (*get_state_renewal_cred_locked)(struct nfs_client *);
2008e69514fSBenny Halevy 	int (*renew_lease)(struct nfs_client *, struct rpc_cred *);
20129fba38bSBenny Halevy };
20229fba38bSBenny Halevy 
203f786aa90SAl Viro extern const struct dentry_operations nfs4_dentry_operations;
20492e1d5beSArjan van de Ven extern const struct inode_operations nfs4_dir_inode_operations;
2056b3b5496SJ. Bruce Fields 
2064ce79717STrond Myklebust /* nfs4proc.c */
207bb8b27e5STrond Myklebust extern int nfs4_proc_setclientid(struct nfs_client *, u32, unsigned short, struct rpc_cred *, struct nfs4_setclientid_res *);
208bb8b27e5STrond Myklebust extern int nfs4_proc_setclientid_confirm(struct nfs_client *, struct nfs4_setclientid_res *arg, struct rpc_cred *);
2094d643d1dSAndy Adamson extern int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred);
210591d71cbSAndy Adamson extern int nfs4_init_clientid(struct nfs_client *, struct rpc_cred *);
2114d643d1dSAndy Adamson extern int nfs41_init_clientid(struct nfs_client *, struct rpc_cred *);
212643168c2SAl Viro extern int nfs4_do_close(struct nfs4_state *state, gfp_t gfp_mask, int wait, bool roc);
21355a97593STrond Myklebust extern int nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *fhandle);
21456659e99STrond Myklebust extern int nfs4_proc_fs_locations(struct inode *dir, const struct qstr *name,
2157aaa0b3bSManoj Naik 		struct nfs4_fs_locations *fs_locations, struct page *page);
216d3c7b7ccSTrond Myklebust extern void nfs4_release_lockowner(const struct nfs4_lock_state *);
21764c2ce8bSAneesh Kumar K.V extern const struct xattr_handler *nfs4_xattr_handlers[];
2184ce79717STrond Myklebust 
219557134a3SAndy Adamson #if defined(CONFIG_NFS_V4_1)
220035168abSTrond Myklebust static inline struct nfs4_session *nfs4_get_session(const struct nfs_server *server)
221035168abSTrond Myklebust {
222035168abSTrond Myklebust 	return server->nfs_client->cl_session;
223035168abSTrond Myklebust }
224035168abSTrond Myklebust 
225961a828dSTrond Myklebust extern bool nfs4_set_task_privileged(struct rpc_task *task, void *dummy);
226035168abSTrond Myklebust extern int nfs4_setup_sequence(const struct nfs_server *server,
227fbcd4abcSAndy Adamson 		struct nfs4_sequence_args *args, struct nfs4_sequence_res *res,
2289d12b216STrond Myklebust 		struct rpc_task *task);
229dc70d7b3SAndy Adamson extern int nfs41_setup_sequence(struct nfs4_session *session,
230dc70d7b3SAndy Adamson 		struct nfs4_sequence_args *args, struct nfs4_sequence_res *res,
2319d12b216STrond Myklebust 		struct rpc_task *task);
232557134a3SAndy Adamson extern void nfs4_destroy_session(struct nfs4_session *session);
233557134a3SAndy Adamson extern struct nfs4_session *nfs4_alloc_session(struct nfs_client *clp);
234f26468fbSTrond Myklebust extern int nfs4_proc_create_session(struct nfs_client *);
235c3fad1b1SAndy Adamson extern int nfs4_proc_destroy_session(struct nfs4_session *);
236fccba804STrond Myklebust extern int nfs4_init_session(struct nfs_server *server);
2379430fb6bSRicardo Labiaga extern int nfs4_proc_get_lease_time(struct nfs_client *clp,
2389430fb6bSRicardo Labiaga 		struct nfs_fsinfo *fsinfo);
239863a3c6cSAndy Adamson extern int nfs4_proc_layoutcommit(struct nfs4_layoutcommit_data *data,
240ef311537SAndy Adamson 				  bool sync);
24194de8b27SAndy Adamson 
24294de8b27SAndy Adamson static inline bool
24394de8b27SAndy Adamson is_ds_only_client(struct nfs_client *clp)
24494de8b27SAndy Adamson {
24594de8b27SAndy Adamson 	return (clp->cl_exchange_flags & EXCHGID4_FLAG_MASK_PNFS) ==
24694de8b27SAndy Adamson 		EXCHGID4_FLAG_USE_PNFS_DS;
24794de8b27SAndy Adamson }
248d83217c1SAndy Adamson 
249d83217c1SAndy Adamson static inline bool
250d83217c1SAndy Adamson is_ds_client(struct nfs_client *clp)
251d83217c1SAndy Adamson {
252d83217c1SAndy Adamson 	return clp->cl_exchange_flags & EXCHGID4_FLAG_USE_PNFS_DS;
253d83217c1SAndy Adamson }
254fbcd4abcSAndy Adamson #else /* CONFIG_NFS_v4_1 */
255035168abSTrond Myklebust static inline struct nfs4_session *nfs4_get_session(const struct nfs_server *server)
256035168abSTrond Myklebust {
257035168abSTrond Myklebust 	return NULL;
258035168abSTrond Myklebust }
259035168abSTrond Myklebust 
260035168abSTrond Myklebust static inline int nfs4_setup_sequence(const struct nfs_server *server,
261fbcd4abcSAndy Adamson 		struct nfs4_sequence_args *args, struct nfs4_sequence_res *res,
2629d12b216STrond Myklebust 		struct rpc_task *task)
263fbcd4abcSAndy Adamson {
264fbcd4abcSAndy Adamson 	return 0;
265fbcd4abcSAndy Adamson }
266fccba804STrond Myklebust 
267fccba804STrond Myklebust static inline int nfs4_init_session(struct nfs_server *server)
268fccba804STrond Myklebust {
269fccba804STrond Myklebust 	return 0;
270fccba804STrond Myklebust }
27194de8b27SAndy Adamson 
27294de8b27SAndy Adamson static inline bool
27394de8b27SAndy Adamson is_ds_only_client(struct nfs_client *clp)
27494de8b27SAndy Adamson {
27594de8b27SAndy Adamson 	return false;
27694de8b27SAndy Adamson }
277d83217c1SAndy Adamson 
278d83217c1SAndy Adamson static inline bool
279d83217c1SAndy Adamson is_ds_client(struct nfs_client *clp)
280d83217c1SAndy Adamson {
281d83217c1SAndy Adamson 	return false;
282d83217c1SAndy Adamson }
283557134a3SAndy Adamson #endif /* CONFIG_NFS_V4_1 */
2844ce79717STrond Myklebust 
28597dc1359STrond Myklebust extern const struct nfs4_minor_version_ops *nfs_v4_minor_ops[];
28629fba38bSBenny Halevy 
2874ce79717STrond Myklebust extern const u32 nfs4_fattr_bitmap[2];
2884ce79717STrond Myklebust extern const u32 nfs4_statfs_bitmap[2];
2894ce79717STrond Myklebust extern const u32 nfs4_pathconf_bitmap[2];
290dae100c2SFred Isaman extern const u32 nfs4_fsinfo_bitmap[3];
291830b8e33SManoj Naik extern const u32 nfs4_fs_locations_bitmap[2];
2924ce79717STrond Myklebust 
2934ce79717STrond Myklebust /* nfs4renewd.c */
294adfa6f98SDavid Howells extern void nfs4_schedule_state_renewal(struct nfs_client *);
2954ce79717STrond Myklebust extern void nfs4_renewd_prepare_shutdown(struct nfs_server *);
296adfa6f98SDavid Howells extern void nfs4_kill_renewd(struct nfs_client *);
29765f27f38SDavid Howells extern void nfs4_renew_state(struct work_struct *);
2984ce79717STrond Myklebust 
2994ce79717STrond Myklebust /* nfs4state.c */
300a7b72103SAndy Adamson struct rpc_cred *nfs4_get_setclientid_cred(struct nfs_client *clp);
3016dc9d57aSTrond Myklebust struct rpc_cred *nfs4_get_renew_cred_locked(struct nfs_client *clp);
302a7b72103SAndy Adamson #if defined(CONFIG_NFS_V4_1)
303a7b72103SAndy Adamson struct rpc_cred *nfs4_get_machine_cred_locked(struct nfs_client *clp);
304b4b82607SAndy Adamson struct rpc_cred *nfs4_get_exchange_id_cred(struct nfs_client *clp);
3050400a6b0STrond Myklebust extern void nfs4_schedule_session_recovery(struct nfs4_session *);
3060400a6b0STrond Myklebust #else
3070400a6b0STrond Myklebust static inline void nfs4_schedule_session_recovery(struct nfs4_session *session)
3080400a6b0STrond Myklebust {
3090400a6b0STrond Myklebust }
310a7b72103SAndy Adamson #endif /* CONFIG_NFS_V4_1 */
3114ce79717STrond Myklebust 
312d1e284d5STrond Myklebust extern struct nfs4_state_owner *nfs4_get_state_owner(struct nfs_server *, struct rpc_cred *, gfp_t);
3134ce79717STrond Myklebust extern void nfs4_put_state_owner(struct nfs4_state_owner *);
3140aaaf5c4SChuck Lever extern void nfs4_purge_state_owners(struct nfs_server *);
3154ce79717STrond Myklebust extern struct nfs4_state * nfs4_get_open_state(struct inode *, struct nfs4_state_owner *);
3164ce79717STrond Myklebust extern void nfs4_put_open_state(struct nfs4_state *);
317643168c2SAl Viro extern void nfs4_close_state(struct nfs4_state *, fmode_t);
318643168c2SAl Viro extern void nfs4_close_sync(struct nfs4_state *, fmode_t);
319dc0b027dSTrond Myklebust extern void nfs4_state_set_mode_locked(struct nfs4_state *, fmode_t);
3200400a6b0STrond Myklebust extern void nfs4_schedule_lease_recovery(struct nfs_client *);
321b0d3ded1STrond Myklebust extern void nfs4_schedule_state_manager(struct nfs_client *);
322042b60beSTrond Myklebust extern void nfs4_schedule_path_down_recovery(struct nfs_client *clp);
3230400a6b0STrond Myklebust extern void nfs4_schedule_stateid_recovery(const struct nfs_server *, struct nfs4_state *);
3240629e370SAlexandros Batsakis extern void nfs41_handle_sequence_flag_errors(struct nfs_client *clp, u32 flags);
325b9efa1b2SAndy Adamson extern void nfs41_handle_recall_slot(struct nfs_client *clp);
32678fe0f41SWeston Andros Adamson extern void nfs41_handle_server_scope(struct nfs_client *,
32778fe0f41SWeston Andros Adamson 				      struct server_scope **);
328faf5f49cSTrond Myklebust extern void nfs4_put_lock_state(struct nfs4_lock_state *lsp);
3298d0a8a9dSTrond Myklebust extern int nfs4_set_lock_state(struct nfs4_state *state, struct file_lock *fl);
33077041ed9STrond Myklebust extern void nfs4_copy_stateid(nfs4_stateid *, struct nfs4_state *, fl_owner_t, pid_t);
3314ce79717STrond Myklebust 
3328535b2beSTrond Myklebust extern struct nfs_seqid *nfs_alloc_seqid(struct nfs_seqid_counter *counter, gfp_t gfp_mask);
333cee54fc9STrond Myklebust extern int nfs_wait_on_sequence(struct nfs_seqid *seqid, struct rpc_task *task);
334cee54fc9STrond Myklebust extern void nfs_increment_open_seqid(int status, struct nfs_seqid *seqid);
335cee54fc9STrond Myklebust extern void nfs_increment_lock_seqid(int status, struct nfs_seqid *seqid);
33672211dbeSTrond Myklebust extern void nfs_release_seqid(struct nfs_seqid *seqid);
337cee54fc9STrond Myklebust extern void nfs_free_seqid(struct nfs_seqid *seqid);
338cee54fc9STrond Myklebust 
3394ce79717STrond Myklebust extern const nfs4_stateid zero_stateid;
3404ce79717STrond Myklebust 
3414ce79717STrond Myklebust /* nfs4xdr.c */
3424ce79717STrond Myklebust extern struct rpc_procinfo nfs4_procedures[];
3434ce79717STrond Myklebust 
3444ce79717STrond Myklebust struct nfs4_mount_data;
3454ce79717STrond Myklebust 
3464ce79717STrond Myklebust /* callback_xdr.c */
3474ce79717STrond Myklebust extern struct svc_version nfs4_callback_version1;
34807bccc2dSAlexandros Batsakis extern struct svc_version nfs4_callback_version4;
3494ce79717STrond Myklebust 
3504ce79717STrond Myklebust #else
3514ce79717STrond Myklebust 
352643168c2SAl Viro #define nfs4_close_state(a, b) do { } while (0)
353643168c2SAl Viro #define nfs4_close_sync(a, b) do { } while (0)
3544ce79717STrond Myklebust 
3554ce79717STrond Myklebust #endif /* CONFIG_NFS_V4 */
3564ce79717STrond Myklebust #endif /* __LINUX_FS_NFS_NFS4_FS.H */
357