diff options
author | NeilBrown <neilb@suse.de> | 2014-07-13 21:28:20 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-08-03 17:14:12 -0400 |
commit | 912a108da767ae75cc929d2854e698aff527ec5d (patch) | |
tree | 7ae1fda9f3512f9fabd1cc6d2467b4a9c416d745 /fs/nfs/inode.c | |
parent | f3324a2a94c229831cfd42d871902cd4a9bd5e0f (diff) |
NFS: teach nfs_neg_need_reval to understand LOOKUP_RCU
This requires nfs_check_verifier to take an rcu_walk flag, and requires
an rcu version of nfs_revalidate_inode which returns -ECHILD rather
than making an RPC call.
With this, nfs_lookup_revalidate can call nfs_neg_need_reval in
RCU-walk mode.
We can also move the LOOKUP_RCU check past the nfs_check_verifier()
call in nfs_lookup_revalidate.
If RCU_WALK prevents nfs_check_verifier or nfs_neg_need_reval from
doing a full check, they return a status indicating that a revalidation
is required. As this revalidation will not be possible in RCU_WALK
mode, -ECHILD will ultimately be returned, which is the desired result.
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/inode.c')
-rw-r--r-- | fs/nfs/inode.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 9927913c97c2..147fd17e7920 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -1002,6 +1002,15 @@ int nfs_revalidate_inode(struct nfs_server *server, struct inode *inode) | |||
1002 | } | 1002 | } |
1003 | EXPORT_SYMBOL_GPL(nfs_revalidate_inode); | 1003 | EXPORT_SYMBOL_GPL(nfs_revalidate_inode); |
1004 | 1004 | ||
1005 | int nfs_revalidate_inode_rcu(struct nfs_server *server, struct inode *inode) | ||
1006 | { | ||
1007 | if (!(NFS_I(inode)->cache_validity & | ||
1008 | (NFS_INO_INVALID_ATTR|NFS_INO_INVALID_LABEL)) | ||
1009 | && !nfs_attribute_cache_expired(inode)) | ||
1010 | return NFS_STALE(inode) ? -ESTALE : 0; | ||
1011 | return -ECHILD; | ||
1012 | } | ||
1013 | |||
1005 | static int nfs_invalidate_mapping(struct inode *inode, struct address_space *mapping) | 1014 | static int nfs_invalidate_mapping(struct inode *inode, struct address_space *mapping) |
1006 | { | 1015 | { |
1007 | struct nfs_inode *nfsi = NFS_I(inode); | 1016 | struct nfs_inode *nfsi = NFS_I(inode); |