]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
xfs: rename the bt_bdev_* buftarg fields
authorChristoph Hellwig <hch@lst.de>
Mon, 7 Jul 2025 12:53:16 +0000 (14:53 +0200)
committerCarlos Maiolino <cem@kernel.org>
Tue, 8 Jul 2025 11:30:26 +0000 (13:30 +0200)
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>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_buf.c
fs/xfs/xfs_buf.h
fs/xfs/xfs_file.c
fs/xfs/xfs_inode.h
fs/xfs/xfs_iomap.c
fs/xfs/xfs_iops.c
fs/xfs/xfs_mount.c

index 558568f78514d17ddf1f4e56da2f11678f221e70..edae4733a72fd7b7ce0ca0f402848cda25a7a7f1 100644 (file)
@@ -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. */
index 73a9686110e8aefc019c1cb75d93de335997928a..7987a6d648746eabb09d1cf61944f424516d4c0c 100644 (file)
@@ -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[];
index 0b41b18debf36d9edb405accdb1ab47a6a781654..38e365b16348d8c2a20af75c4aedb3b379800c8b 100644 (file)
@@ -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;
index d7e2b902ef5c97242a2ccf765b6c0378374de111..07fbdcc4cbf582c25fabcd7746e3a54edb6fc7c9 100644 (file)
@@ -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;
 }
 
 /*
index ff05e6b1b0bbd27111e2ccfbc5177293910843d6..ec30b78bf5c4d9cfa88ac43081f7d478edb1db96 100644 (file)
@@ -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
index 8cddbb7c149bec5add19cfe6b3c0ca7afb9a9364..01e597290eb5d479d3f89cda58911895fb1e6976 100644 (file)
@@ -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
index 99fbb22bad4c8ef9c6961342711fb0070846fd62..0b690bc119d7caae1e33f03b7b0d038b2d856e6d 100644 (file)
@@ -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);
 }