aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/dir.c
diff options
context:
space:
mode:
authorChuck Lever <cel@citi.umich.edu>2005-08-18 14:24:09 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-08-18 15:53:56 -0400
commit5529680981807b44abf3be30fb6d612ff04f68ff (patch)
tree57da4e9135c0a85c1f8c6bc797250c0209420b51 /fs/nfs/dir.c
parent3c7bf1eaee1255315fc7c2c4c300295e556ef768 (diff)
[PATCH] NFS: split nfsi->flags into two fields
Certain bits in nfsi->flags can be manipulated with atomic bitops, and some are better manipulated via logical bitmask operations. This patch splits the flags field into two. The next patch introduces atomic bitops for one of the fields. Test plan: Millions of fsx ops on SMP clients. Signed-off-by: Chuck Lever <cel@netapp.com> Cc: Trond Myklebust <trond.myklebust@fys.uio.no> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
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}