MOXA linux-2.6.x / linux-2.6.9-uc0 from sdlinux-moxaart.tgz
[linux-2.6.9-moxart.git] / include / linux / nfs_fs.h
blob0ccc263aacf540f56303dbddc8bb70def232412d
1 /*
2 * linux/include/linux/nfs_fs.h
4 * Copyright (C) 1992 Rick Sladkey
6 * OS-specific nfs filesystem definitions and declarations
7 */
9 #ifndef _LINUX_NFS_FS_H
10 #define _LINUX_NFS_FS_H
12 #include <linux/config.h>
13 #include <linux/in.h>
14 #include <linux/mm.h>
15 #include <linux/pagemap.h>
16 #include <linux/rwsem.h>
17 #include <linux/wait.h>
18 #include <linux/uio.h>
20 #include <linux/nfs_fs_sb.h>
22 #include <linux/sunrpc/debug.h>
23 #include <linux/sunrpc/auth.h>
24 #include <linux/sunrpc/clnt.h>
26 #include <linux/nfs.h>
27 #include <linux/nfs2.h>
28 #include <linux/nfs3.h>
29 #include <linux/nfs4.h>
30 #include <linux/nfs_xdr.h>
31 #include <linux/rwsem.h>
32 #include <linux/workqueue.h>
35 * Enable debugging support for nfs client.
36 * Requires RPC_DEBUG.
38 #ifdef RPC_DEBUG
39 # define NFS_DEBUG
40 #endif
42 #define NFS_MAX_FILE_IO_BUFFER_SIZE 32768
43 #define NFS_DEF_FILE_IO_BUFFER_SIZE 4096
46 * The upper limit on timeouts for the exponential backoff algorithm.
48 #define NFS_WRITEBACK_DELAY (5*HZ)
49 #define NFS_WRITEBACK_LOCKDELAY (60*HZ)
50 #define NFS_COMMIT_DELAY (5*HZ)
53 * superblock magic number for NFS
55 #define NFS_SUPER_MAGIC 0x6969
58 * These are the default flags for swap requests
60 #define NFS_RPC_SWAPFLAGS (RPC_TASK_SWAPPER|RPC_TASK_ROOTCREDS)
62 #define NFS_RW_SYNC 0x0001 /* O_SYNC handling */
63 #define NFS_RW_SWAP 0x0002 /* This is a swap request */
66 * When flushing a cluster of dirty pages, there can be different
67 * strategies:
69 #define FLUSH_AGING 0 /* only flush old buffers */
70 #define FLUSH_SYNC 1 /* file being synced, or contention */
71 #define FLUSH_WAIT 2 /* wait for completion */
72 #define FLUSH_STABLE 4 /* commit to stable storage */
73 #define FLUSH_LOWPRI 8 /* low priority background flush */
74 #define FLUSH_HIGHPRI 16 /* high priority memory reclaim flush */
76 #ifdef __KERNEL__
79 * NFSv3/v4 Access mode cache entry
81 struct nfs_access_entry {
82 unsigned long jiffies;
83 struct rpc_cred * cred;
84 int mask;
87 struct nfs4_state;
88 struct nfs_open_context {
89 atomic_t count;
90 struct dentry *dentry;
91 struct rpc_cred *cred;
92 struct nfs4_state *state;
93 fl_owner_t lockowner;
94 int mode;
95 int error;
97 struct list_head list;
98 wait_queue_head_t waitq;
102 * NFSv4 delegation
104 struct nfs_delegation;
107 * nfs fs inode data in memory
109 struct nfs_inode {
111 * The 64bit 'inode number'
113 __u64 fileid;
116 * NFS file handle
118 struct nfs_fh fh;
121 * Various flags
123 unsigned int flags;
126 * read_cache_jiffies is when we started read-caching this inode,
127 * and read_cache_mtime is the mtime of the inode at that time.
128 * attrtimeo is for how long the cached information is assumed
129 * to be valid. A successful attribute revalidation doubles
130 * attrtimeo (up to acregmax/acdirmax), a failure resets it to
131 * acregmin/acdirmin.
133 * We need to revalidate the cached attrs for this inode if
135 * jiffies - read_cache_jiffies > attrtimeo
137 * and invalidate any cached data/flush out any dirty pages if
138 * we find that
140 * mtime != read_cache_mtime
142 unsigned long readdir_timestamp;
143 unsigned long read_cache_jiffies;
144 unsigned long attrtimeo;
145 unsigned long attrtimeo_timestamp;
146 __u64 change_attr; /* v4 only */
148 /* "Generation counter" for the attribute cache. This is
149 * bumped whenever we update the metadata on the
150 * server.
152 unsigned long cache_change_attribute;
154 * Counter indicating the number of outstanding requests that
155 * will cause a file data update.
157 atomic_t data_updates;
159 struct nfs_access_entry cache_access;
162 * This is the cookie verifier used for NFSv3 readdir
163 * operations
165 __u32 cookieverf[2];
168 * This is the list of dirty unwritten pages.
170 spinlock_t req_lock;
171 struct list_head dirty;
172 struct list_head commit;
173 struct radix_tree_root nfs_page_tree;
175 unsigned int ndirty,
176 ncommit,
177 npages;
179 /* Open contexts for shared mmap writes */
180 struct list_head open_files;
182 wait_queue_head_t nfs_i_wait;
184 #ifdef CONFIG_NFS_V4
185 /* NFSv4 state */
186 struct list_head open_states;
187 struct nfs_delegation *delegation;
188 int delegation_state;
189 struct rw_semaphore rwsem;
190 #endif /* CONFIG_NFS_V4*/
192 struct inode vfs_inode;
196 * Legal inode flag values
198 #define NFS_INO_STALE 0x0001 /* possible stale inode */
199 #define NFS_INO_ADVISE_RDPLUS 0x0002 /* advise readdirplus */
200 #define NFS_INO_REVALIDATING 0x0004 /* revalidating attrs */
201 #define NFS_INO_INVALID_ATTR 0x0008 /* cached attrs are invalid */
202 #define NFS_INO_INVALID_DATA 0x0010 /* cached data is invalid */
203 #define NFS_INO_INVALID_ATIME 0x0020 /* cached atime is invalid */
205 static inline struct nfs_inode *NFS_I(struct inode *inode)
207 return container_of(inode, struct nfs_inode, vfs_inode);
209 #define NFS_SB(s) ((struct nfs_server *)(s->s_fs_info))
211 #define NFS_FH(inode) (&NFS_I(inode)->fh)
212 #define NFS_SERVER(inode) (NFS_SB(inode->i_sb))
213 #define NFS_CLIENT(inode) (NFS_SERVER(inode)->client)
214 #define NFS_PROTO(inode) (NFS_SERVER(inode)->rpc_ops)
215 #define NFS_ADDR(inode) (RPC_PEERADDR(NFS_CLIENT(inode)))
216 #define NFS_COOKIEVERF(inode) (NFS_I(inode)->cookieverf)
217 #define NFS_READTIME(inode) (NFS_I(inode)->read_cache_jiffies)
218 #define NFS_CHANGE_ATTR(inode) (NFS_I(inode)->change_attr)
219 #define NFS_ATTRTIMEO(inode) (NFS_I(inode)->attrtimeo)
220 #define NFS_MINATTRTIMEO(inode) \
221 (S_ISDIR(inode->i_mode)? NFS_SERVER(inode)->acdirmin \
222 : NFS_SERVER(inode)->acregmin)
223 #define NFS_MAXATTRTIMEO(inode) \
224 (S_ISDIR(inode->i_mode)? NFS_SERVER(inode)->acdirmax \
225 : NFS_SERVER(inode)->acregmax)
226 #define NFS_ATTRTIMEO_UPDATE(inode) (NFS_I(inode)->attrtimeo_timestamp)
228 #define NFS_FLAGS(inode) (NFS_I(inode)->flags)
229 #define NFS_REVALIDATING(inode) (NFS_FLAGS(inode) & NFS_INO_REVALIDATING)
230 #define NFS_STALE(inode) (NFS_FLAGS(inode) & NFS_INO_STALE)
232 #define NFS_FILEID(inode) (NFS_I(inode)->fileid)
234 static inline int nfs_caches_unstable(struct inode *inode)
236 return atomic_read(&NFS_I(inode)->data_updates) != 0;
239 static inline void NFS_CACHEINV(struct inode *inode)
241 if (!nfs_caches_unstable(inode))
242 NFS_FLAGS(inode) |= NFS_INO_INVALID_ATTR;
245 static inline int nfs_server_capable(struct inode *inode, int cap)
247 return NFS_SERVER(inode)->caps & cap;
250 static inline int NFS_USE_READDIRPLUS(struct inode *inode)
252 return NFS_FLAGS(inode) & NFS_INO_ADVISE_RDPLUS;
255 static inline
256 loff_t page_offset(struct page *page)
258 return ((loff_t)page->index) << PAGE_CACHE_SHIFT;
262 * nfs_save_change_attribute - Returns the inode attribute change cookie
263 * @inode - pointer to inode
264 * The "change attribute" is updated every time we finish an operation
265 * that will result in a metadata change on the server.
267 static inline long nfs_save_change_attribute(struct inode *inode)
269 return NFS_I(inode)->cache_change_attribute;
273 * nfs_verify_change_attribute - Detects NFS inode cache updates
274 * @inode - pointer to inode
275 * @chattr - previously saved change attribute
276 * Return "false" if metadata has been updated (or is in the process of
277 * being updated) since the change attribute was saved.
279 static inline int nfs_verify_change_attribute(struct inode *inode, unsigned long chattr)
281 return !nfs_caches_unstable(inode)
282 && chattr == NFS_I(inode)->cache_change_attribute;
286 * linux/fs/nfs/inode.c
288 extern void nfs_zap_caches(struct inode *);
289 extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *,
290 struct nfs_fattr *);
291 extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *);
292 extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *);
293 extern int nfs_permission(struct inode *, int, struct nameidata *);
294 extern int nfs_access_get_cached(struct inode *, struct rpc_cred *, struct nfs_access_entry *);
295 extern void nfs_access_add_cache(struct inode *, struct nfs_access_entry *);
296 extern int nfs_open(struct inode *, struct file *);
297 extern int nfs_release(struct inode *, struct file *);
298 extern int nfs_attribute_timeout(struct inode *inode);
299 extern int nfs_revalidate_inode(struct nfs_server *server, struct inode *inode);
300 extern int __nfs_revalidate_inode(struct nfs_server *, struct inode *);
301 extern int nfs_setattr(struct dentry *, struct iattr *);
302 extern void nfs_begin_attr_update(struct inode *);
303 extern void nfs_end_attr_update(struct inode *);
304 extern void nfs_begin_data_update(struct inode *);
305 extern void nfs_end_data_update(struct inode *);
306 extern void nfs_end_data_update_defer(struct inode *);
307 extern struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, struct rpc_cred *cred);
308 extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx);
309 extern void put_nfs_open_context(struct nfs_open_context *ctx);
310 extern void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx);
311 extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, int mode);
312 extern void nfs_file_clear_open_context(struct file *filp);
314 /* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */
315 extern u32 root_nfs_parse_addr(char *name); /*__init*/
318 * linux/fs/nfs/file.c
320 extern struct inode_operations nfs_file_inode_operations;
321 extern struct file_operations nfs_file_operations;
322 extern struct address_space_operations nfs_file_aops;
324 static inline struct rpc_cred *nfs_file_cred(struct file *file)
326 if (file != NULL) {
327 struct nfs_open_context *ctx;
329 ctx = (struct nfs_open_context*)file->private_data;
330 return ctx->cred;
332 return NULL;
336 * linux/fs/nfs/direct.c
338 extern ssize_t nfs_direct_IO(int, struct kiocb *, const struct iovec *, loff_t,
339 unsigned long);
340 extern ssize_t nfs_file_direct_read(struct kiocb *iocb, char __user *buf,
341 size_t count, loff_t pos);
342 extern ssize_t nfs_file_direct_write(struct kiocb *iocb, const char __user *buf,
343 size_t count, loff_t pos);
346 * linux/fs/nfs/dir.c
348 extern struct inode_operations nfs_dir_inode_operations;
349 extern struct file_operations nfs_dir_operations;
350 extern struct dentry_operations nfs_dentry_operations;
353 * linux/fs/nfs/symlink.c
355 extern struct inode_operations nfs_symlink_inode_operations;
358 * linux/fs/nfs/locks.c
360 extern int nfs_lock(struct file *, int, struct file_lock *);
363 * linux/fs/nfs/unlink.c
365 extern int nfs_async_unlink(struct dentry *);
366 extern void nfs_complete_unlink(struct dentry *);
369 * linux/fs/nfs/write.c
371 extern int nfs_writepage(struct page *page, struct writeback_control *wbc);
372 extern int nfs_writepages(struct address_space *, struct writeback_control *);
373 extern int nfs_flush_incompatible(struct file *file, struct page *page);
374 extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int);
375 extern void nfs_writeback_done(struct rpc_task *task);
377 #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
378 extern void nfs_commit_done(struct rpc_task *);
379 #endif
382 * Try to write back everything synchronously (but check the
383 * return value!)
385 extern int nfs_sync_inode(struct inode *, unsigned long, unsigned int, int);
386 extern int nfs_flush_inode(struct inode *, unsigned long, unsigned int, int);
387 extern int nfs_flush_list(struct list_head *, int, int);
388 #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
389 extern int nfs_commit_inode(struct inode *, unsigned long, unsigned int, int);
390 extern int nfs_commit_list(struct list_head *, int);
391 #else
392 static inline int
393 nfs_commit_inode(struct inode *inode, unsigned long idx_start, unsigned int npages, int how)
395 return 0;
397 #endif
399 static inline int
400 nfs_have_writebacks(struct inode *inode)
402 return NFS_I(inode)->npages != 0;
405 static inline int
406 nfs_wb_all(struct inode *inode)
408 int error = nfs_sync_inode(inode, 0, 0, FLUSH_WAIT);
409 return (error < 0) ? error : 0;
413 * Write back all requests on one page - we do this before reading it.
415 static inline int nfs_wb_page_priority(struct inode *inode, struct page* page, int how)
417 int error = nfs_sync_inode(inode, page->index, 1,
418 how | FLUSH_WAIT | FLUSH_STABLE);
419 return (error < 0) ? error : 0;
422 static inline int nfs_wb_page(struct inode *inode, struct page* page)
424 return nfs_wb_page_priority(inode, page, 0);
427 /* Hack for future NFS swap support */
428 #ifndef IS_SWAPFILE
429 # define IS_SWAPFILE(inode) (0)
430 #endif
433 * linux/fs/nfs/read.c
435 extern int nfs_readpage(struct file *, struct page *);
436 extern int nfs_readpages(struct file *, struct address_space *,
437 struct list_head *, unsigned);
438 extern int nfs_pagein_list(struct list_head *, int);
439 extern void nfs_readpage_result(struct rpc_task *);
442 * linux/fs/mount_clnt.c
443 * (Used only by nfsroot module)
445 extern int nfsroot_mount(struct sockaddr_in *, char *, struct nfs_fh *,
446 int, int);
449 * inline functions
452 static inline loff_t
453 nfs_size_to_loff_t(__u64 size)
455 loff_t maxsz = (((loff_t) ULONG_MAX) << PAGE_CACHE_SHIFT) + PAGE_CACHE_SIZE - 1;
456 if (size > maxsz)
457 return maxsz;
458 return (loff_t) size;
461 static inline ino_t
462 nfs_fileid_to_ino_t(u64 fileid)
464 ino_t ino = (ino_t) fileid;
465 if (sizeof(ino_t) < sizeof(u64))
466 ino ^= fileid >> (sizeof(u64)-sizeof(ino_t)) * 8;
467 return ino;
470 /* NFS root */
472 extern void * nfs_root_data(void);
474 #define nfs_wait_event(clnt, wq, condition) \
475 ({ \
476 int __retval = 0; \
477 if (clnt->cl_intr) { \
478 sigset_t oldmask; \
479 rpc_clnt_sigmask(clnt, &oldmask); \
480 __retval = wait_event_interruptible(wq, condition); \
481 rpc_clnt_sigunmask(clnt, &oldmask); \
482 } else \
483 wait_event(wq, condition); \
484 __retval; \
487 #define NFS_JUKEBOX_RETRY_TIME (5 * HZ)
489 #ifdef CONFIG_NFS_V4
491 struct idmap;
494 * In a seqid-mutating op, this macro controls which error return
495 * values trigger incrementation of the seqid.
497 * from rfc 3010:
498 * The client MUST monotonically increment the sequence number for the
499 * CLOSE, LOCK, LOCKU, OPEN, OPEN_CONFIRM, and OPEN_DOWNGRADE
500 * operations. This is true even in the event that the previous
501 * operation that used the sequence number received an error. The only
502 * exception to this rule is if the previous operation received one of
503 * the following errors: NFSERR_STALE_CLIENTID, NFSERR_STALE_STATEID,
504 * NFSERR_BAD_STATEID, NFSERR_BAD_SEQID, NFSERR_BADXDR,
505 * NFSERR_RESOURCE, NFSERR_NOFILEHANDLE.
508 #define seqid_mutating_err(err) \
509 (((err) != NFSERR_STALE_CLIENTID) && \
510 ((err) != NFSERR_STALE_STATEID) && \
511 ((err) != NFSERR_BAD_STATEID) && \
512 ((err) != NFSERR_BAD_SEQID) && \
513 ((err) != NFSERR_BAD_XDR) && \
514 ((err) != NFSERR_RESOURCE) && \
515 ((err) != NFSERR_NOFILEHANDLE))
517 enum nfs4_client_state {
518 NFS4CLNT_OK = 0,
522 * The nfs4_client identifies our client state to the server.
524 struct nfs4_client {
525 struct list_head cl_servers; /* Global list of servers */
526 struct in_addr cl_addr; /* Server identifier */
527 u64 cl_clientid; /* constant */
528 nfs4_verifier cl_confirm;
529 unsigned long cl_state;
531 u32 cl_lockowner_id;
534 * The following rwsem ensures exclusive access to the server
535 * while we recover the state following a lease expiration.
537 struct rw_semaphore cl_sem;
539 struct list_head cl_delegations;
540 struct list_head cl_state_owners;
541 struct list_head cl_unused;
542 int cl_nunused;
543 spinlock_t cl_lock;
544 atomic_t cl_count;
546 struct rpc_clnt * cl_rpcclient;
547 struct rpc_cred * cl_cred;
549 struct list_head cl_superblocks; /* List of nfs_server structs */
551 unsigned long cl_lease_time;
552 unsigned long cl_last_renewal;
553 struct work_struct cl_renewd;
554 struct work_struct cl_recoverd;
556 wait_queue_head_t cl_waitq;
557 struct rpc_wait_queue cl_rpcwaitq;
559 /* idmapper */
560 struct idmap * cl_idmap;
562 /* Our own IP address, as a null-terminated string.
563 * This is used to generate the clientid, and the callback address.
565 char cl_ipaddr[16];
569 * NFS4 state_owners and lock_owners are simply labels for ordered
570 * sequences of RPC calls. Their sole purpose is to provide once-only
571 * semantics by allowing the server to identify replayed requests.
573 * The ->so_sema is held during all state_owner seqid-mutating operations:
574 * OPEN, OPEN_DOWNGRADE, and CLOSE. Its purpose is to properly serialize
575 * so_seqid.
577 struct nfs4_state_owner {
578 struct list_head so_list; /* per-clientid list of state_owners */
579 struct nfs4_client *so_client;
580 u32 so_id; /* 32-bit identifier, unique */
581 struct semaphore so_sema;
582 u32 so_seqid; /* protected by so_sema */
583 atomic_t so_count;
585 struct rpc_cred *so_cred; /* Associated cred */
586 struct list_head so_states;
587 struct list_head so_delegations;
591 * struct nfs4_state maintains the client-side state for a given
592 * (state_owner,inode) tuple (OPEN) or state_owner (LOCK).
594 * OPEN:
595 * In order to know when to OPEN_DOWNGRADE or CLOSE the state on the server,
596 * we need to know how many files are open for reading or writing on a
597 * given inode. This information too is stored here.
599 * LOCK: one nfs4_state (LOCK) to hold the lock stateid nfs4_state(OPEN)
602 struct nfs4_lock_state {
603 struct list_head ls_locks; /* Other lock stateids */
604 fl_owner_t ls_owner; /* POSIX lock owner */
605 #define NFS_LOCK_INITIALIZED 1
606 int ls_flags;
607 u32 ls_seqid;
608 u32 ls_id;
609 nfs4_stateid ls_stateid;
610 atomic_t ls_count;
613 /* bits for nfs4_state->flags */
614 enum {
615 LK_STATE_IN_USE,
616 NFS_DELEGATED_STATE,
619 struct nfs4_state {
620 struct list_head open_states; /* List of states for the same state_owner */
621 struct list_head inode_states; /* List of states for the same inode */
622 struct list_head lock_states; /* List of subservient lock stateids */
624 struct nfs4_state_owner *owner; /* Pointer to the open owner */
625 struct inode *inode; /* Pointer to the inode */
627 unsigned long flags; /* Do we hold any locks? */
628 struct semaphore lock_sema; /* Serializes file locking operations */
629 rwlock_t state_lock; /* Protects the lock_states list */
631 nfs4_stateid stateid;
633 unsigned int nreaders;
634 unsigned int nwriters;
635 int state; /* State on the server (R,W, or RW) */
636 atomic_t count;
640 struct nfs4_exception {
641 long timeout;
642 int retry;
645 extern struct dentry_operations nfs4_dentry_operations;
646 extern struct inode_operations nfs4_dir_inode_operations;
648 /* nfs4proc.c */
649 extern int nfs4_proc_setclientid(struct nfs4_client *, u32, unsigned short);
650 extern int nfs4_proc_setclientid_confirm(struct nfs4_client *);
651 extern int nfs4_open_reclaim(struct nfs4_state_owner *, struct nfs4_state *);
652 extern int nfs4_proc_async_renew(struct nfs4_client *);
653 extern int nfs4_proc_renew(struct nfs4_client *);
654 extern int nfs4_do_close(struct inode *, struct nfs4_state *);
655 extern int nfs4_do_downgrade(struct inode *inode, struct nfs4_state *state, mode_t mode);
656 extern int nfs4_wait_clnt_recover(struct rpc_clnt *, struct nfs4_client *);
657 extern struct inode *nfs4_atomic_open(struct inode *, struct dentry *, struct nameidata *);
658 extern int nfs4_open_revalidate(struct inode *, struct dentry *, int);
659 extern int nfs4_handle_exception(struct nfs_server *, int, struct nfs4_exception *);
660 extern int nfs4_lock_reclaim(struct nfs4_state *state, struct file_lock *request);
662 /* nfs4renewd.c */
663 extern void nfs4_schedule_state_renewal(struct nfs4_client *);
664 extern void nfs4_renewd_prepare_shutdown(struct nfs_server *);
665 extern void nfs4_kill_renewd(struct nfs4_client *);
667 /* nfs4state.c */
668 extern void init_nfsv4_state(struct nfs_server *);
669 extern void destroy_nfsv4_state(struct nfs_server *);
670 extern struct nfs4_client *nfs4_get_client(struct in_addr *);
671 extern void nfs4_put_client(struct nfs4_client *clp);
672 extern int nfs4_init_client(struct nfs4_client *clp);
673 extern struct nfs4_client *nfs4_find_client(struct in_addr *);
674 extern u32 nfs4_alloc_lockowner_id(struct nfs4_client *);
676 extern struct nfs4_state_owner * nfs4_get_state_owner(struct nfs_server *, struct rpc_cred *);
677 extern void nfs4_put_state_owner(struct nfs4_state_owner *);
678 extern struct nfs4_state * nfs4_get_open_state(struct inode *, struct nfs4_state_owner *);
679 extern void nfs4_put_open_state(struct nfs4_state *);
680 extern void nfs4_close_state(struct nfs4_state *, mode_t);
681 extern struct nfs4_state *nfs4_find_state(struct inode *, struct rpc_cred *, mode_t mode);
682 extern void nfs4_increment_seqid(int status, struct nfs4_state_owner *sp);
683 extern void nfs4_schedule_state_recovery(struct nfs4_client *);
684 extern struct nfs4_lock_state *nfs4_find_lock_state(struct nfs4_state *state, fl_owner_t);
685 extern struct nfs4_lock_state *nfs4_get_lock_state(struct nfs4_state *state, fl_owner_t);
686 extern void nfs4_put_lock_state(struct nfs4_lock_state *state);
687 extern void nfs4_increment_lock_seqid(int status, struct nfs4_lock_state *ls);
688 extern void nfs4_notify_setlk(struct nfs4_state *, struct file_lock *, struct nfs4_lock_state *);
689 extern void nfs4_notify_unlck(struct nfs4_state *, struct file_lock *, struct nfs4_lock_state *);
690 extern void nfs4_copy_stateid(nfs4_stateid *, struct nfs4_state *, fl_owner_t);
694 struct nfs4_mount_data;
695 #else
696 #define init_nfsv4_state(server) do { } while (0)
697 #define destroy_nfsv4_state(server) do { } while (0)
698 #define nfs4_put_state_owner(inode, owner) do { } while (0)
699 #define nfs4_put_open_state(state) do { } while (0)
700 #define nfs4_close_state(a, b) do { } while (0)
701 #define nfs4_renewd_prepare_shutdown(server) do { } while (0)
702 #endif
704 #endif /* __KERNEL__ */
707 * NFS debug flags
709 #define NFSDBG_VFS 0x0001
710 #define NFSDBG_DIRCACHE 0x0002
711 #define NFSDBG_LOOKUPCACHE 0x0004
712 #define NFSDBG_PAGECACHE 0x0008
713 #define NFSDBG_PROC 0x0010
714 #define NFSDBG_XDR 0x0020
715 #define NFSDBG_FILE 0x0040
716 #define NFSDBG_ROOT 0x0080
717 #define NFSDBG_CALLBACK 0x0100
718 #define NFSDBG_ALL 0xFFFF
720 #ifdef __KERNEL__
721 # undef ifdebug
722 # ifdef NFS_DEBUG
723 # define ifdebug(fac) if (unlikely(nfs_debug & NFSDBG_##fac))
724 # else
725 # define ifdebug(fac) if (0)
726 # endif
727 #endif /* __KERNEL */
729 #endif