Received: by 2002:a05:6a10:144:0:0:0:0 with SMTP id 4csp1050765pxw; Sat, 9 Apr 2022 09:33:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/spSs72KV3uWh+uh+8dnHs4jJihfPor9esI0NSVTWnjOXRSxrivx1grm2IILO3PU4/yEC X-Received: by 2002:a17:907:86a7:b0:6e8:4a3c:33ed with SMTP id qa39-20020a17090786a700b006e84a3c33edmr8831758ejc.239.1649522011921; Sat, 09 Apr 2022 09:33:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649522011; cv=none; d=google.com; s=arc-20160816; b=g2UL8s7uFcbLEJatu1t68tOmGwnoO2ESVzyEBZCBC5o0Jny2E3gJUA7vqOtl4Xe6dp 9gMjzlkJfvgClYiXPOQmifzvaqck1ABqe0Wo4YAxN9EXea8W7hcO39c2q2A4yTpOEa5e 6ovuZ8TPwTzEEykm/uNlOczhNwjcSvVWZHievBCpBRB+KHBft7+EyFZoiWKwkk+2HR2X fQgK5WdgHP4ZwyU0E+HyzV2g//dFPUhcv04s8m4ITf5GrpETty04LiZHB1l+QHrQsuoA o3LffKkOmb0DSj4hSeUrLAp2HY2uGAJK7De3GeU9mKo5uo+l6OMv8t2GasGyJX82S1VQ eV8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Ga61vN/TMGQoWv5pdVva9yHEVEk7JvDu8SvkqTkiHOU=; b=pUw2bj2D3B5G1W+DB2kyPLs7T8qEyTuAi01DVEp5Tb7V4MvWOpPVWkvfgTFDf5ozqY 0w0KwEyGB1a23lui63vHGByGkyUo+h9kGI8ynvYBf/ZOxQS8vibROo8nmCqG1GtkXcfV vdY/6E0N1AFaR8SwxR5UvBLFK4WRqqnpXNBEb+gPPEOXe9utg5nVkUMuRE9G+x0p+CAj xXduh5QMeL9RkG1XoggQOJAYormCOrX5LxbZUifSdT7BGjkV5NT4iEzlCOMCD48HSkZh P4ML5GJpY/o/tSkH7zTyNJyc5kMBKkA65ikVrPFVd90WtolMG0Vn5ez+wYv8fDAlQ2cX EoDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linbit-com.20210112.gappssmtp.com header.s=20210112 header.b=16VWXfTc; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oz23-20020a170906cd1700b006e6de9b1be7si3025580ejb.825.2022.04.09.09.32.49; Sat, 09 Apr 2022 09:33:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linbit-com.20210112.gappssmtp.com header.s=20210112 header.b=16VWXfTc; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240614AbiDIITS (ORCPT + 99 others); Sat, 9 Apr 2022 04:19:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240756AbiDIITO (ORCPT ); Sat, 9 Apr 2022 04:19:14 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5107F2545B2 for ; Sat, 9 Apr 2022 01:17:03 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id i20so2933231wrb.13 for ; Sat, 09 Apr 2022 01:17:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linbit-com.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=Ga61vN/TMGQoWv5pdVva9yHEVEk7JvDu8SvkqTkiHOU=; b=16VWXfTcecI6vKD89hlxEi4M1sM+lDWraPFKcdJek4zYvKgcUI+UTTfswq4WTG3pUA DwGdvejVPHmGbB6WxyxpG5RxCDgxrI8ELqeSKx9xnWZSuDqFsfTR7C0q23UBJ4NTUUke 9rs/lGq9PScZMcSAS9SHkk+s8lIoFrVgzxTJ9NRLUES2XsBvbZXGJskPHSy0jdzHruaB iGqoe9YksSt5XleGcAhaVmv2OHki/8AO1/zdgDuyMqAmL6dyveVZDyPGB/rY+7+4UaaK b7o7nIN/SrEk1fy76OtZuySau99YX+Sryl6fYO8t+jUUvribl7KiF9nqytVWelfdH+Mk O4fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=Ga61vN/TMGQoWv5pdVva9yHEVEk7JvDu8SvkqTkiHOU=; b=iE8FZQouiovfab0Wvi1D6AEhY0YKShLBejYMhSy3fMhnFi32C3IYX8MDG7dzU+UFIy xiLgMHb9h3PlWeLfOAL6IGyRWythNb44fsg6cf0qcupVveLYOl8xuoOFHnDVbAtaNIu6 nevuf+TFIjF6P+M7z1IxIr8MPpGmTmphNCON8hGllp/Ikfce/uB0Q7ujPItmdYdIodOW Kn2bOgDcSKNLEVoyU+Nq7GOt3XTE8Dd4QKllkwtW4Cr2P/2Ow9UvoRnwnZz+mCyJbBFK lJIyliCdt6RhjdMvj51wmax0wnSm784QRLOTCt0sMsMdDUfvNM7CYD3PDC6JU5pliUTb aUfQ== X-Gm-Message-State: AOAM53188C+5IKmqCDfxpK7sYXxEvxntntjWcHOOMJN/iJovB/+WQfR1 bbZf48Z3E/eA4puUcST/+4mtWA== X-Received: by 2002:adf:9581:0:b0:1ed:c341:4ed1 with SMTP id p1-20020adf9581000000b001edc3414ed1mr16998132wrp.299.1649492221449; Sat, 09 Apr 2022 01:17:01 -0700 (PDT) Received: from [192.168.169.127] (178.115.52.210.wireless.dyn.drei.com. [178.115.52.210]) by smtp.gmail.com with ESMTPSA id r14-20020a05600c35ce00b0038c9f469979sm12169802wmq.40.2022.04.09.01.16.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 09 Apr 2022 01:17:01 -0700 (PDT) Message-ID: <5a26cdb1-b63b-8d35-640b-bc0e0f78a181@linbit.com> Date: Sat, 9 Apr 2022 10:16:58 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: Re: [Drbd-dev] [PATCH 04/27] drbd: remove assign_p_sizes_qlim Content-Language: en-US To: Christoph Hellwig Cc: jfs-discussion@lists.sourceforge.net, linux-nvme@lists.infradead.org, virtualization@lists.linux-foundation.org, linux-mm@kvack.org, dm-devel@redhat.com, target-devel@vger.kernel.org, linux-mtd@lists.infradead.org, drbd-dev@lists.linbit.com, linux-s390@vger.kernel.org, linux-nilfs@vger.kernel.org, linux-scsi@vger.kernel.org, cluster-devel@redhat.com, xen-devel@lists.xenproject.org, linux-ext4@vger.kernel.org, linux-um@lists.infradead.org, nbd@other.debian.org, linux-block@vger.kernel.org, linux-bcache@vger.kernel.org, ceph-devel@vger.kernel.org, linux-raid@vger.kernel.org, linux-mmc@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-xfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-fsdevel@vger.kernel.org, ntfs3@lists.linux.dev, linux-btrfs@vger.kernel.org, Jens Axboe References: <20220409045043.23593-1-hch@lst.de> <20220409045043.23593-5-hch@lst.de> From: =?UTF-8?Q?Christoph_B=c3=b6hmwalder?= In-Reply-To: <20220409045043.23593-5-hch@lst.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On 09.04.22 06:50, Christoph Hellwig wrote: > Fold each branch into its only caller. > > Signed-off-by: Christoph Hellwig > --- > 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