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)
commitc514c9b10bc1ec8b487e82900ab57f46a21956d9
treee4c6df21f5fd425c0d86a9599837aa4654db066a
parentf6d9abbc1f957f0fcf88d567ae2523d37d2731da
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