Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4912995rdb; Fri, 15 Sep 2023 17:01:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGbexXNLIlpoU8zbO0MXQZ74ZhFNJoSN74nungJVkxafjAfvO8Mr1V1I8bw1l1CGtP8t+8X X-Received: by 2002:a17:902:e845:b0:1c3:c5b5:8a83 with SMTP id t5-20020a170902e84500b001c3c5b58a83mr3727647plg.4.1694822509573; Fri, 15 Sep 2023 17:01:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694822509; cv=none; d=google.com; s=arc-20160816; b=ePA7MU7ZUG5l2jF0b6ZOag7/3uqfOZESEW7xNFd22iHL2DwwCZWEbvhvyf0GvAcCMf h5FO3rDjJ123HZkuxx4tcOd7hSfWur77IpZ56A08Q5nUrGu9+7vWZKzrPVhdwNCrTSzS zeI5K5GMj8baJn94P+ZWK6w0XMNFZwLaL2u3RJtwnmQ6yA70JmSSLyCLo0xch/N3H3gI ANDkGWOSBqXLmv5mt0k3l16zjHhXyDuVmkCJacYiWV+vilx0kRhP/4x1hkGag9AnaWFE HWmBbNTNPBtWj8bdsn3NdsNP0GevfRPEUemFuY+pm2eEKV/rMGf3L9oXPjmtvHf9by8D jO3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=kAhu3RhQYAb+8x8i6cEfQIaFhfRyBt/UYtL6yvE2uiU=; fh=1H2StbaJ3g7mOqD50YkBSaTBA4MwWRU9PAtnAGM1Vi8=; b=ekjQQguu21Y50U7Fy+rUuWnmKZVCw1U77wsdrkU+NrYIOmm4Whr21/OLS37w9L1xLH LsRYQxfoAOc77GeZUOR2GXBfNaEMehZ4OTKFRTwx1AB3tKStMtNSL370jtrzhJuNxRoq ysP35iyxhsnzbxl4HdygzKGs31Z55RnMMboWuAMI1q/ky+ZtnsDKlN4IXm2cgF1WY6an 793+Cxu0muzwr2vz1mg7pQnFH2/yc4NQ0nmbhXMgSQchdqiKLWeKjtL6ME0lU0+Wnj44 G9GxQVpNCk2j1KmBhfZhk1qARxEDprnXdO/Zp+Pdrl7AZuHxPxm6zYW1WxCy9a54BRmc Ez4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="ipX40f4/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id u10-20020a17090341ca00b001b89f653005si4384311ple.394.2023.09.15.17.01.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 17:01:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="ipX40f4/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id F21D58304362; Fri, 15 Sep 2023 15:49:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238174AbjIOWoV (ORCPT + 99 others); Fri, 15 Sep 2023 18:44:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238102AbjIOWn4 (ORCPT ); Fri, 15 Sep 2023 18:43:56 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37329271B; Fri, 15 Sep 2023 15:43:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description; bh=kAhu3RhQYAb+8x8i6cEfQIaFhfRyBt/UYtL6yvE2uiU=; b=ipX40f4//V/ZCGGZ4czyigk+tq Y1pEa4+9a0xgZHI9HB4D4Tfrictfi7SMy0XGAfRV739gQESHHurrBTlm5Ua+EE3iZV0tsx6IKqvwZ IiC6jCE6msF7T92DFE/znIds6/zZgcrifjXuvn0EcmNskZ6gPaGreeyH5rJC6lgqaAeL6P7rfVtkG DMPIuRQ+bZaIIBLKq7iwAyTitwD25b+3/vJUJ6ZlqhptkqgEUnJsMCFqyWqs7kD/j4JUp8wQpiPG0 Ac3VauQPjIuDinZl/qGvSMQdchK2QEx+UkGmAc0m6gGcpDATkelTsHLTVh8nggDwFVZd4JhiP4A92 z2qI6tpQ==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1qhHXM-00BUtM-2g; Fri, 15 Sep 2023 22:43:44 +0000 From: Luis Chamberlain To: axboe@kernel.dk, agk@redhat.com, snitzer@kernel.org, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, christoph.boehmwalder@linbit.com, hch@infradead.org, djwong@kernel.org, minchan@kernel.org, senozhatsky@chromium.org Cc: patches@lists.linux.dev, linux-block@vger.kernel.org, linux-mm@kvack.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, drbd-dev@lists.linbit.com, linux-kernel@vger.kernel.org, willy@infradead.org, hare@suse.de, p.raghav@samsung.com, da.gomez@samsung.com, rohan.puri@samsung.com, rpuri.linux@gmail.com, kbusch@kernel.org, mcgrof@kernel.org, Johannes Thumshirn Subject: [PATCH v3 1/4] drbd: use PAGE_SECTORS_SHIFT and PAGE_SECTORS Date: Fri, 15 Sep 2023 15:43:40 -0700 Message-Id: <20230915224343.2740317-2-mcgrof@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230915224343.2740317-1-mcgrof@kernel.org> References: <20230915224343.2740317-1-mcgrof@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: Luis Chamberlain X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 15 Sep 2023 15:49:24 -0700 (PDT) Replace common constants with generic versions. This produces no functional changes. Acked-by: Christoph Böhmwalder Reviewed-by: Johannes Thumshirn Signed-off-by: Luis Chamberlain --- drivers/block/drbd/drbd_bitmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c index 85ca000a0564..1a1782f55e61 100644 --- a/drivers/block/drbd/drbd_bitmap.c +++ b/drivers/block/drbd/drbd_bitmap.c @@ -1000,7 +1000,7 @@ static void bm_page_io_async(struct drbd_bm_aio_ctx *ctx, int page_nr) __must_ho unsigned int len; first_bm_sect = device->ldev->md.md_offset + device->ldev->md.bm_offset; - on_disk_sector = first_bm_sect + (((sector_t)page_nr) << (PAGE_SHIFT-SECTOR_SHIFT)); + on_disk_sector = first_bm_sect + (((sector_t)page_nr) << PAGE_SECTORS_SHIFT); /* this might happen with very small * flexible external meta data device, @@ -1008,7 +1008,7 @@ static void bm_page_io_async(struct drbd_bm_aio_ctx *ctx, int page_nr) __must_ho last_bm_sect = drbd_md_last_bitmap_sector(device->ldev); if (first_bm_sect <= on_disk_sector && last_bm_sect >= on_disk_sector) { sector_t len_sect = last_bm_sect - on_disk_sector + 1; - if (len_sect < PAGE_SIZE/SECTOR_SIZE) + if (len_sect < PAGE_SECTORS) len = (unsigned int)len_sect*SECTOR_SIZE; else len = PAGE_SIZE; -- 2.39.2