Btrfs: make defragment work with nodatacow option
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>
Thu, 3 Jul 2014 10:22:07 +0000 (18:22 +0800)
committerChris Mason <clm@fb.com>
Wed, 17 Sep 2014 20:37:26 +0000 (13:37 -0700)
commit47059d930f0e002ff851beea87d738146804726d
tree5f32e2b5a7630cfd53c24fa9cad873c86368cff8
parent48fcc3ff7dce0138c053833adf81670494f177f3
Btrfs: make defragment work with nodatacow option

Btrfs defragment will utilize COW feature, which means this
did not work for nodatacow option, this problem was detected
by xfstests generic/018 with nodatacow mount option.

Fix this problem by forcing cow for a extent with state
@EXTETN_DEFRAG setting.

Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/btrfs_inode.h
fs/btrfs/inode.c