Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 69255
b: refs/heads/master
c: 17cadc9
h: refs/heads/master
i:
  69253: 17c79c8
  69251: c0c61c8
  69247: 3b9923c
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Oct 9, 2007
1 parent d89ebfd commit a93bc61
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 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: e323ea46d95d7f8c789effd1194dfc120284dbbd
refs/heads/master: 17cadc95372e28024be0874e67329c1862912c5d
11 changes: 3 additions & 8 deletions trunk/fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -791,24 +791,18 @@ void nfs_end_data_update(struct inode *inode)
static void nfs_wcc_update_inode(struct inode *inode, struct nfs_fattr *fattr)
{
struct nfs_inode *nfsi = NFS_I(inode);
unsigned long now = jiffies;

/* If we have atomic WCC data, we may update some attributes */
if ((fattr->valid & NFS_ATTR_WCC) != 0) {
if (timespec_equal(&inode->i_ctime, &fattr->pre_ctime)) {
if (timespec_equal(&inode->i_ctime, &fattr->pre_ctime))
memcpy(&inode->i_ctime, &fattr->ctime, sizeof(inode->i_ctime));
nfsi->cache_change_attribute = now;
}
if (timespec_equal(&inode->i_mtime, &fattr->pre_mtime)) {
memcpy(&inode->i_mtime, &fattr->mtime, sizeof(inode->i_mtime));
if (S_ISDIR(inode->i_mode))
nfsi->cache_validity |= NFS_INO_INVALID_DATA;
nfsi->cache_change_attribute = now;
}
if (inode->i_size == fattr->pre_size && nfsi->npages == 0) {
if (inode->i_size == fattr->pre_size && nfsi->npages == 0)
inode->i_size = fattr->size;
nfsi->cache_change_attribute = now;
}
}
}

Expand Down Expand Up @@ -919,6 +913,7 @@ int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr)
if (unlikely((fattr->valid & NFS_ATTR_FATTR) == 0)) {
spin_lock(&inode->i_lock);
nfsi->cache_validity |= NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ATTR|NFS_INO_REVAL_PAGECACHE;
nfsi->cache_change_attribute = jiffies;
spin_unlock(&inode->i_lock);
goto out;
}
Expand Down
7 changes: 5 additions & 2 deletions trunk/fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,12 @@ static void update_changeattr(struct inode *dir, struct nfs4_change_info *cinfo)
struct nfs_inode *nfsi = NFS_I(dir);

spin_lock(&dir->i_lock);
nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_REVAL_PAGECACHE|NFS_INO_INVALID_DATA;
if (cinfo->before == nfsi->change_attr && cinfo->atomic)
if (cinfo->after != nfsi->change_attr) {
nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_REVAL_PAGECACHE|NFS_INO_INVALID_DATA;
if (!cinfo->atomic || cinfo->before != nfsi->change_attr)
nfsi->cache_change_attribute = jiffies;
nfsi->change_attr = cinfo->after;
}
spin_unlock(&dir->i_lock);
}

Expand Down
4 changes: 3 additions & 1 deletion trunk/include/linux/nfs_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,10 @@ static inline void nfs_mark_for_revalidate(struct inode *inode)

spin_lock(&inode->i_lock);
nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ACCESS;
if (S_ISDIR(inode->i_mode))
if (S_ISDIR(inode->i_mode)) {
nfsi->cache_validity |= NFS_INO_REVAL_PAGECACHE|NFS_INO_INVALID_DATA;
nfsi->cache_change_attribute = jiffies;
}
spin_unlock(&inode->i_lock);
}

Expand Down

0 comments on commit a93bc61

Please sign in to comment.