Skip to content

Commit d13b709

Browse files
Christoph Hellwigaxboe
authored andcommitted
block: remove the backing_inode variable in bdev_statx
backing_inode is only used once, so remove it and update the comment describing the bdev lookup to be a bit more clear. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Christian Brauner <brauner@kernel.org> Acked-by: Tejun Heo <tj@kernel.org> Link: https://lore.kernel.org/r/20250423053810.1683309-3-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent c632021 commit d13b709

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

block/bdev.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,18 +1313,15 @@ void sync_bdevs(bool wait)
13131313
void bdev_statx(struct path *path, struct kstat *stat,
13141314
u32 request_mask)
13151315
{
1316-
struct inode *backing_inode;
13171316
struct block_device *bdev;
13181317

1319-
backing_inode = d_backing_inode(path->dentry);
1320-
13211318
/*
1322-
* Note that backing_inode is the inode of a block device node file,
1323-
* not the block device's internal inode. Therefore it is *not* valid
1324-
* to use I_BDEV() here; the block device has to be looked up by i_rdev
1319+
* Note that d_backing_inode() returns the block device node inode, not
1320+
* the block device's internal inode. Therefore it is *not* valid to
1321+
* use I_BDEV() here; the block device has to be looked up by i_rdev
13251322
* instead.
13261323
*/
1327-
bdev = blkdev_get_no_open(backing_inode->i_rdev);
1324+
bdev = blkdev_get_no_open(d_backing_inode(path->dentry)->i_rdev);
13281325
if (!bdev)
13291326
return;
13301327

0 commit comments

Comments
 (0)