diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2005-10-27 22:12:39 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2005-10-27 22:12:39 -0400 |
commit | decf491f3076190262d4c649bed877650623903a (patch) | |
tree | 8f67577349fe451b0267b68435db1578ec1273a4 /include/linux | |
parent | 33801147a8fda6b04d7e9afe1d42f1c01d3d6837 (diff) |
NFS: Don't let nfs_end_data_update() clobber attribute update information
Since we almost always call nfs_end_data_update() after we called
nfs_refresh_inode(), we now end up marking the inode metadata
as needing revalidation immediately after having updated it.
This patch rearranges things so that we mark the inode as needing
revalidation _before_ we call nfs_refresh_inode() on those operations
that need it.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/nfs_fs.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index faeaad666ca8..325fe7ae49bb 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -241,13 +241,17 @@ static inline int nfs_caches_unstable(struct inode *inode) | |||
241 | return atomic_read(&NFS_I(inode)->data_updates) != 0; | 241 | return atomic_read(&NFS_I(inode)->data_updates) != 0; |
242 | } | 242 | } |
243 | 243 | ||
244 | static inline void nfs_mark_for_revalidate(struct inode *inode) | ||
245 | { | ||
246 | spin_lock(&inode->i_lock); | ||
247 | NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS; | ||
248 | spin_unlock(&inode->i_lock); | ||
249 | } | ||
250 | |||
244 | static inline void NFS_CACHEINV(struct inode *inode) | 251 | static inline void NFS_CACHEINV(struct inode *inode) |
245 | { | 252 | { |
246 | if (!nfs_caches_unstable(inode)) { | 253 | if (!nfs_caches_unstable(inode)) |
247 | spin_lock(&inode->i_lock); | 254 | nfs_mark_for_revalidate(inode); |
248 | NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS; | ||
249 | spin_unlock(&inode->i_lock); | ||
250 | } | ||
251 | } | 255 | } |
252 | 256 | ||
253 | static inline int nfs_server_capable(struct inode *inode, int cap) | 257 | static inline int nfs_server_capable(struct inode *inode, int cap) |
@@ -291,6 +295,7 @@ extern void nfs_zap_caches(struct inode *); | |||
291 | extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *, | 295 | extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *, |
292 | struct nfs_fattr *); | 296 | struct nfs_fattr *); |
293 | extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *); | 297 | extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *); |
298 | extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr); | ||
294 | extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); | 299 | extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); |
295 | extern int nfs_permission(struct inode *, int, struct nameidata *); | 300 | extern int nfs_permission(struct inode *, int, struct nameidata *); |
296 | extern int nfs_access_get_cached(struct inode *, struct rpc_cred *, struct nfs_access_entry *); | 301 | extern int nfs_access_get_cached(struct inode *, struct rpc_cred *, struct nfs_access_entry *); |