]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: use kvzalloc for EXTENT_SAME temporary data
authorDavid Sterba <dsterba@suse.com>
Fri, 11 May 2018 15:57:54 +0000 (17:57 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 28 May 2018 16:24:09 +0000 (18:24 +0200)
commitf77cc78f9c891fbbdcd073943d863717ae423d41
treeac3fff8b933faca399ed8edf10f1f3d3c4b9279d
parenta5dc1bc0586f049531ffd285f51adda916f67d2c
btrfs: use kvzalloc for EXTENT_SAME temporary data

The dedupe range is 16 MiB, with 4 KiB pages and 8 byte pointers, the
arrays can be 32KiB large. To avoid allocation failures due to
fragmented memory, use the allocation with fallback to vmalloc.

The arrays are allocated and freed only inside btrfs_extent_same and
reused for all the ranges.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c