From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Carlos Maiolino <cem@kernel.org>,
John Garry <john.g.garry@oracle.com>,
linux-xfs@vger.kernel.org
Subject: Re: [PATCH 5/7] xfs: rename the bt_bdev_* buftarg fields
Date: Tue, 1 Jul 2025 09:45:11 -0700 [thread overview]
Message-ID: <20250701164511.GH10009@frogsfrogsfrogs> (raw)
In-Reply-To: <20250701104125.1681798-6-hch@lst.de>
On Tue, Jul 01, 2025 at 12:40:39PM +0200, Christoph Hellwig wrote:
> The extra bdev_ is weird, so drop it. Also improve the comment to make
> it clear these are the hardware limits.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Looks fine, thanks for the clarification in the xfs_buftarg definition
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
--D
> ---
> fs/xfs/xfs_buf.c | 4 ++--
> fs/xfs/xfs_buf.h | 6 +++---
> fs/xfs/xfs_file.c | 2 +-
> fs/xfs/xfs_inode.h | 2 +-
> fs/xfs/xfs_iomap.c | 2 +-
> fs/xfs/xfs_iops.c | 2 +-
> fs/xfs/xfs_mount.c | 2 +-
> 7 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
> index 7a05310da895..661f6c70e9d0 100644
> --- a/fs/xfs/xfs_buf.c
> +++ b/fs/xfs/xfs_buf.c
> @@ -1712,8 +1712,8 @@ xfs_configure_buftarg_atomic_writes(
> max_bytes = 0;
> }
>
> - btp->bt_bdev_awu_min = min_bytes;
> - btp->bt_bdev_awu_max = max_bytes;
> + btp->bt_awu_min = min_bytes;
> + btp->bt_awu_max = max_bytes;
> }
>
> /* Configure a buffer target that abstracts a block device. */
> diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h
> index 73a9686110e8..7987a6d64874 100644
> --- a/fs/xfs/xfs_buf.h
> +++ b/fs/xfs/xfs_buf.h
> @@ -112,9 +112,9 @@ struct xfs_buftarg {
> struct percpu_counter bt_readahead_count;
> struct ratelimit_state bt_ioerror_rl;
>
> - /* Atomic write unit values, bytes */
> - unsigned int bt_bdev_awu_min;
> - unsigned int bt_bdev_awu_max;
> + /* Hardware atomic write unit values, bytes */
> + unsigned int bt_awu_min;
> + unsigned int bt_awu_max;
>
> /* built-in cache, if we're not using the perag one */
> struct xfs_buf_cache bt_cache[];
> diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
> index 48254a72071b..377fc9077781 100644
> --- a/fs/xfs/xfs_file.c
> +++ b/fs/xfs/xfs_file.c
> @@ -752,7 +752,7 @@ xfs_file_dio_write_atomic(
> * HW offload should be faster, so try that first if it is already
> * known that the write length is not too large.
> */
> - if (ocount > xfs_inode_buftarg(ip)->bt_bdev_awu_max)
> + if (ocount > xfs_inode_buftarg(ip)->bt_awu_max)
> dops = &xfs_atomic_write_cow_iomap_ops;
> else
> dops = &xfs_direct_write_iomap_ops;
> diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
> index d7e2b902ef5c..07fbdcc4cbf5 100644
> --- a/fs/xfs/xfs_inode.h
> +++ b/fs/xfs/xfs_inode.h
> @@ -358,7 +358,7 @@ static inline bool xfs_inode_has_bigrtalloc(const struct xfs_inode *ip)
>
> static inline bool xfs_inode_can_hw_atomic_write(const struct xfs_inode *ip)
> {
> - return xfs_inode_buftarg(ip)->bt_bdev_awu_max > 0;
> + return xfs_inode_buftarg(ip)->bt_awu_max > 0;
> }
>
> /*
> diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
> index ff05e6b1b0bb..ec30b78bf5c4 100644
> --- a/fs/xfs/xfs_iomap.c
> +++ b/fs/xfs/xfs_iomap.c
> @@ -827,7 +827,7 @@ xfs_bmap_hw_atomic_write_possible(
> /*
> * The ->iomap_begin caller should ensure this, but check anyway.
> */
> - return len <= xfs_inode_buftarg(ip)->bt_bdev_awu_max;
> + return len <= xfs_inode_buftarg(ip)->bt_awu_max;
> }
>
> static int
> diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
> index 8cddbb7c149b..01e597290eb5 100644
> --- a/fs/xfs/xfs_iops.c
> +++ b/fs/xfs/xfs_iops.c
> @@ -665,7 +665,7 @@ xfs_get_atomic_write_max_opt(
> * less than our out of place write limit, but we don't want to exceed
> * the awu_max.
> */
> - return min(awu_max, xfs_inode_buftarg(ip)->bt_bdev_awu_max);
> + return min(awu_max, xfs_inode_buftarg(ip)->bt_awu_max);
> }
>
> static void
> diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
> index 99fbb22bad4c..0b690bc119d7 100644
> --- a/fs/xfs/xfs_mount.c
> +++ b/fs/xfs/xfs_mount.c
> @@ -699,7 +699,7 @@ xfs_calc_group_awu_max(
>
> if (g->blocks == 0)
> return 0;
> - if (btp && btp->bt_bdev_awu_min > 0)
> + if (btp && btp->bt_awu_min > 0)
> return max_pow_of_two_factor(g->blocks);
> return rounddown_pow_of_two(g->blocks);
> }
> --
> 2.47.2
>
>
next prev parent reply other threads:[~2025-07-01 16:45 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-01 10:40 misc cleanups v2 Christoph Hellwig
2025-07-01 10:40 ` [PATCH 1/7] xfs: clean up the initial read logic in xfs_readsb Christoph Hellwig
2025-07-01 16:43 ` Darrick J. Wong
2025-07-01 10:40 ` [PATCH 2/7] xfs: remove the call to sync_blockdev in xfs_configure_buftarg Christoph Hellwig
2025-07-01 10:53 ` John Garry
2025-07-01 11:03 ` John Garry
2025-07-03 13:42 ` Christoph Hellwig
2025-07-01 10:40 ` [PATCH 3/7] xfs: add a xfs_group_type_buftarg helper Christoph Hellwig
2025-07-01 11:05 ` John Garry
2025-07-01 16:43 ` Darrick J. Wong
2025-07-01 10:40 ` [PATCH 4/7] xfs: refactor xfs_calc_atomic_write_unit_max Christoph Hellwig
2025-07-01 16:53 ` Darrick J. Wong
2025-07-01 10:40 ` [PATCH 5/7] xfs: rename the bt_bdev_* buftarg fields Christoph Hellwig
2025-07-01 10:54 ` John Garry
2025-07-01 16:45 ` Darrick J. Wong [this message]
2025-07-01 10:40 ` [PATCH 6/7] xfs: remove the bt_bdev_file buftarg field Christoph Hellwig
2025-07-01 11:09 ` John Garry
2025-07-01 16:46 ` Darrick J. Wong
2025-07-01 10:40 ` [PATCH 7/7] xfs: remove the bt_meta_sectorsize field in struct buftarg Christoph Hellwig
2025-07-01 16:51 ` Darrick J. Wong
2025-07-01 22:55 ` Dave Chinner
2025-07-03 13:44 ` Christoph Hellwig
-- strict thread matches above, loose matches on Subject: below --
2025-06-17 10:51 misc cleanups Christoph Hellwig
2025-06-17 10:52 ` [PATCH 5/7] xfs: rename the bt_bdev_* buftarg fields Christoph Hellwig
2025-06-17 12:02 ` John Garry
2025-06-18 5:10 ` Christoph Hellwig
2025-06-18 6:23 ` John Garry
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=20250701164511.GH10009@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=cem@kernel.org \
--cc=hch@lst.de \
--cc=john.g.garry@oracle.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox