diff options
author | Liu Bo <bo.li.liu@oracle.com> | 2012-09-05 21:10:51 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2012-10-01 15:19:15 -0400 |
commit | 9e8a4a8b0b9484e8d14674fc62c9ad8ac9dbce5b (patch) | |
tree | d1c2cc07c1d016b6d9e8352a41247e1da2778f28 /fs/btrfs/file.c | |
parent | 3d6b5c3b5c0b970ce8a9d3bac6854f5c0ce0295a (diff) |
Btrfs: use flag EXTENT_DEFRAG for snapshot-aware defrag
We're going to use this flag EXTENT_DEFRAG to indicate which range
belongs to defragment so that we can implement snapshow-aware defrag:
We set the EXTENT_DEFRAG flag when dirtying the extents that need
defragmented, so later on writeback thread can differentiate between
normal writeback and writeback started by defragmentation.
Original-Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r-- | fs/btrfs/file.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 00279c9a7f35..0a4b03d8fcd6 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
@@ -1203,8 +1203,8 @@ again: | |||
1203 | 1203 | ||
1204 | clear_extent_bit(&BTRFS_I(inode)->io_tree, start_pos, | 1204 | clear_extent_bit(&BTRFS_I(inode)->io_tree, start_pos, |
1205 | last_pos - 1, EXTENT_DIRTY | EXTENT_DELALLOC | | 1205 | last_pos - 1, EXTENT_DIRTY | EXTENT_DELALLOC | |
1206 | EXTENT_DO_ACCOUNTING, 0, 0, &cached_state, | 1206 | EXTENT_DO_ACCOUNTING | EXTENT_DEFRAG, |
1207 | GFP_NOFS); | 1207 | 0, 0, &cached_state, GFP_NOFS); |
1208 | unlock_extent_cached(&BTRFS_I(inode)->io_tree, | 1208 | unlock_extent_cached(&BTRFS_I(inode)->io_tree, |
1209 | start_pos, last_pos - 1, &cached_state, | 1209 | start_pos, last_pos - 1, &cached_state, |
1210 | GFP_NOFS); | 1210 | GFP_NOFS); |