diff options
author | Dave Chinner <david@fromorbit.com> | 2016-10-03 09:52:51 +1100 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2016-10-03 09:52:51 +1100 |
commit | a89b3f97bb7c248aea155a90f31d3dfb93b75971 (patch) | |
tree | 274d6f99d2a81b73ba13868a9188b725c918e5b8 /fs/xfs/xfs_icache.c | |
parent | 79ad57612495744d3875a6fba25c467a87b3ad64 (diff) | |
parent | 51446f5ba44874db4d2a93a6eb61b133e5ec1b3e (diff) |
Merge branch 'xfs-4.9-delalloc-rework' into for-next
Diffstat (limited to 'fs/xfs/xfs_icache.c')
-rw-r--r-- | fs/xfs/xfs_icache.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index fb39a66914dd8..65b2e3f85f52a 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -1414,6 +1414,16 @@ xfs_inode_set_eofblocks_tag( struct xfs_perag *pag; int tagged; + /* + * Don't bother locking the AG and looking up in the radix trees + * if we already know that we have the tag set. + */ + if (ip->i_flags & XFS_IEOFBLOCKS) + return; + spin_lock(&ip->i_flags_lock); + ip->i_flags |= XFS_IEOFBLOCKS; + spin_unlock(&ip->i_flags_lock); + pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino)); spin_lock(&pag->pag_ici_lock); trace_xfs_inode_set_eofblocks_tag(ip); @@ -1449,6 +1459,10 @@ xfs_inode_clear_eofblocks_tag( struct xfs_mount *mp = ip->i_mount; struct xfs_perag *pag; + spin_lock(&ip->i_flags_lock); + ip->i_flags &= ~XFS_IEOFBLOCKS; + spin_unlock(&ip->i_flags_lock); + pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino)); spin_lock(&pag->pag_ici_lock); trace_xfs_inode_clear_eofblocks_tag(ip); |