Btrfs: add a check to decide if we should defrag the range
authorLiu Bo <liubo2009@cn.fujitsu.com>
Thu, 29 Mar 2012 13:57:45 +0000 (09:57 -0400)
committerChris Mason <chris.mason@oracle.com>
Thu, 29 Mar 2012 13:57:45 +0000 (09:57 -0400)
commit17ce6ef8d731af5edac8c39e806db4c7e1f6956f
tree4a54d3c5618efff3deec03fa5d32a42c0a8fc804
parent4cb13e5d6ecc47b91b24a35f8fbc2c9f33d075fe
Btrfs: add a check to decide if we should defrag the range

If our file's layout is as follows:
| hole | data1 | hole | data2 |

we do not need to defrag this file, because this file has holes and
cannot be merged into one extent.

Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/ioctl.c