summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tree-log.c
diff options
context:
space:
mode:
authorLiu Bo <bo.li.liu@oracle.com>2012-08-27 10:52:19 -0600
committerChris Mason <chris.mason@fusionio.com>2012-10-01 15:19:04 -0400
commit06d3d22b456c2f87aeb1eb4517eeabb47e21fcc9 (patch)
treee9bc061c8902fc555430dbad2a64e35ea8d286ba /fs/btrfs/tree-log.c
parent0fa83cdb1d72a94ea84ab6380747de6ac7cc8753 (diff)
downloadop-kernel-dev-06d3d22b456c2f87aeb1eb4517eeabb47e21fcc9.zip
op-kernel-dev-06d3d22b456c2f87aeb1eb4517eeabb47e21fcc9.tar.gz
Btrfs: cleanup extents after we finish logging inode
This is based on Josef's "Btrfs: turbo charge fsync". We should cleanup those extents after we've finished logging inode, otherwise we may do redundant work on them. Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r--fs/btrfs/tree-log.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 94db438..58075d7 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -3167,6 +3167,12 @@ next_slot:
err = ret;
goto out_unlock;
}
+ } else {
+ struct extent_map_tree *tree = &BTRFS_I(inode)->extent_tree;
+ struct extent_map *em, *n;
+
+ list_for_each_entry_safe(em, n, &tree->modified_extents, list)
+ list_del_init(&em->list);
}
if (inode_only == LOG_INODE_ALL && S_ISDIR(inode->i_mode)) {
OpenPOWER on IntegriCloud