mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
teach nfs_get_link() to work in RCU mode
based upon the corresponding patch from Neil's March patchset, again with kmap-related horrors removed. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
1a384eaac2
commit
0d0def49d0
3 changed files with 42 additions and 10 deletions
|
@ -1087,6 +1087,27 @@ static bool nfs_mapping_need_revalidate_inode(struct inode *inode)
|
|||
|| NFS_STALE(inode);
|
||||
}
|
||||
|
||||
int nfs_revalidate_mapping_rcu(struct inode *inode)
|
||||
{
|
||||
struct nfs_inode *nfsi = NFS_I(inode);
|
||||
unsigned long *bitlock = &nfsi->flags;
|
||||
int ret = 0;
|
||||
|
||||
if (IS_SWAPFILE(inode))
|
||||
goto out;
|
||||
if (nfs_mapping_need_revalidate_inode(inode)) {
|
||||
ret = -ECHILD;
|
||||
goto out;
|
||||
}
|
||||
spin_lock(&inode->i_lock);
|
||||
if (test_bit(NFS_INO_INVALIDATING, bitlock) ||
|
||||
(nfsi->cache_validity & NFS_INO_INVALID_DATA))
|
||||
ret = -ECHILD;
|
||||
spin_unlock(&inode->i_lock);
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* __nfs_revalidate_mapping - Revalidate the pagecache
|
||||
* @inode - pointer to host inode
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue