fs: simplify init_page_buffers
authorChristoph Hellwig <hch@lst.de>
Mon, 18 Oct 2021 10:11:10 +0000 (12:11 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 18 Oct 2021 20:43:22 +0000 (14:43 -0600)
No need to convert from bdev to inode and back.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20211018101130.1838532-11-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/buffer.c

index 1563589..46bc589 100644 (file)
@@ -897,7 +897,7 @@ init_page_buffers(struct page *page, struct block_device *bdev,
        struct buffer_head *head = page_buffers(page);
        struct buffer_head *bh = head;
        int uptodate = PageUptodate(page);
-       sector_t end_block = blkdev_max_block(I_BDEV(bdev->bd_inode), size);
+       sector_t end_block = blkdev_max_block(bdev, size);
 
        do {
                if (!buffer_mapped(bh)) {