summaryrefslogtreecommitdiff
path: root/cmds-device.c
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2016-06-23 15:26:05 -0400
committerDavid Sterba <dsterba@suse.com>2016-07-04 14:24:40 +0200
commit31d8235410985e0b64487354c9ba67d40c4bdfe3 (patch)
tree32348f2268d535f307a49b57a36efa4a33514455 /cmds-device.c
parent93014d235382301644c76ef338cc9a8b3a06615b (diff)
btrfs-progs: check: supplement extent backref list with rbtree
For the pathlogical case, like xfstests generic/297 that creates a large file consisting of one, repeating reflinked extent, fsck can take hours. The root cause is that calling find_data_backref while iterating the extent records is an O(n^2) algorithm. For my example test run, n was 2*2^20 and fsck was at 8 hours and counting. This patch supplements the list with an rbtree and drops the runtime of that testcase to about 20 seconds. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-device.c')
0 files changed, 0 insertions, 0 deletions