]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: bulk delete checksum items in the same leaf
authorFilipe Manana <fdmanana@suse.com>
Sat, 28 Jan 2017 01:47:56 +0000 (01:47 +0000)
committerFilipe Manana <fdmanana@suse.com>
Fri, 24 Feb 2017 00:36:55 +0000 (00:36 +0000)
commit3a21e4cf09d85097d0e6531db0f92b386f4d7f6c
tree3397961fab5e75ffff0643bc1262671ea5cce255
parent09acd840e4a6e8efba3af22146b12220e8b0f111
Btrfs: bulk delete checksum items in the same leaf

Very often we have the checksums for an extent spread in multiple items
in the checksums tree, and currently the algorithm to delete them starts
by looking for them one by one and then deleting them one by one, which
is not optimal since each deletion involves shifting all the other items
in the leaf and when the leaf reaches some low threshold, to move items
off the leaf into its left and right neighbor leafs. Also, after each
item deletion we release our search path and start a new search for other
checksums items.

So optimize this by deleting in bulk all the items in the same leaf that
contain checksums for the extent being freed.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
fs/btrfs/file-item.c