Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2053502rwd; Fri, 26 May 2023 00:36:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4N+aTdqSRT0jOTxWg3fped2Wsn+w+tCOvpmWe9zaKwO89e8gLEntHFDrhP2PDmEj7bcV4G X-Received: by 2002:a05:6a00:3924:b0:646:74ce:a36c with SMTP id fh36-20020a056a00392400b0064674cea36cmr2255922pfb.8.1685086595343; Fri, 26 May 2023 00:36:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685086595; cv=none; d=google.com; s=arc-20160816; b=uTL13KFmWX1htWZmw4N9FNeu+OX9G4TCZ/W4v5QzPVVGZT3lGH6Q8ONHMdfKRw9YRH UaIK5Q2eMzgbRVHgVBywg/8x8lQvKInNDMNwP6n8efnlQPREPWGsGExvtMZXY9rp0R0f CDg2DJqK+CDjt6YJZnujQhiF+3nh09PzeArZTwtDd0+nHEveRt9s26/KLOZkh6mJj1J1 3/VId621QdwNUkCrhqy66qb+iOmMiG5aCXBXbPDQE3LGzSY0hhlIFt16MchgES9CQJYe WYwPdwMniOHlArvu/RRGLvS4IKYqLLcUT/iX34AG96ZDYQ0aTxvw/gAOlNwh/qj2m1zz 1gHA== 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=RQzHrIRCFqHArqIrnKCyvyHklB4zdcXT4MP2qOnLDko=; b=erC3yJ/Ra9aRPC5AaVE06D6fHvjBdM57duVEUohhDbfZ79XC4rCY6qZmZip+XFE2Up QZMoA/z7Ni7TquaFH/UUW3YsxJQcqRCM5E28jQ2wLmANGTSkzBszcpEluvGrdNqhB9HO YxMUU4DtxiTMDMa04TOA3pDDX6ESJzZ/CP9cMrgms5VhHua0C+mal1ge1du0Zbec39zu cUDwIAnzzwUQezULNpXzC8TfSfu+ZbrBEFjKCA4Mq0cikMOPL8B2K6vJ1+QInGJqpDDN lTWTQWAibnbABE9xlqBp7ZEc2pHCa+0DYHZDHwcZZSqXtD78Vmu7o7T+Wul4Mhs0YsW/ 6b7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=xIU9TLdn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i4-20020aa796e4000000b0063b7bb98251si3390285pfq.216.2023.05.26.00.36.21; Fri, 26 May 2023 00:36:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@infradead.org header.s=bombadil.20210309 header.b=xIU9TLdn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242476AbjEZHd7 (ORCPT + 99 others); Fri, 26 May 2023 03:33:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242422AbjEZHdo (ORCPT ); Fri, 26 May 2023 03:33:44 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B275CB6; Fri, 26 May 2023 00:33:43 -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=RQzHrIRCFqHArqIrnKCyvyHklB4zdcXT4MP2qOnLDko=; b=xIU9TLdnNYizB06PmvtzYlTdR5 HlTQdpKGeyyWACTTR95smi75XqDqgG9cDCVGjAOdZdR3m8BPT3TY8BNggYNMWsvJTYAI3fPk8ZdnX +BPgRSFHUYMlBkhvzll8T3HI/Xl9csNmtX8QKMKtP/iRaIPqnstKYFRv4S7XfWPyCylLC1KlvR72z xZm4OyGRiK0FlBL7bEZCD6oegED5VqaXt1eqNzYb6Rc3bdAejGjBTYfmdB5Mdvz6UDPn/5p642Nn9 5WC3HcP4OrbSccmqITnp/WDQKvQYcQr/4mAHruC7ragwNbVz4FX6+BYEFG0dF9uA91YTcz/4vzB+7 v43VXK/A==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1q2RxB-001RdT-0G; Fri, 26 May 2023 07:33:37 +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 Subject: [PATCH v2 2/5] drbd: use PAGE_SECTORS_SHIFT and PAGE_SECTORS Date: Fri, 26 May 2023 00:33:33 -0700 Message-Id: <20230526073336.344543-3-mcgrof@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230526073336.344543-1-mcgrof@kernel.org> References: <20230526073336.344543-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=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham 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-kernel@vger.kernel.org Replace common constants with generic versions. This produces no functional changes. Acked-by: Christoph Böhmwalder 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 6ac8c54b44c7..b556e6634f13 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