1#ifndef _NFS_FS_I
2#define _NFS_FS_I
3
4#include <asm/types.h>
5#include <linux/list.h>
6#include <linux/nfs.h>
7
8/*
9 * nfs fs inode data in memory
10 */
11struct nfs_inode_info {
12	/*
13	 * The 64bit 'inode number'
14	 */
15	__u64 fileid;
16
17	/*
18	 * NFS file handle
19	 */
20	struct nfs_fh		fh;
21
22	/*
23	 * Various flags
24	 */
25	unsigned short		flags;
26
27	/*
28	 * read_cache_jiffies is when we started read-caching this inode,
29	 * and read_cache_mtime is the mtime of the inode at that time.
30	 * attrtimeo is for how long the cached information is assumed
31	 * to be valid. A successful attribute revalidation doubles
32	 * attrtimeo (up to acregmax/acdirmax), a failure resets it to
33	 * acregmin/acdirmin.
34	 *
35	 * We need to revalidate the cached attrs for this inode if
36	 *
37	 *	jiffies - read_cache_jiffies > attrtimeo
38	 *
39	 * and invalidate any cached data/flush out any dirty pages if
40	 * we find that
41	 *
42	 *	mtime != read_cache_mtime
43	 */
44	unsigned long		read_cache_jiffies;
45	__u64			read_cache_ctime;
46	__u64			read_cache_mtime;
47	__u64			read_cache_isize;
48	unsigned long		attrtimeo;
49	unsigned long		attrtimeo_timestamp;
50
51	/*
52	 * Timestamp that dates the change made to read_cache_mtime.
53	 * This is of use for dentry revalidation
54	 */
55	unsigned long		cache_mtime_jiffies;
56
57	/*
58	 * This is the cookie verifier used for NFSv3 readdir
59	 * operations
60	 */
61	__u32			cookieverf[2];
62
63	/*
64	 * This is the list of dirty unwritten pages.
65	 */
66	struct list_head	read;
67	struct list_head	dirty;
68	struct list_head	commit;
69	struct list_head	writeback;
70
71	unsigned int		nread,
72				ndirty,
73				ncommit,
74				npages;
75
76	/* Credentials for shared mmap */
77	struct rpc_cred		*mm_cred;
78};
79
80/*
81 * Legal inode flag values
82 */
83#define NFS_INO_STALE		0x0001		/* possible stale inode */
84#define NFS_INO_ADVISE_RDPLUS   0x0002          /* advise readdirplus */
85#define NFS_INO_REVALIDATING	0x0004		/* revalidating attrs */
86#define NFS_IS_SNAPSHOT		0x0010		/* a snapshot file */
87#define NFS_INO_FLUSH		0x0020		/* inode is due for flushing */
88
89/*
90 * NFS lock info
91 */
92struct nfs_lock_info {
93	u32		state;
94	u32		flags;
95	struct nlm_host	*host;
96};
97
98/*
99 * Lock flag values
100 */
101#define NFS_LCK_GRANTED		0x0001		/* lock has been granted */
102#define NFS_LCK_RECLAIM		0x0002		/* lock marked for reclaiming */
103
104#endif
105