mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
NFS: Don't set NFS_INO_INVALID_XATTR if there is no xattr cache
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
committed by
Anna Schumaker
parent
28aa2f9e73
commit
848fdd6239
@@ -195,6 +195,18 @@ bool nfs_check_cache_invalid(struct inode *inode, unsigned long flags)
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(nfs_check_cache_invalid);
|
EXPORT_SYMBOL_GPL(nfs_check_cache_invalid);
|
||||||
|
|
||||||
|
#ifdef CONFIG_NFS_V4_2
|
||||||
|
static bool nfs_has_xattr_cache(const struct nfs_inode *nfsi)
|
||||||
|
{
|
||||||
|
return nfsi->xattr_cache != NULL;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
static bool nfs_has_xattr_cache(const struct nfs_inode *nfsi)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void nfs_set_cache_invalid(struct inode *inode, unsigned long flags)
|
static void nfs_set_cache_invalid(struct inode *inode, unsigned long flags)
|
||||||
{
|
{
|
||||||
struct nfs_inode *nfsi = NFS_I(inode);
|
struct nfs_inode *nfsi = NFS_I(inode);
|
||||||
@@ -209,6 +221,8 @@ static void nfs_set_cache_invalid(struct inode *inode, unsigned long flags)
|
|||||||
| NFS_INO_INVALID_XATTR);
|
| NFS_INO_INVALID_XATTR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!nfs_has_xattr_cache(nfsi))
|
||||||
|
flags &= ~NFS_INO_INVALID_XATTR;
|
||||||
if (inode->i_mapping->nrpages == 0)
|
if (inode->i_mapping->nrpages == 0)
|
||||||
flags &= ~(NFS_INO_INVALID_DATA|NFS_INO_DATA_INVAL_DEFER);
|
flags &= ~(NFS_INO_INVALID_DATA|NFS_INO_DATA_INVAL_DEFER);
|
||||||
nfsi->cache_validity |= flags;
|
nfsi->cache_validity |= flags;
|
||||||
|
|||||||
Reference in New Issue
Block a user