Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 115379
b: refs/heads/master
c: 870a5be
h: refs/heads/master
i:
  115377: d6ba1ee
  115375: 02e9cf8
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Oct 7, 2008
1 parent 9c01356 commit 000bc2e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 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: 7973c1f15a0687f47ed70e591e4642d6fc4334d0
refs/heads/master: 870a5be8b92151332da65021b7b21104e9c1de07
21 changes: 14 additions & 7 deletions trunk/fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,15 @@ static int nfs_check_inode_attributes(struct inode *inode, struct nfs_fattr *fat
return 0;
}

static int nfs_refresh_inode_locked(struct inode *inode, struct nfs_fattr *fattr)
{
struct nfs_inode *nfsi = NFS_I(inode);

if (time_after(fattr->time_start, nfsi->last_updated))
return nfs_update_inode(inode, fattr);
return nfs_check_inode_attributes(inode, fattr);
}

/**
* nfs_refresh_inode - try to update the inode attribute cache
* @inode - pointer to inode
Expand All @@ -960,17 +969,12 @@ static int nfs_check_inode_attributes(struct inode *inode, struct nfs_fattr *fat
*/
int nfs_refresh_inode(struct inode *inode, struct nfs_fattr *fattr)
{
struct nfs_inode *nfsi = NFS_I(inode);
int status;

if ((fattr->valid & NFS_ATTR_FATTR) == 0)
return 0;
spin_lock(&inode->i_lock);
if (time_after(fattr->time_start, nfsi->last_updated))
status = nfs_update_inode(inode, fattr);
else
status = nfs_check_inode_attributes(inode, fattr);

status = nfs_refresh_inode_locked(inode, fattr);
spin_unlock(&inode->i_lock);
return status;
}
Expand All @@ -992,13 +996,16 @@ int nfs_refresh_inode(struct inode *inode, struct nfs_fattr *fattr)
int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr)
{
struct nfs_inode *nfsi = NFS_I(inode);
int status = 0;

spin_lock(&inode->i_lock);
nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_REVAL_PAGECACHE;
if (S_ISDIR(inode->i_mode))
nfsi->cache_validity |= NFS_INO_INVALID_DATA;
if ((fattr->valid & NFS_ATTR_FATTR) != 0)
status = nfs_refresh_inode_locked(inode, fattr);
spin_unlock(&inode->i_lock);
return nfs_refresh_inode(inode, fattr);
return status;
}

/**
Expand Down

0 comments on commit 000bc2e

Please sign in to comment.