Skip to content

Commit e33aef2

Browse files
author
Al Viro
committed
block_device: add a pointer to struct address_space (page cache of bdev)
points to ->i_data of coallocated inode. Signed-off-by: Al Viro <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Christian Brauner <[email protected]>
1 parent a09cd55 commit e33aef2

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

block/bdev.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,7 @@ struct block_device *bdev_alloc(struct gendisk *disk, u8 partno)
419419
mutex_init(&bdev->bd_holder_lock);
420420
bdev->bd_partno = partno;
421421
bdev->bd_inode = inode;
422+
bdev->bd_mapping = &inode->i_data;
422423
bdev->bd_queue = disk->queue;
423424
if (partno)
424425
bdev->bd_has_submit_bio = disk->part0->bd_has_submit_bio;

include/linux/blk_types.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ struct block_device {
5151
bool bd_has_submit_bio;
5252
dev_t bd_dev;
5353
struct inode *bd_inode; /* will die */
54+
struct address_space *bd_mapping; /* page cache */
5455

5556
atomic_t bd_openers;
5657
spinlock_t bd_size_lock; /* for bd_inode->i_size updates */

0 commit comments

Comments
 (0)