]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: switch to kvmalloc and GFP_KERNEL in lzo/zlib alloc_workspace
authorDavid Sterba <dsterba@suse.com>
Wed, 31 May 2017 15:21:15 +0000 (17:21 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 19 Jun 2017 16:26:02 +0000 (18:26 +0200)
commitbfb40601722c0ba8435471a3f94ad90737ceef70
treec4633060e4ed7c2069b83aea49a5a429df62ef5f
parent5d0234eca9da852a7de9a2082aa6eda0ce29ec13
btrfs: switch to kvmalloc and GFP_KERNEL in lzo/zlib alloc_workspace

The compression workspace buffers are larger than a page so we use
vmalloc, unconditionally. This is not always necessary as there might be
contiguous memory available.

Let's use the kvmalloc helpers that will try kmalloc first and fallback
to vmalloc. For that they require GFP_KERNEL flags. As we now have the
alloc_workspace calls protected by memalloc_nofs in the critical
contexts, we can safely use GFP_KERNEL.

Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/lzo.c
fs/btrfs/zlib.c