From patchwork Fri Sep 15 22:43:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13387798 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 D2EB1CD37AE for ; Fri, 15 Sep 2023 22:44:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6FFB58D0041; Fri, 15 Sep 2023 18:43:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6AF1A8D003B; Fri, 15 Sep 2023 18:43:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4DB008D0041; Fri, 15 Sep 2023 18:43:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 38A0F8D003B for ; Fri, 15 Sep 2023 18:43:56 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 13910140B83 for ; Fri, 15 Sep 2023 22:43:56 +0000 (UTC) X-FDA: 81240310872.21.6612B88 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf18.hostedemail.com (Postfix) with ESMTP id 244311C0006 for ; Fri, 15 Sep 2023 22:43:52 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b="ipX40f4/"; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=none); spf=none (imf18.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=1694817833; 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=kAhu3RhQYAb+8x8i6cEfQIaFhfRyBt/UYtL6yvE2uiU=; b=FsHNx+F2TZlaMvj/QCRfR9s0czdrtRrrwvpUa/FUF4chV193pBc0NEVosKHMMJjltjawIR oLz3mU/86o1eq/3MecNgrQhCKNRLKTd3YDjOvqOrfvSM2X4bDHb461IoetA995jOBeFabh sSqR4eP76WSdc6mjlue69tnCzQils3A= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b="ipX40f4/"; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=none); spf=none (imf18.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=1694817833; a=rsa-sha256; cv=none; b=KovQnSkqXrJyaqYpxatJtitEjWVmr3/LJA4Qdwr0Xr1PFG1InZzEuSg8RLiUNThqpBQFXD j4w1OBpUZ3gky1RBId6WArVplyz2m9oEWM8Brfhwguv439iYj+ENLsUIg7ov5lXbPWQ5pX 8rNoH068SxvE3TSKqmDSydk8m7Bn7ss= 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 X-Rspam-User: X-Stat-Signature: 41paic8sr1y3d57mo9ufnqbuq4x3tj59 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 244311C0006 X-HE-Tag: 1694817832-324798 X-HE-Meta: U2Fs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J0DNip+CEtDMgWH9j0pyXtLNCnmTf08sk1AXBe8sj+fITZUO7oDReCwBhShBElE1YZDCcR09tmr5KpjXGRtelk7t23dreKyMhPE/0ET2pFAb6Rs2DYoQywMXyrTY+qe5/yEI8h6AIyibvZhIRRpqN6A5uboN6c3UckkWscOUdPeYctAwzM+PW10Dt0x1N7VCtPyTA/954wq9n4EHu77NTov1PjYzaffK5+FGiBRbM3nnsN9ImmW6weP9WbqHPwR/7AtfF1gRS3pUTalx/SlWDlaguoKtne6nnI+ItOtFIevLEyYJbFtxY6YEPJu4bm2r2/lWwzCQg2l7N+8nNfp5SffXtRUjutQPy91Z8xK890RKJPo55dM5cSLeaBhQJ7HWN4xr6Qv0QwOvCIV2yebssbBQdnW65AZBIM/+Km/ELEvDfGgI9sJZ0qZCIM8wbU5ZlApIMMu6G+U2FKBDqOQbhZX15AdYN2uxTjXzpt2H7RwQQWH7YIOymG91RtQKizb9WOJxsBxRl2bl81TSZhjd/g1mHNTIoV0zQ+TT403eRlhJ1MvU= 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 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;