]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: zstd: replace kmap() with kmap_local_page()
authorFabio M. De Francesco <fmdefrancesco@gmail.com>
Wed, 6 Jul 2022 11:15:20 +0000 (13:15 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Jul 2022 15:45:40 +0000 (17:45 +0200)
commita5d530cedaa83660776b5179ab163515dd42fa13
tree263fcfa3621c6787134d9811a68f656cac2f43c8
parent23bbf108fbe2b0fa7d9a99dbff39ff533efe9351
btrfs: zstd: replace kmap() with kmap_local_page()

The use of kmap() is being deprecated in favor of kmap_local_page(). With
kmap_local_page(), the mapping is per thread, CPU local and not globally
visible.

Therefore, use kmap_local_page() / kunmap_local() in zstd.c because in this
file the mappings are per thread and are not visible in other contexts. In
the meanwhile use plain page_address() on output pages allocated with
the GFP_NOFS flag instead of calling kmap*() on them (since they are
always allocated from ZONE_NORMAL).

Tested with xfstests on QEMU + KVM 32 bits VM with 4GB of RAM, booting a
kernel with HIGHMEM64G enabled.

Suggested-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/zstd.c