aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/nfs_fs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/nfs_fs.h')
-rw-r--r--include/linux/nfs_fs.h41
1 files changed, 23 insertions, 18 deletions
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 7d78a783c64a..9a6047ff1b25 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -112,7 +112,8 @@ struct nfs_inode {
112 /* 112 /*
113 * Various flags 113 * Various flags
114 */ 114 */
115 unsigned int flags; 115 unsigned long flags; /* atomic bit ops */
116 unsigned long cache_validity; /* bit mask */
116 117
117 /* 118 /*
118 * read_cache_jiffies is when we started read-caching this inode, 119 * read_cache_jiffies is when we started read-caching this inode,
@@ -174,8 +175,6 @@ struct nfs_inode {
174 /* Open contexts for shared mmap writes */ 175 /* Open contexts for shared mmap writes */
175 struct list_head open_files; 176 struct list_head open_files;
176 177
177 wait_queue_head_t nfs_i_wait;
178
179#ifdef CONFIG_NFS_V4 178#ifdef CONFIG_NFS_V4
180 struct nfs4_cached_acl *nfs4_acl; 179 struct nfs4_cached_acl *nfs4_acl;
181 /* NFSv4 state */ 180 /* NFSv4 state */
@@ -188,17 +187,21 @@ struct nfs_inode {
188}; 187};
189 188
190/* 189/*
191 * Legal inode flag values 190 * Cache validity bit flags
192 */ 191 */
193#define NFS_INO_STALE 0x0001 /* possible stale inode */ 192#define NFS_INO_INVALID_ATTR 0x0001 /* cached attrs are invalid */
194#define NFS_INO_ADVISE_RDPLUS 0x0002 /* advise readdirplus */ 193#define NFS_INO_INVALID_DATA 0x0002 /* cached data is invalid */
195#define NFS_INO_REVALIDATING 0x0004 /* revalidating attrs */ 194#define NFS_INO_INVALID_ATIME 0x0004 /* cached atime is invalid */
196#define NFS_INO_INVALID_ATTR 0x0008 /* cached attrs are invalid */ 195#define NFS_INO_INVALID_ACCESS 0x0008 /* cached access cred invalid */
197#define NFS_INO_INVALID_DATA 0x0010 /* cached data is invalid */ 196#define NFS_INO_INVALID_ACL 0x0010 /* cached acls are invalid */
198#define NFS_INO_INVALID_ATIME 0x0020 /* cached atime is invalid */ 197#define NFS_INO_REVAL_PAGECACHE 0x0020 /* must revalidate pagecache */
199#define NFS_INO_INVALID_ACCESS 0x0040 /* cached access cred invalid */ 198
200#define NFS_INO_INVALID_ACL 0x0080 /* cached acls are invalid */ 199/*
201#define NFS_INO_REVAL_PAGECACHE 0x1000 /* must revalidate pagecache */ 200 * Bit offsets in flags field
201 */
202#define NFS_INO_REVALIDATING (0) /* revalidating attrs */
203#define NFS_INO_ADVISE_RDPLUS (1) /* advise readdirplus */
204#define NFS_INO_STALE (2) /* possible stale inode */
202 205
203static inline struct nfs_inode *NFS_I(struct inode *inode) 206static inline struct nfs_inode *NFS_I(struct inode *inode)
204{ 207{
@@ -224,8 +227,7 @@ static inline struct nfs_inode *NFS_I(struct inode *inode)
224#define NFS_ATTRTIMEO_UPDATE(inode) (NFS_I(inode)->attrtimeo_timestamp) 227#define NFS_ATTRTIMEO_UPDATE(inode) (NFS_I(inode)->attrtimeo_timestamp)
225 228
226#define NFS_FLAGS(inode) (NFS_I(inode)->flags) 229#define NFS_FLAGS(inode) (NFS_I(inode)->flags)
227#define NFS_REVALIDATING(inode) (NFS_FLAGS(inode) & NFS_INO_REVALIDATING) 230#define NFS_STALE(inode) (test_bit(NFS_INO_STALE, &NFS_FLAGS(inode)))
228#define NFS_STALE(inode) (NFS_FLAGS(inode) & NFS_INO_STALE)
229 231
230#define NFS_FILEID(inode) (NFS_I(inode)->fileid) 232#define NFS_FILEID(inode) (NFS_I(inode)->fileid)
231 233
@@ -236,8 +238,11 @@ static inline int nfs_caches_unstable(struct inode *inode)
236 238
237static inline void NFS_CACHEINV(struct inode *inode) 239static inline void NFS_CACHEINV(struct inode *inode)
238{ 240{
239 if (!nfs_caches_unstable(inode)) 241 if (!nfs_caches_unstable(inode)) {
240 NFS_FLAGS(inode) |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS; 242 spin_lock(&inode->i_lock);
243 NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS;
244 spin_unlock(&inode->i_lock);
245 }
241} 246}
242 247
243static inline int nfs_server_capable(struct inode *inode, int cap) 248static inline int nfs_server_capable(struct inode *inode, int cap)
@@ -247,7 +252,7 @@ static inline int nfs_server_capable(struct inode *inode, int cap)
247 252
248static inline int NFS_USE_READDIRPLUS(struct inode *inode) 253static inline int NFS_USE_READDIRPLUS(struct inode *inode)
249{ 254{
250 return NFS_FLAGS(inode) & NFS_INO_ADVISE_RDPLUS; 255 return test_bit(NFS_INO_ADVISE_RDPLUS, &NFS_FLAGS(inode));
251} 256}
252 257
253/** 258/**