From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: Tejun Heo <tj@kernel.org>, Josef Bacik <josef@toxicpanda.com>,
Christian Brauner <christian@brauner.io>,
linux-block@vger.kernel.org, cgroups@vger.kernel.org
Subject: [PATCH 2/4] block: remove the backing_inode variable in bdev_statx
Date: Wed, 23 Apr 2025 07:37:40 +0200 [thread overview]
Message-ID: <20250423053810.1683309-3-hch@lst.de> (raw)
In-Reply-To: <20250423053810.1683309-1-hch@lst.de>
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>
---
block/bdev.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/block/bdev.c b/block/bdev.c
index 6a34179192c9..1af9ed054f45 100644
--- a/block/bdev.c
+++ b/block/bdev.c
@@ -1274,18 +1274,15 @@ void sync_bdevs(bool wait)
*/
void bdev_statx(const struct path *path, struct kstat *stat, u32 request_mask)
{
- struct inode *backing_inode;
struct block_device *bdev;
- backing_inode = d_backing_inode(path->dentry);
-
/*
- * Note that backing_inode is the inode of a block device node file,
- * not the block device's internal inode. Therefore it is *not* valid
- * to use I_BDEV() here; the block device has to be looked up by i_rdev
+ * Note that d_backing_inode() returns the block device node inode, not
+ * the block device's internal inode. Therefore it is *not* valid to
+ * use I_BDEV() here; the block device has to be looked up by i_rdev
* instead.
*/
- bdev = blkdev_get_no_open(backing_inode->i_rdev);
+ bdev = blkdev_get_no_open(d_backing_inode(path->dentry)->i_rdev);
if (!bdev)
return;
--
2.47.2
next prev parent reply other threads:[~2025-04-23 5:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-23 5:37 don't autoload block drivers on stat (and cgroup configuration) Christoph Hellwig
2025-04-23 5:37 ` [PATCH 1/4] block: move blkdev_{get,put} _no_open prototypes out of blkdev.h Christoph Hellwig
2025-04-23 5:37 ` Christoph Hellwig [this message]
2025-04-23 5:37 ` [PATCH 3/4] block: don't autoload drivers on stat Christoph Hellwig
2025-04-23 5:37 ` [PATCH 4/4] block: don't autoload drivers on blk-cgroup configuration Christoph Hellwig
2025-04-23 15:06 ` don't autoload block drivers on stat (and cgroup configuration) Tejun Heo
2025-04-24 9:39 ` Christian Brauner
2025-04-24 13:35 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250423053810.1683309-3-hch@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=cgroups@vger.kernel.org \
--cc=christian@brauner.io \
--cc=josef@toxicpanda.com \
--cc=linux-block@vger.kernel.org \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.