]> www.infradead.org Git - users/hch/block.git/commitdiff
cramfs: use bdev_read_cache_page
authorChristoph Hellwig <hch@lst.de>
Tue, 12 Oct 2021 08:17:37 +0000 (10:17 +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>
fs/cramfs/inode.c

index 3e44cc3ed054389a1c0babbd9fd260a3b7fd0c2a..465314289823dfc48ebac8d7c8eab76d6aa3ca66 100644 (file)
@@ -182,7 +182,6 @@ static int next_buffer;
 static void *cramfs_blkdev_read(struct super_block *sb, unsigned int offset,
                                unsigned int len)
 {
-       struct address_space *mapping = sb->s_bdev->bd_inode->i_mapping;
        struct page *pages[BLKS_PER_BUF];
        unsigned i, blocknr, buffer;
        unsigned long devsize;
@@ -216,7 +215,8 @@ static void *cramfs_blkdev_read(struct super_block *sb, unsigned int offset,
                struct page *page = NULL;
 
                if (blocknr + i < devsize) {
-                       page = read_mapping_page(mapping, blocknr + i, NULL);
+                       page = bdev_read_cache_page(sb->s_bdev, blocknr + i,
+                                                   GFP_NOFS);
                        /* synchronous error? */
                        if (IS_ERR(page))
                                page = NULL;