aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_icache.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_icache.c')
-rw-r--r--fs/xfs/xfs_icache.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index fb39a66914dd..65b2e3f85f52 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -1414,6 +1414,16 @@ xfs_inode_set_eofblocks_tag(
1414 struct xfs_perag *pag; 1414 struct xfs_perag *pag;
1415 int tagged; 1415 int tagged;
1416 1416
1417 /*
1418 * Don't bother locking the AG and looking up in the radix trees
1419 * if we already know that we have the tag set.
1420 */
1421 if (ip->i_flags & XFS_IEOFBLOCKS)
1422 return;
1423 spin_lock(&ip->i_flags_lock);
1424 ip->i_flags |= XFS_IEOFBLOCKS;
1425 spin_unlock(&ip->i_flags_lock);
1426
1417 pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino)); 1427 pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino));
1418 spin_lock(&pag->pag_ici_lock); 1428 spin_lock(&pag->pag_ici_lock);
1419 trace_xfs_inode_set_eofblocks_tag(ip); 1429 trace_xfs_inode_set_eofblocks_tag(ip);
@@ -1449,6 +1459,10 @@ xfs_inode_clear_eofblocks_tag(
1449 struct xfs_mount *mp = ip->i_mount; 1459 struct xfs_mount *mp = ip->i_mount;
1450 struct xfs_perag *pag; 1460 struct xfs_perag *pag;
1451 1461
1462 spin_lock(&ip->i_flags_lock);
1463 ip->i_flags &= ~XFS_IEOFBLOCKS;
1464 spin_unlock(&ip->i_flags_lock);
1465
1452 pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino)); 1466 pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino));
1453 spin_lock(&pag->pag_ici_lock); 1467 spin_lock(&pag->pag_ici_lock);
1454 trace_xfs_inode_clear_eofblocks_tag(ip); 1468 trace_xfs_inode_clear_eofblocks_tag(ip);