diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2022-02-09 18:58:22 +0100 |
---|---|---|
committer | Matthew Wilcox (Oracle) <willy@infradead.org> | 2022-05-08 20:28:18 +0200 |
commit | 5fb9bfe01c88788ca3a99c44e44d52abb138595d (patch) | |
tree | 53133b004ff8111d709c953c9681e7f2a474ede0 /drivers/scsi | |
parent | Merge tag 'sound-5.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/t... (diff) | |
download | linux-5fb9bfe01c88788ca3a99c44e44d52abb138595d.tar.xz linux-5fb9bfe01c88788ca3a99c44e44d52abb138595d.zip |
scsicam: Fix use of page cache
Convert scsicam to use a folio instead of a page. There is no need to
check the error flag here; read_cache_folio() will return -EIO if the
folio cannot be read correctly.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Diffstat (limited to '')
-rw-r--r-- | drivers/scsi/scsicam.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/scsi/scsicam.c b/drivers/scsi/scsicam.c index acdc0aceca5e..e2c7d8ef205f 100644 --- a/drivers/scsi/scsicam.c +++ b/drivers/scsi/scsicam.c @@ -34,15 +34,14 @@ unsigned char *scsi_bios_ptable(struct block_device *dev) { struct address_space *mapping = bdev_whole(dev)->bd_inode->i_mapping; unsigned char *res = NULL; - struct page *page; + struct folio *folio; - page = read_mapping_page(mapping, 0, NULL); - if (IS_ERR(page)) + folio = read_mapping_folio(mapping, 0, NULL); + if (IS_ERR(folio)) return NULL; - if (!PageError(page)) - res = kmemdup(page_address(page) + 0x1be, 66, GFP_KERNEL); - put_page(page); + res = kmemdup(folio_address(folio) + 0x1be, 66, GFP_KERNEL); + folio_put(folio); return res; } EXPORT_SYMBOL(scsi_bios_ptable); |