]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: don't kmap() pages from block devices
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>
Thu, 13 Feb 2020 15:24:30 +0000 (00:24 +0900)
committerDavid Sterba <dsterba@suse.com>
Mon, 23 Mar 2020 16:01:39 +0000 (17:01 +0100)
commitcdd5f37d6fd23848fe4c3eba04d7fb1c70610d9d
treee4c6df21f5fd425c0d86a9599837aa4654db066a
parent32425a02a961540fe3ae526756bc73a16d0975d7
btrfs: don't kmap() pages from block devices

Block device mappings are never in highmem so kmap() / kunmap() calls for
pages from block devices are unneeded. Use page_address() instead of
kmap() to get to the virtual addreses.

While we're at it, read_cache_page_gfp() doesn't return NULL on error,
only an ERR_PTR, so use IS_ERR() to check for errors.

Suggested-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c