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: 13256537 X-Patchwork-Delegate: snitzer@redhat.com 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 us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BE79AC77B7C for ; Fri, 26 May 2023 07:34:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685086456; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=7d5oUS6sLa6outalDlp67Iqjq6em62IVCr4sMj7H2rg=; b=R8VX84kNbDmtfFbE1iYyAWIl065D9LQY1Ytt3ES/LLyQOF7MO60NtVSZn2ztS61UdPGOzX d2EeiZL4zVc+zH1GiVEvir5mZq760oZyYI5fNctgJy5QhKuQDhSQmTSJjO70i9mDWmRsjB N3HcNKtxlZtaTpTmuYoT5Kx4KbgQF/4= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-493-SrVjOC9lO16KcOyBZVBz7Q-1; Fri, 26 May 2023 03:34:13 -0400 X-MC-Unique: SrVjOC9lO16KcOyBZVBz7Q-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2FD5F3803508; Fri, 26 May 2023 07:34:11 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D0E35C0004B; Fri, 26 May 2023 07:34:10 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id CBA2419465A4; Fri, 26 May 2023 07:34:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 50F5619465A0 for ; Fri, 26 May 2023 07:33:47 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 98A4BC154D2; Fri, 26 May 2023 07:33:47 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8F78EC154D1 for ; Fri, 26 May 2023 07:33:47 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6F31D811E8E for ; Fri, 26 May 2023 07:33:47 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-614-3l4FbPZCOg676_U7mr3Ujg-1; Fri, 26 May 2023 03:33:45 -0400 X-MC-Unique: 3l4FbPZCOg676_U7mr3Ujg-1 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 Date: Fri, 26 May 2023 00:33:33 -0700 Message-Id: <20230526073336.344543-3-mcgrof@kernel.org> In-Reply-To: <20230526073336.344543-1-mcgrof@kernel.org> References: <20230526073336.344543-1-mcgrof@kernel.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 Subject: [dm-devel] [PATCH v2 2/5] drbd: use PAGE_SECTORS_SHIFT and PAGE_SECTORS X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: p.raghav@samsung.com, linux-xfs@vger.kernel.org, rohan.puri@samsung.com, da.gomez@samsung.com, mcgrof@kernel.org, patches@lists.linux.dev, willy@infradead.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, rpuri.linux@gmail.com, kbusch@kernel.org, drbd-dev@lists.linbit.com Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: kernel.org 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;