From patchwork Fri May 26 07:33:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13256516 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2649C77B7C for ; Fri, 26 May 2023 07:33:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 02897900007; Fri, 26 May 2023 03:33:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CF2DC900004; Fri, 26 May 2023 03:33:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A3084900006; Fri, 26 May 2023 03:33:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 516A1900005 for ; Fri, 26 May 2023 03:33:49 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 18DC3160DAF for ; Fri, 26 May 2023 07:33:49 +0000 (UTC) X-FDA: 80831591778.11.9707EEB Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf28.hostedemail.com (Postfix) with ESMTP id 0BFB6C0013 for ; Fri, 26 May 2023 07:33:45 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=xIU9TLdn; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=none); spf=none (imf28.hostedemail.com: domain of mcgrof@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=mcgrof@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685086427; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=RQzHrIRCFqHArqIrnKCyvyHklB4zdcXT4MP2qOnLDko=; b=d7Mx4oQM1ImEAEDeR6Esnrq6qxWra0B8iaYH14bMSKiceq8u5imwvOUfMeUWXfGNuceC/l q9XHplVASEFt8XCpJaOSCyraQtx5vLxqY9brb+oiMdHnrgQ7L9292oDQLLqRewQfCt2slx /94pRAhnC5gUtU78lPglXHTmchcEk24= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=xIU9TLdn; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=none); spf=none (imf28.hostedemail.com: domain of mcgrof@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=mcgrof@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685086427; a=rsa-sha256; cv=none; b=kOeV4vDvpX0sjQ9JA3szdO0i7n8Cmu9Kx41KfGayIMebXtdRmD+IkyBal+um6BlSF1Vuel EUBFUzNHtmZMAqOsERypmIuSzD0MezSrbzANQlCICqFx0rymYROdUkvU2wgx/1bI8gjXs+ SDHq4Ev2gztyct7ySRJ7NzrOYyk2D5M= 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 X-Rspamd-Queue-Id: 0BFB6C0013 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: ih5476riboyh67c47kfcrwuusn4uifqn X-HE-Tag: 1685086425-433133 X-HE-Meta: U2FsdGVkX1/A4aQXyjTB2EUGcd9Swo4bT6hzgfe2iiDmLy/nXPvC+m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ePbsNC24drgHbqImZXprndxq6p66/KZljBS2DW3/1/lMfzRl0CdaNYYG7/sYJvYy5JqEhM4ToARYKBLaZgbjx5fIZkEpHcUP9XkTOAqgRhLpqGmN2Nl71WzAy8tCQxhy7KXbFFtI4bQDtvvrNxntekTzKq5JgQtbRuFHuWd+ecFAQltCQUfS6Iu+Eydt3EiGdrXqCdgxHBqsfZcOITeSG9LtNFJIbxXqfCs0KilJ5Ct26kxVf0pGlunhlIoCDkcj8rOAgF5LtrXIpukfRLaA0OQN7k2mcvdEGh1Z6omIOFWgBcxmphZJ4b846IE5BewArO9IvQtRPxqscu1/aMPiHGa/IR1gLhy5c3E9AXX94iBBTCjBRmYD2Qt/lWZn1jsLfu/aVAWxUKZWU86AYKQGSRA3ZyPs3hO4JdLhMcmgaoqD7RJky6G9XvOnHE= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Replace common constants with generic versions. This produces no functional changes. Acked-by: Christoph Böhmwalder Signed-off-by: Luis Chamberlain Reviewed-by: Johannes Thumshirn --- 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;