aboutsummaryrefslogtreecommitdiffstats
path: root/btrfs-zero-log.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2011-11-21 10:27:17 -0500
committerChris Mason <chris.mason@oracle.com>2011-11-21 10:27:17 -0500
commit6da41f2a740569440e88539779cb94f169b1f1b6 (patch)
tree2aa6685e1243e122009e67a9655f4ea888198a87 /btrfs-zero-log.c
parent13eced9a0c2b6bd6bc38e6f0f46a1977b1167e67 (diff)
downloadbtrfs-progs-6da41f2a740569440e88539779cb94f169b1f1b6.tar.gz
btrfs-progs-6da41f2a740569440e88539779cb94f169b1f1b6.tar.xz
btrfs-progs-6da41f2a740569440e88539779cb94f169b1f1b6.zip
btrfs-progs: make sure btrfs-zero-log writes something
The close_ctree code does a check to see if the FS has changed before it does any IO. This forces the commit. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'btrfs-zero-log.c')
-rw-r--r--btrfs-zero-log.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/btrfs-zero-log.c b/btrfs-zero-log.c
index 54d7858..1ea867b 100644
--- a/btrfs-zero-log.c
+++ b/btrfs-zero-log.c
@@ -42,6 +42,7 @@ static void print_usage(void)
int main(int ac, char **av)
{
struct btrfs_root *root;
+ struct btrfs_trans_handle *trans;
int ret;
if (ac != 2)
@@ -62,8 +63,10 @@ int main(int ac, char **av)
if (root == NULL)
return 1;
+ trans = btrfs_start_transaction(root, 1);
btrfs_set_super_log_root(&root->fs_info->super_copy, 0);
btrfs_set_super_log_root_level(&root->fs_info->super_copy, 0);
+ btrfs_commit_transaction(trans, root);
close_ctree(root);
return ret;
}