Li Zefan 6c282eb40e Btrfs: fix defrag regression
If a file has 3 small extents:

| ext1 | ext2 | ext3 |

Running "btrfs fi defrag" will only defrag the last two extents, if those
extent mappings hasn't been read into memory from disk.

This bug was introduced by commit 17ce6ef8d731af5edac8c39e806db4c7e1f6956f
("Btrfs: add a check to decide if we should defrag the range")

The cause is, that commit looked into previous and next extents using
lookup_extent_mapping() only.

While at it, remove the code that checks the previous extent, since
it's sufficient to check the next extent.

Signed-off-by: Li Zefan <lizefan@huawei.com>
2012-06-14 21:30:55 -04:00
..
2012-05-30 10:23:27 -04:00
2011-07-26 16:49:47 -07:00
2008-09-25 11:04:06 -04:00
2012-06-14 21:30:55 -04:00
2012-06-14 21:29:16 -04:00
2012-06-14 21:30:37 -04:00
2011-06-17 14:54:18 -04:00