]> www.infradead.org Git - users/hch/block.git/commitdiff
scsi: use bdev_read_cache_page in scsi_bios_ptable
authorChristoph Hellwig <hch@lst.de>
Tue, 12 Oct 2021 08:13:17 +0000 (10:13 +0200)
committerChristoph Hellwig <hch@lst.de>
Tue, 12 Oct 2021 08:29:36 +0000 (10:29 +0200)
Use bdev_read_cache_page instead of open coding it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/scsi/scsicam.c

index 0ffdb8f2995f7a9dc59d14f912ce1dafd94fcc3e..149062af5c8d00cfd2318994c2ddd049d60f9815 100644 (file)
  */
 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;
 
-       page = read_mapping_page(mapping, 0, NULL);
+       page = bdev_read_cache_page(bdev_whole(dev), 0, GFP_NOIO);
        if (IS_ERR(page))
                return NULL;