Skip to content

Commit

Permalink
Btrfs: cleanup extents after we finish logging inode
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Liu Bo authored and Chris Mason committed Oct 1, 2012
1 parent 0fa83cd commit 06d3d22
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fs/btrfs/tree-log.c
Original file line number Diff line number Diff line change
Expand Up @@ -3167,6 +3167,12 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans,
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)) {
Expand Down

0 comments on commit 06d3d22

Please sign in to comment.