Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 69300
b: refs/heads/master
c: 2a3f5fd
h: refs/heads/master
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Oct 9, 2007
1 parent 7fb796a commit 82e348b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 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: 40d24704091c8a29a4c99d25670f1996749aea6f
refs/heads/master: 2a3f5fd45938bd86ce8faf4cb26be4f7e9ae2941
35 changes: 17 additions & 18 deletions trunk/fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,7 @@ static int nfs_check_inode_attributes(struct inode *inode, struct nfs_fattr *fat
{
struct nfs_inode *nfsi = NFS_I(inode);
loff_t cur_size, new_isize;
unsigned long invalid = 0;


/* Has the inode gone and changed behind our back? */
Expand All @@ -803,29 +804,36 @@ static int nfs_check_inode_attributes(struct inode *inode, struct nfs_fattr *fat

if ((fattr->valid & NFS_ATTR_FATTR_V4) != 0 &&
nfsi->change_attr != fattr->change_attr)
nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_REVAL_PAGECACHE;
invalid |= NFS_INO_INVALID_ATTR|NFS_INO_REVAL_PAGECACHE;

/* Verify a few of the more important attributes */
if (!timespec_equal(&inode->i_mtime, &fattr->mtime))
nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_REVAL_PAGECACHE;
invalid |= NFS_INO_INVALID_ATTR|NFS_INO_REVAL_PAGECACHE;

cur_size = i_size_read(inode);
new_isize = nfs_size_to_loff_t(fattr->size);
if (cur_size != new_isize && nfsi->npages == 0)
nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_REVAL_PAGECACHE;
invalid |= NFS_INO_INVALID_ATTR|NFS_INO_REVAL_PAGECACHE;

/* Have any file permissions changed? */
if ((inode->i_mode & S_IALLUGO) != (fattr->mode & S_IALLUGO)
|| inode->i_uid != fattr->uid
|| inode->i_gid != fattr->gid)
nfsi->cache_validity |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS | NFS_INO_INVALID_ACL;
invalid |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS | NFS_INO_INVALID_ACL;

/* Has the link count changed? */
if (inode->i_nlink != fattr->nlink)
nfsi->cache_validity |= NFS_INO_INVALID_ATTR;
invalid |= NFS_INO_INVALID_ATTR;

if (!timespec_equal(&inode->i_atime, &fattr->atime))
nfsi->cache_validity |= NFS_INO_INVALID_ATIME;
invalid |= NFS_INO_INVALID_ATIME;

if (invalid != 0)
nfsi->cache_validity |= invalid;
else
nfsi->cache_validity &= ~(NFS_INO_INVALID_ATTR
| NFS_INO_INVALID_ATIME
| NFS_INO_REVAL_PAGECACHE);

nfsi->read_cache_jiffies = fattr->time_start;
return 0;
Expand Down Expand Up @@ -876,21 +884,12 @@ int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr)
{
struct nfs_inode *nfsi = NFS_I(inode);

if (fattr->valid & NFS_ATTR_FATTR) {
if (S_ISDIR(inode->i_mode)) {
spin_lock(&inode->i_lock);
nfsi->cache_validity |= NFS_INO_INVALID_DATA;
spin_unlock(&inode->i_lock);
}
return nfs_refresh_inode(inode, fattr);
}

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

/**
Expand Down Expand Up @@ -938,7 +937,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
struct nfs_server *server;
struct nfs_inode *nfsi = NFS_I(inode);
loff_t cur_isize, new_isize;
unsigned int invalid = 0;
unsigned long invalid = 0;
unsigned long now = jiffies;

dfprintk(VFS, "NFS: %s(%s/%ld ct=%d info=0x%x)\n",
Expand Down

0 comments on commit 82e348b

Please sign in to comment.