aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r--fs/nfs/dir.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index b38a57e78a63..5732e13cd0da 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -189,7 +189,7 @@ int nfs_readdir_filler(nfs_readdir_descriptor_t *desc, struct page *page)
189 goto error; 189 goto error;
190 } 190 }
191 SetPageUptodate(page); 191 SetPageUptodate(page);
192 NFS_FLAGS(inode) |= NFS_INO_INVALID_ATIME; 192 NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATIME;
193 /* Ensure consistent page alignment of the data. 193 /* Ensure consistent page alignment of the data.
194 * Note: assumes we have exclusive access to this mapping either 194 * Note: assumes we have exclusive access to this mapping either
195 * through inode->i_sem or some other mechanism. 195 * through inode->i_sem or some other mechanism.
@@ -462,7 +462,7 @@ int uncached_readdir(nfs_readdir_descriptor_t *desc, void *dirent,
462 page, 462 page,
463 NFS_SERVER(inode)->dtsize, 463 NFS_SERVER(inode)->dtsize,
464 desc->plus); 464 desc->plus);
465 NFS_FLAGS(inode) |= NFS_INO_INVALID_ATIME; 465 NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATIME;
466 desc->page = page; 466 desc->page = page;
467 desc->ptr = kmap(page); /* matching kunmap in nfs_do_filldir */ 467 desc->ptr = kmap(page); /* matching kunmap in nfs_do_filldir */
468 if (desc->error >= 0) { 468 if (desc->error >= 0) {
@@ -608,7 +608,7 @@ static inline int nfs_check_verifier(struct inode *dir, struct dentry *dentry)
608{ 608{
609 if (IS_ROOT(dentry)) 609 if (IS_ROOT(dentry))
610 return 1; 610 return 1;
611 if ((NFS_FLAGS(dir) & NFS_INO_INVALID_ATTR) != 0 611 if ((NFS_I(dir)->cache_validity & NFS_INO_INVALID_ATTR) != 0
612 || nfs_attribute_timeout(dir)) 612 || nfs_attribute_timeout(dir))
613 return 0; 613 return 0;
614 return nfs_verify_change_attribute(dir, (unsigned long)dentry->d_fsdata); 614 return nfs_verify_change_attribute(dir, (unsigned long)dentry->d_fsdata);
@@ -1575,11 +1575,12 @@ out:
1575 1575
1576int nfs_access_get_cached(struct inode *inode, struct rpc_cred *cred, struct nfs_access_entry *res) 1576int nfs_access_get_cached(struct inode *inode, struct rpc_cred *cred, struct nfs_access_entry *res)
1577{ 1577{
1578 struct nfs_access_entry *cache = &NFS_I(inode)->cache_access; 1578 struct nfs_inode *nfsi = NFS_I(inode);
1579 struct nfs_access_entry *cache = &nfsi->cache_access;
1579 1580
1580 if (cache->cred != cred 1581 if (cache->cred != cred
1581 || time_after(jiffies, cache->jiffies + NFS_ATTRTIMEO(inode)) 1582 || time_after(jiffies, cache->jiffies + NFS_ATTRTIMEO(inode))
1582 || (NFS_FLAGS(inode) & NFS_INO_INVALID_ACCESS)) 1583 || (nfsi->cache_validity & NFS_INO_INVALID_ACCESS))
1583 return -ENOENT; 1584 return -ENOENT;
1584 memcpy(res, cache, sizeof(*res)); 1585 memcpy(res, cache, sizeof(*res));
1585 return 0; 1586 return 0;
@@ -1587,14 +1588,15 @@ int nfs_access_get_cached(struct inode *inode, struct rpc_cred *cred, struct nfs
1587 1588
1588void nfs_access_add_cache(struct inode *inode, struct nfs_access_entry *set) 1589void nfs_access_add_cache(struct inode *inode, struct nfs_access_entry *set)
1589{ 1590{
1590 struct nfs_access_entry *cache = &NFS_I(inode)->cache_access; 1591 struct nfs_inode *nfsi = NFS_I(inode);
1592 struct nfs_access_entry *cache = &nfsi->cache_access;
1591 1593
1592 if (cache->cred != set->cred) { 1594 if (cache->cred != set->cred) {
1593 if (cache->cred) 1595 if (cache->cred)
1594 put_rpccred(cache->cred); 1596 put_rpccred(cache->cred);
1595 cache->cred = get_rpccred(set->cred); 1597 cache->cred = get_rpccred(set->cred);
1596 } 1598 }
1597 NFS_FLAGS(inode) &= ~NFS_INO_INVALID_ACCESS; 1599 nfsi->cache_validity &= ~NFS_INO_INVALID_ACCESS;
1598 cache->jiffies = set->jiffies; 1600 cache->jiffies = set->jiffies;
1599 cache->mask = set->mask; 1601 cache->mask = set->mask;
1600} 1602}