All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Andrey Albershteyn <aalbersh@kernel.org>, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 08/10] libxfs: rename bt_bdev*
Date: Fri, 25 Sep 2026 15:43:02 -0700	[thread overview]
Message-ID: <20260925224302.GW2705364@frogsfrogsfrogs> (raw)
In-Reply-To: <20260925051336.2997014-9-hch@lst.de>

On Fri, Sep 25, 2026 at 07:12:54AM +0200, Christoph Hellwig wrote:
> Unlike the kernel, there is no block device concept in libxfs.
> 
> Rename the bt_bdev field to bt_dev as it stores a dev_t, and bt_bdev_fd
> to just bt_fd to make the naming a bit less confusing.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Make sense to me;
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
>  libxfs/buf_mem.c   |  4 ++--
>  libxfs/init.c      | 10 +++++-----
>  libxfs/libxfs_io.h |  4 ++--
>  libxfs/rdwr.c      | 12 ++++++------
>  repair/prefetch.c  |  2 +-
>  repair/zoned.c     |  2 +-
>  6 files changed, 17 insertions(+), 17 deletions(-)
> 
> diff --git a/libxfs/buf_mem.c b/libxfs/buf_mem.c
> index 3c8452de9689..f3db59dfc63e 100644
> --- a/libxfs/buf_mem.c
> +++ b/libxfs/buf_mem.c
> @@ -294,8 +294,8 @@ xmbuf_alloc(
>  
>  	/* Initialize buffer target */
>  	btp->bt_mount = mp;
> -	btp->bt_bdev = (dev_t)-1;
> -	btp->bt_bdev_fd = -1;
> +	btp->bt_dev = (dev_t)-1;
> +	btp->bt_fd = -1;
>  	btp->bt_xfile = xfile;
>  	btp->bcache = cache;
>  
> diff --git a/libxfs/init.c b/libxfs/init.c
> index 97c5286c00a9..5a4b255165ab 100644
> --- a/libxfs/init.c
> +++ b/libxfs/init.c
> @@ -457,8 +457,8 @@ libxfs_buftarg_alloc(
>  		exit(1);
>  	}
>  	btp->bt_mount = mp;
> -	btp->bt_bdev = dev->dev;
> -	btp->bt_bdev_fd = dev->fd;
> +	btp->bt_dev = dev->dev;
> +	btp->bt_fd = dev->fd;
>  	btp->bt_xfile = NULL;
>  	btp->flags = 0;
>  	pthread_mutex_init(&btp->lock, NULL);
> @@ -534,7 +534,7 @@ libxfs_buftarg_reinit(
>  	struct xfs_mount	*mp,
>  	struct libxfs_init	*xi)
>  {
> -	if (mp->m_ddev_targp->bt_bdev != xi->data.dev ||
> +	if (mp->m_ddev_targp->bt_dev != xi->data.dev ||
>  	    mp->m_ddev_targp->bt_mount != mp) {
>  		fprintf(stderr,
>  			_("%s: bad buftarg reinit, ddev\n"),
> @@ -544,7 +544,7 @@ libxfs_buftarg_reinit(
>  
>  	if (mp->m_logdev_targp != mp->m_ddev_targp) {
>  		if ((xi->log.dev && xi->log.dev == xi->data.dev) ||
> -		    mp->m_logdev_targp->bt_bdev != xi->log.dev ||
> +		    mp->m_logdev_targp->bt_dev != xi->log.dev ||
>  		    mp->m_logdev_targp->bt_mount != mp) {
>  			fprintf(stderr,
>  				_("%s: bad buftarg reinit, logdev\n"),
> @@ -554,7 +554,7 @@ libxfs_buftarg_reinit(
>  	}
>  
>  	if (mp->m_rtdev_targp && mp->m_rtdev_targp != mp->m_ddev_targp) {
> -		if (mp->m_rtdev_targp->bt_bdev != xi->rt.dev ||
> +		if (mp->m_rtdev_targp->bt_dev != xi->rt.dev ||
>  		    mp->m_rtdev_targp->bt_mount != mp) {
>  			fprintf(stderr,
>  				_("%s: bad buftarg reinit, rtdev\n"),
> diff --git a/libxfs/libxfs_io.h b/libxfs/libxfs_io.h
> index 5562e2928254..d861763a2a63 100644
> --- a/libxfs/libxfs_io.h
> +++ b/libxfs/libxfs_io.h
> @@ -25,8 +25,8 @@ struct xfs_buftarg {
>  	struct xfs_mount	*bt_mount;
>  	pthread_mutex_t		lock;
>  	unsigned long		writes_left;
> -	dev_t			bt_bdev;
> -	int			bt_bdev_fd;
> +	dev_t			bt_dev;
> +	int			bt_fd;
>  	struct xfile		*bt_xfile;
>  	unsigned int		flags;
>  	struct cache		*bcache;	/* buffer cache */
> diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c
> index 14cfec7a2859..837288be0307 100644
> --- a/libxfs/rdwr.c
> +++ b/libxfs/rdwr.c
> @@ -62,7 +62,7 @@ static void libxfs_brelse(struct cache_node *node);
>  int
>  libxfs_device_zero(struct xfs_buftarg *btp, xfs_daddr_t start, uint len)
>  {
> -	int		fd = btp->bt_bdev_fd;
> +	int		fd = btp->bt_fd;
>  	xfs_off_t	start_offset, end_offset, offset;
>  	ssize_t		zsize, bytes;
>  	size_t		len_bytes;
> @@ -608,7 +608,7 @@ int
>  libxfs_readbufr(struct xfs_buftarg *btp, xfs_daddr_t blkno, struct xfs_buf *bp,
>  		int len, int flags)
>  {
> -	int	fd = btp->bt_bdev_fd;
> +	int	fd = btp->bt_fd;
>  	int	bytes = BBTOB(len);
>  	int	error;
>  
> @@ -644,7 +644,7 @@ libxfs_readbuf_verify(
>  int
>  libxfs_readbufr_map(struct xfs_buftarg *btp, struct xfs_buf *bp, int flags)
>  {
> -	int	fd = btp->bt_bdev_fd;
> +	int	fd = btp->bt_fd;
>  	int	error = 0;
>  	void	*buf;
>  	int	i;
> @@ -834,7 +834,7 @@ int
>  libxfs_bwrite(
>  	struct xfs_buf	*bp)
>  {
> -	int		fd = bp->b_target->bt_bdev_fd;
> +	int		fd = bp->b_target->bt_fd;
>  
>  	/*
>  	 * we never write buffers that are marked stale. This indicates they
> @@ -1109,10 +1109,10 @@ libxfs_blkdev_issue_flush(
>  {
>  	int			ret;
>  
> -	if (btp->bt_bdev == 0)
> +	if (btp->bt_dev == 0)
>  		return 0;
>  
> -	ret = platform_flush_device(btp->bt_bdev_fd, btp->bt_bdev);
> +	ret = platform_flush_device(btp->bt_fd, btp->bt_dev);
>  	return ret ? -errno : 0;
>  }
>  
> diff --git a/repair/prefetch.c b/repair/prefetch.c
> index 3d26636e5e56..3e03ae7f0210 100644
> --- a/repair/prefetch.c
> +++ b/repair/prefetch.c
> @@ -878,7 +878,7 @@ init_prefetch(
>  	xfs_mount_t		*pmp)
>  {
>  	mp = pmp;
> -	mp_fd = mp->m_ddev_targp->bt_bdev_fd;;
> +	mp_fd = mp->m_ddev_targp->bt_fd;;
>  	pf_max_bytes = sysconf(_SC_PAGE_SIZE) << 7;
>  	pf_max_bbs = pf_max_bytes >> BBSHIFT;
>  	pf_max_fsbs = pf_max_bytes >> mp->m_sb.sb_blocklog;
> diff --git a/repair/zoned.c b/repair/zoned.c
> index 6ab91371d95a..1e949f549583 100644
> --- a/repair/zoned.c
> +++ b/repair/zoned.c
> @@ -50,7 +50,7 @@ void
>  check_zones(
>  	struct xfs_mount	*mp)
>  {
> -	int			fd = mp->m_rtdev_targp->bt_bdev_fd;
> +	int			fd = mp->m_rtdev_targp->bt_fd;
>  	uint64_t		sector = XFS_FSB_TO_BB(mp, mp->m_sb.sb_rtstart);
>  	unsigned int		zone_size, zone_capacity;
>  	uint64_t		device_size;
> -- 
> 2.53.0
> 
> 

  reply	other threads:[~2026-09-25 22:43 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-25  5:12 fix missing RT detection in libxfs v2 Christoph Hellwig
2026-09-25  5:12 ` [PATCH 01/10] libxfs: refactor the reinit case in libxfs_buftarg_init Christoph Hellwig
2026-09-25 22:32   ` Darrick J. Wong
2026-09-25  5:12 ` [PATCH 02/10] libxfs: split error injection option parsing out of libxfs_buftarg_init Christoph Hellwig
2026-09-25 22:33   ` Darrick J. Wong
2026-09-25  5:12 ` [PATCH 03/10] libxfs: remove buftarg member aliases Christoph Hellwig
2026-09-25  5:12 ` [PATCH 04/10] libxfs: unify buftarg handling with the kernel Christoph Hellwig
2026-09-25 22:37   ` Darrick J. Wong
2026-09-26  5:59     ` Christoph Hellwig
2026-09-27 15:18       ` Darrick J. Wong
2026-09-25  5:12 ` [PATCH 05/10] libxfs: make the size check in rtmount_init internal RT device aware Christoph Hellwig
2026-09-25 22:38   ` Darrick J. Wong
2026-09-25  5:12 ` [PATCH 06/10] libxfs: don't clear ->dev in libxfs_device_close Christoph Hellwig
2026-09-25 22:39   ` Darrick J. Wong
2026-09-25  5:12 ` [PATCH 07/10] libxfs: fix buftarg initialization for the RT device Christoph Hellwig
2026-09-25 22:42   ` Darrick J. Wong
2026-09-25  5:12 ` [PATCH 08/10] libxfs: rename bt_bdev* Christoph Hellwig
2026-09-25 22:43   ` Darrick J. Wong [this message]
2026-09-25  5:12 ` [PATCH 09/10] libfrog: improve ramdisk handling in platform_flush_device Christoph Hellwig
2026-09-25 22:47   ` Darrick J. Wong
2026-09-26  6:02     ` Christoph Hellwig
2026-09-27 15:22       ` Darrick J. Wong
2026-09-25  5:12 ` [PATCH 10/10] xfs_db: remove a double-whitespace in rdump_regfile_data Christoph Hellwig
2026-09-25 22:47   ` Darrick J. Wong

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=20260925224302.GW2705364@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=aalbersh@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-xfs@vger.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.