Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 14699
b: refs/heads/master
c: b37b03b
h: refs/heads/master
i:
  14697: da4a0a3
  14695: 2c433c8
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Nov 25, 2005
1 parent 94a1239 commit a7bfab9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ff6040667ad5a21fa1090e02941ecefb94ebe32c
refs/heads/master: b37b03b7051493c9f9a6b336c9c0f81334885b7d
26 changes: 12 additions & 14 deletions trunk/fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -643,14 +643,11 @@ static int nfs_show_options(struct seq_file *m, struct vfsmount *mnt)
/*
* Invalidate the local caches
*/
void
nfs_zap_caches(struct inode *inode)
static void nfs_zap_caches_locked(struct inode *inode)
{
struct nfs_inode *nfsi = NFS_I(inode);
int mode = inode->i_mode;

spin_lock(&inode->i_lock);

NFS_ATTRTIMEO(inode) = NFS_MINATTRTIMEO(inode);
NFS_ATTRTIMEO_UPDATE(inode) = jiffies;

Expand All @@ -659,7 +656,12 @@ nfs_zap_caches(struct inode *inode)
nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL|NFS_INO_REVAL_PAGECACHE;
else
nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL|NFS_INO_REVAL_PAGECACHE;
}

void nfs_zap_caches(struct inode *inode)
{
spin_lock(&inode->i_lock);
nfs_zap_caches_locked(inode);
spin_unlock(&inode->i_lock);
}

Expand All @@ -676,16 +678,13 @@ static void nfs_zap_acl_cache(struct inode *inode)
}

/*
* Invalidate, but do not unhash, the inode
* Invalidate, but do not unhash, the inode.
* NB: must be called with inode->i_lock held!
*/
static void
nfs_invalidate_inode(struct inode *inode)
static void nfs_invalidate_inode(struct inode *inode)
{
umode_t save_mode = inode->i_mode;

make_bad_inode(inode);
inode->i_mode = save_mode;
nfs_zap_caches(inode);
set_bit(NFS_INO_STALE, &NFS_FLAGS(inode));
nfs_zap_caches_locked(inode);
}

struct nfs_find_desc {
Expand Down Expand Up @@ -1528,14 +1527,13 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr, unsign
printk(KERN_DEBUG "%s: inode %ld mode changed, %07o to %07o\n",
__FUNCTION__, inode->i_ino, inode->i_mode, fattr->mode);
#endif
out_err:
/*
* No need to worry about unhashing the dentry, as the
* lookup validation will know that the inode is bad.
* (But we fall through to invalidate the caches.)
*/
nfs_invalidate_inode(inode);
out_err:
set_bit(NFS_INO_STALE, &NFS_FLAGS(inode));
return -ESTALE;
}

Expand Down

0 comments on commit a7bfab9

Please sign in to comment.