summaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_iext_tree.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-07-18 01:51:51 +0200
committerDarrick J. Wong <darrick.wong@oracle.com>2018-07-31 22:18:09 +0200
commit745b3f76d1c889d738a1c4537a3c491bc1ecac4d (patch)
tree29a159f817cb3779f93f6d9140152da18091bb40 /fs/xfs/libxfs/xfs_iext_tree.c
parentxfs: check for unknown v5 feature bits in superblock write verifier (diff)
downloadlinux-745b3f76d1c889d738a1c4537a3c491bc1ecac4d.tar.xz
linux-745b3f76d1c889d738a1c4537a3c491bc1ecac4d.zip
xfs: maintain a sequence count for inode fork manipulations
Add a simple 32-bit unsigned integer as the sequence count for modifications to the extent list in the inode fork. This will be used to optimize away extent list lookups in the writeback code. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_iext_tree.c')
-rw-r--r--fs/xfs/libxfs/xfs_iext_tree.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_iext_tree.c b/fs/xfs/libxfs/xfs_iext_tree.c
index b80c63faace2..8a7aea041ee1 100644
--- a/fs/xfs/libxfs/xfs_iext_tree.c
+++ b/fs/xfs/libxfs/xfs_iext_tree.c
@@ -624,6 +624,8 @@ xfs_iext_insert(
struct xfs_iext_leaf *new = NULL;
int nr_entries, i;
+ ifp->if_seq++;
+
if (ifp->if_height == 0)
xfs_iext_alloc_root(ifp, cur);
else if (ifp->if_height == 1)
@@ -864,6 +866,8 @@ xfs_iext_remove(
ASSERT(ifp->if_u1.if_root != NULL);
ASSERT(xfs_iext_valid(ifp, cur));
+ ifp->if_seq++;
+
nr_entries = xfs_iext_leaf_nr_entries(ifp, leaf, cur->pos) - 1;
for (i = cur->pos; i < nr_entries; i++)
leaf->recs[i] = leaf->recs[i + 1];
@@ -970,6 +974,8 @@ xfs_iext_update_extent(
{
struct xfs_ifork *ifp = xfs_iext_state_to_fork(ip, state);
+ ifp->if_seq++;
+
if (cur->pos == 0) {
struct xfs_bmbt_irec old;