Linux block layer
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Christoph Hellwig <hch@lst.de>, Jan Kara <jack@suse.cz>
Cc: Jens Axboe <axboe@kernel.dk>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	 linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	 linux-fsdevel@vger.kernel.org, Carlos Maiolino <cem@kernel.org>,
	 linux-xfs@vger.kernel.org, Chris Mason <clm@fb.com>,
	 David Sterba <dsterba@suse.com>,
	linux-btrfs@vger.kernel.org,  Theodore Ts'o <tytso@mit.edu>,
	linux-ext4@vger.kernel.org,  Gao Xiang <xiang@kernel.org>,
	linux-erofs@lists.ozlabs.org,
	 "Christian Brauner (Amutable)" <brauner@kernel.org>
Subject: [PATCH RFC 4/8] xfs: port to fs_bdev_file_open_by_path()
Date: Tue, 02 Jun 2026 12:10:10 +0200	[thread overview]
Message-ID: <20260602-work-super-bdev_holder_global-v1-4-bb0fd82f3861@kernel.org> (raw)
In-Reply-To: <20260602-work-super-bdev_holder_global-v1-0-bb0fd82f3861@kernel.org>

Route opens through fs_bdev_file_open_by_path() so each external device
is registered against mp->m_super, and convert the matching releases.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
---
 fs/xfs/xfs_buf.c   |  2 +-
 fs/xfs/xfs_super.c | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index 580d40a5ee57..3d3b29edb156 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -1601,7 +1601,7 @@ xfs_free_buftarg(
 	fs_put_dax(btp->bt_daxdev, btp->bt_mount);
 	/* the main block device is closed by kill_block_super */
 	if (btp->bt_bdev != btp->bt_mount->m_super->s_bdev)
-		bdev_fput(btp->bt_file);
+		fs_bdev_file_release(btp->bt_file, btp->bt_mount->m_super);
 	kfree(btp);
 }
 
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index f8de44443e81..304667210695 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -400,8 +400,8 @@ xfs_blkdev_get(
 	blk_mode_t		mode;
 
 	mode = sb_open_mode(mp->m_super->s_flags);
-	*bdev_filep = bdev_file_open_by_path(name, mode,
-			mp->m_super, &fs_holder_ops);
+	*bdev_filep = fs_bdev_file_open_by_path(name, mode,
+			mp->m_super, mp->m_super);
 	if (IS_ERR(*bdev_filep)) {
 		error = PTR_ERR(*bdev_filep);
 		*bdev_filep = NULL;
@@ -526,7 +526,7 @@ xfs_open_devices(
 		mp->m_logdev_targp = mp->m_ddev_targp;
 		/* Handle won't be used, drop it */
 		if (logdev_file)
-			bdev_fput(logdev_file);
+			fs_bdev_file_release(logdev_file, mp->m_super);
 	}
 
 	return 0;
@@ -538,10 +538,10 @@ xfs_open_devices(
 	xfs_free_buftarg(mp->m_ddev_targp);
  out_close_rtdev:
 	 if (rtdev_file)
-		bdev_fput(rtdev_file);
+		fs_bdev_file_release(rtdev_file, mp->m_super);
  out_close_logdev:
 	if (logdev_file)
-		bdev_fput(logdev_file);
+		fs_bdev_file_release(logdev_file, mp->m_super);
 	return error;
 }
 

-- 
2.47.3


  parent reply	other threads:[~2026-06-02 10:10 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-02 10:10 [PATCH RFC 0/8] fs: support freeze/thaw/mark_dead/sync with shared devices Christian Brauner
2026-06-02 10:10 ` [PATCH RFC 1/8] fs, block: move blk_mode_t and fop_flags_t into <linux/types.h> Christian Brauner
2026-06-08  9:57   ` Jan Kara
2026-06-02 10:10 ` [PATCH RFC 2/8] fs: add a global device to super block hash table Christian Brauner
2026-06-08 10:14   ` Jan Kara
2026-06-16 12:34   ` Christoph Hellwig
2026-06-16 14:59     ` Christian Brauner
2026-06-16 15:19       ` Christian Brauner
2026-06-02 10:10 ` [PATCH RFC 3/8] fs: refuse to claim any frozen block device Christian Brauner
2026-06-08 10:01   ` Jan Kara
2026-06-02 10:10 ` Christian Brauner [this message]
2026-06-08 10:15   ` [PATCH RFC 4/8] xfs: port to fs_bdev_file_open_by_path() Jan Kara
2026-06-02 10:10 ` [PATCH RFC 5/8] btrfs: open via dedicated fs bdev helpers Christian Brauner
2026-06-02 10:10 ` [PATCH RFC 6/8] ext4: " Christian Brauner
2026-06-08 10:18   ` Jan Kara
2026-06-02 10:10 ` [PATCH RFC 7/8] erofs: " Christian Brauner
2026-06-02 16:25   ` Gao Xiang
2026-06-03 13:42     ` Christian Brauner
2026-06-10  6:55       ` Gao Xiang
2026-06-02 10:10 ` [PATCH RFC 8/8] super: make fs_holder_ops private Christian Brauner
2026-06-08 10:18   ` Jan Kara
2026-06-02 16:12 ` [PATCH RFC 0/8] fs: support freeze/thaw/mark_dead/sync with shared devices Gao Xiang
2026-06-03  6:43 ` [syzbot ci] " syzbot ci

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=20260602-work-super-bdev_holder_global-v1-4-bb0fd82f3861@kernel.org \
    --to=brauner@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=cem@kernel.org \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    --cc=xiang@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox