diff options
author | Sage Weil <sage@newdream.net> | 2010-02-19 17:13:50 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2010-03-15 11:00:11 -0400 |
commit | 0bdb1db297ab36865a63ee722d35ff0a1f0ae522 (patch) | |
tree | bd30183300d2ceaa35db1ab59adacf89e8e19d1a /fs/btrfs/transaction.c | |
parent | bd4d10888990f7e3f8029205d27eb155202d6969 (diff) |
Btrfs: flush data on snapshot creation
Flush any delalloc extents when we create a snapshot, so that recently
written file data is always included in the snapshot.
A later commit will add the ability to snapshot without the flush, but
most people expect flushing.
Signed-off-by: Sage Weil <sage@newdream.net>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r-- | fs/btrfs/transaction.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 2a36e236a492..2d654c1c794d 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -997,13 +997,10 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, | |||
997 | 997 | ||
998 | mutex_unlock(&root->fs_info->trans_mutex); | 998 | mutex_unlock(&root->fs_info->trans_mutex); |
999 | 999 | ||
1000 | if (flush_on_commit) { | 1000 | if (flush_on_commit || snap_pending) { |
1001 | btrfs_start_delalloc_inodes(root, 1); | 1001 | btrfs_start_delalloc_inodes(root, 1); |
1002 | ret = btrfs_wait_ordered_extents(root, 0, 1); | 1002 | ret = btrfs_wait_ordered_extents(root, 0, 1); |
1003 | BUG_ON(ret); | 1003 | BUG_ON(ret); |
1004 | } else if (snap_pending) { | ||
1005 | ret = btrfs_wait_ordered_extents(root, 0, 1); | ||
1006 | BUG_ON(ret); | ||
1007 | } | 1004 | } |
1008 | 1005 | ||
1009 | /* | 1006 | /* |