提交 678edd09 编写于 作者: D David Howells

afs: Be more aggressive in retiring cached vnodes

When relinquishing cookies, either due to iget failure or to inode
eviction, retire a cookie if we think the corresponding vnode got deleted
on the server rather than just letting it lie in the cache.
Signed-off-by: NDavid Howells <dhowells@redhat.com>
上级 27a3ee3a
...@@ -327,7 +327,7 @@ struct inode *afs_iget(struct super_block *sb, struct key *key, ...@@ -327,7 +327,7 @@ struct inode *afs_iget(struct super_block *sb, struct key *key,
/* failure */ /* failure */
bad_inode: bad_inode:
#ifdef CONFIG_AFS_FSCACHE #ifdef CONFIG_AFS_FSCACHE
fscache_relinquish_cookie(vnode->cache, 0); fscache_relinquish_cookie(vnode->cache, ret == -ENOENT);
vnode->cache = NULL; vnode->cache = NULL;
#endif #endif
iget_failed(inode); iget_failed(inode);
...@@ -511,7 +511,8 @@ void afs_evict_inode(struct inode *inode) ...@@ -511,7 +511,8 @@ void afs_evict_inode(struct inode *inode)
} }
#ifdef CONFIG_AFS_FSCACHE #ifdef CONFIG_AFS_FSCACHE
fscache_relinquish_cookie(vnode->cache, 0); fscache_relinquish_cookie(vnode->cache,
test_bit(AFS_VNODE_DELETED, &vnode->flags));
vnode->cache = NULL; vnode->cache = NULL;
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册