[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5a26cdb1-b63b-8d35-640b-bc0e0f78a181@linbit.com>
Date: Sat, 9 Apr 2022 10:16:58 +0200
From: Christoph Böhmwalder
<christoph.boehmwalder@...bit.com>
To: Christoph Hellwig <hch@....de>
Cc: jfs-discussion@...ts.sourceforge.net,
linux-nvme@...ts.infradead.org,
virtualization@...ts.linux-foundation.org, linux-mm@...ck.org,
dm-devel@...hat.com, target-devel@...r.kernel.org,
linux-mtd@...ts.infradead.org, drbd-dev@...ts.linbit.com,
linux-s390@...r.kernel.org, linux-nilfs@...r.kernel.org,
linux-scsi@...r.kernel.org, cluster-devel@...hat.com,
xen-devel@...ts.xenproject.org, linux-ext4@...r.kernel.org,
linux-um@...ts.infradead.org, nbd@...er.debian.org,
linux-block@...r.kernel.org, linux-bcache@...r.kernel.org,
ceph-devel@...r.kernel.org, linux-raid@...r.kernel.org,
linux-mmc@...r.kernel.org, linux-f2fs-devel@...ts.sourceforge.net,
linux-xfs@...r.kernel.org, ocfs2-devel@....oracle.com,
linux-fsdevel@...r.kernel.org, ntfs3@...ts.linux.dev,
linux-btrfs@...r.kernel.org, Jens Axboe <axboe@...nel.dk>
Subject: Re: [Drbd-dev] [PATCH 04/27] drbd: remove assign_p_sizes_qlim
On 09.04.22 06:50, Christoph Hellwig wrote:
> Fold each branch into its only caller.
>
> Signed-off-by: Christoph Hellwig <hch@....de>
> ---
> drivers/block/drbd/drbd_main.c | 47 +++++++++++++++-------------------
> 1 file changed, 20 insertions(+), 27 deletions(-)
>
> diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
> index 9676a1d214bc5..1262fe1c33618 100644
> --- a/drivers/block/drbd/drbd_main.c
> +++ b/drivers/block/drbd/drbd_main.c
> @@ -903,31 +903,6 @@ void drbd_gen_and_send_sync_uuid(struct drbd_peer_device *peer_device)
> }
> }
>
> -/* communicated if (agreed_features & DRBD_FF_WSAME) */
> -static void
> -assign_p_sizes_qlim(struct drbd_device *device, struct p_sizes *p,
> - struct request_queue *q)
> -{
> - if (q) {
> - p->qlim->physical_block_size = cpu_to_be32(queue_physical_block_size(q));
> - p->qlim->logical_block_size = cpu_to_be32(queue_logical_block_size(q));
> - p->qlim->alignment_offset = cpu_to_be32(queue_alignment_offset(q));
> - p->qlim->io_min = cpu_to_be32(queue_io_min(q));
> - p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
> - p->qlim->discard_enabled = blk_queue_discard(q);
> - p->qlim->write_same_capable = 0;
> - } else {
> - q = device->rq_queue;
> - p->qlim->physical_block_size = cpu_to_be32(queue_physical_block_size(q));
> - p->qlim->logical_block_size = cpu_to_be32(queue_logical_block_size(q));
> - p->qlim->alignment_offset = 0;
> - p->qlim->io_min = cpu_to_be32(queue_io_min(q));
> - p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
> - p->qlim->discard_enabled = 0;
> - p->qlim->write_same_capable = 0;
> - }
> -}
> -
> int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enum dds_flags flags)
> {
> struct drbd_device *device = peer_device->device;
> @@ -957,14 +932,32 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
> q_order_type = drbd_queue_order_type(device);
> max_bio_size = queue_max_hw_sectors(q) << 9;
> max_bio_size = min(max_bio_size, DRBD_MAX_BIO_SIZE);
> - assign_p_sizes_qlim(device, p, q);
> + p->qlim->physical_block_size =
> + cpu_to_be32(queue_physical_block_size(q));
> + p->qlim->logical_block_size =
> + cpu_to_be32(queue_logical_block_size(q));
> + p->qlim->alignment_offset =
> + cpu_to_be32(queue_alignment_offset(q));
> + p->qlim->io_min = cpu_to_be32(queue_io_min(q));
> + p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
> + p->qlim->discard_enabled = blk_queue_discard(q);
> put_ldev(device);
> } else {
> + struct request_queue *q = device->rq_queue;
> +
> + p->qlim->physical_block_size =
> + cpu_to_be32(queue_physical_block_size(q));
> + p->qlim->logical_block_size =
> + cpu_to_be32(queue_logical_block_size(q));
> + p->qlim->alignment_offset = 0;
> + p->qlim->io_min = cpu_to_be32(queue_io_min(q));
> + p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
> + p->qlim->discard_enabled = 0;
> +
> d_size = 0;
> u_size = 0;
> q_order_type = QUEUE_ORDERED_NONE;
> max_bio_size = DRBD_MAX_BIO_SIZE; /* ... multiple BIOs per peer_request */
> - assign_p_sizes_qlim(device, p, NULL);
> }
>
> if (peer_device->connection->agreed_pro_version <= 94)
LGTM now, thanks.
Acked-by: Christoph Böhmwalder <christoph.boehmwalder@...bit.com>
Powered by blists - more mailing lists