aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/file.c
diff options
context:
space:
mode:
authorMiao Xie <miaox@cn.fujitsu.com>2012-11-26 04:27:29 -0500
committerChris Mason <chris.mason@fusionio.com>2012-12-16 20:46:12 -0500
commitb66f00da0cfceb856c17706b77906b63437f6fda (patch)
tree1e08ae66d5369d7097ce52ff2881945322418c01 /fs/btrfs/file.c
parent26176e7c2aa923327becdc25b5aca2cb907ac932 (diff)
Btrfs: fix freeze vs auto defrag
If we freeze the fs, the auto defragment should not run. Fix it. Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r--fs/btrfs/file.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 3c6f7479cd5b..d415a052ca9a 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -318,8 +318,11 @@ static int __btrfs_run_defrag_inode(struct btrfs_fs_info *fs_info,
318 memset(&range, 0, sizeof(range)); 318 memset(&range, 0, sizeof(range));
319 range.len = (u64)-1; 319 range.len = (u64)-1;
320 range.start = defrag->last_offset; 320 range.start = defrag->last_offset;
321
322 sb_start_write(fs_info->sb);
321 num_defrag = btrfs_defrag_file(inode, NULL, &range, defrag->transid, 323 num_defrag = btrfs_defrag_file(inode, NULL, &range, defrag->transid,
322 BTRFS_DEFRAG_BATCH); 324 BTRFS_DEFRAG_BATCH);
325 sb_end_write(fs_info->sb);
323 /* 326 /*
324 * if we filled the whole defrag batch, there 327 * if we filled the whole defrag batch, there
325 * must be more work to do. Queue this defrag 328 * must be more work to do. Queue this defrag