Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2716997rwr; Fri, 21 Apr 2023 12:59:04 -0700 (PDT) X-Google-Smtp-Source: AKy350Z+TnoNSPZvGNB/nlFylH/47f83REmiPk02IUHaPlyd6M1ZSDNWnrE9VkWFcBGqv8yx3fou X-Received: by 2002:a05:6a20:548c:b0:f2:fe5a:d471 with SMTP id i12-20020a056a20548c00b000f2fe5ad471mr29414pzk.5.1682107144468; Fri, 21 Apr 2023 12:59:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682107144; cv=none; d=google.com; s=arc-20160816; b=v584up3H2ADjIX0FyaIcSWyeTi29o349y8RSbwW+1NMsB1QPjpE4VQYCBTnLnM9wAf f+RyzPod/sAnu9zRD+iyQ0zDisUlMI/9GQUh0P5rPPLjWIBqnfMPDqx0KhWny080gd6g 13904hBIZpa0mKcgFgtk/gmd6bSCMbIf+b5fJe8XoVB9bf/Xt0BR1KLLdDLHgntYfJWP 0Qjb2ubnh9lOlJ5xQ42dNDymWrdg03KcLgxlQkrT1ACuZQq9287mOUXTdDbAIX9gES8W gY/92F51rjNRTIF4aOCrWjiA8N4Z1s+hPXgSAh01BflUVXR2BYUmSDNTXzcRkHkB7KkM 3iBg== 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=YNaeywPG0hf9vLC0oGzgXUzMq14M1rf2z1Pu3jCjc18=; b=AYs5foMlPrWEKtWtEgQJbKjoSsnKQXtNske+lJLkJHce8HKZVVTkLiCQUNEI92KNDF K99zXLaCrNXL4zNU3+KKBnLPplStUu5ie0Qa5nBwpeLEmIggekDnuJXYfmZ6Qdhvn3lG 0wR7dE+v+syM9oVWpbb0mJqpK49yHl1hOmU6xSUPqFLZr/Av6YTIDnI4CMVliJs9JNyt sUeNHlPB6QPvK8mfzGcL72j2KPw2VFj8s+SRQpZjLakgSKB+eY0LRMMc/m+mLYTvFD27 XMD5VkPqBwMBeDGJR8vjhD12bJXYWocwgZ5Ngd2+YRRbRpyr0FVc/ajtdBtvAh0RDtj/ PT+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=ngzYAuBK; 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 z19-20020a63e113000000b00521e4b138fcsi5254933pgh.148.2023.04.21.12.58.53; Fri, 21 Apr 2023 12:59:04 -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=ngzYAuBK; 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 S233659AbjDUT62 (ORCPT + 99 others); Fri, 21 Apr 2023 15:58:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233259AbjDUT6Y (ORCPT ); Fri, 21 Apr 2023 15:58:24 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 339C72D49; Fri, 21 Apr 2023 12:58:15 -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: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=YNaeywPG0hf9vLC0oGzgXUzMq14M1rf2z1Pu3jCjc18=; b=ngzYAuBKDLAoLCg9a3fSYyxaF7 Psmp6RNidLp/Hoz9Sz3Yaw4hJW6ICtW0d4gYHRtDbEVmUURusmziBCiUS8bTLXRjIGpepiBVYvy4V AwpjQ3WoHeBlc3DLTnq8Mlk6ISbisM8Dq/dyJwP58qth31M8tqk7cOBV5m4mcx0Eb3/Yq37hx40Q1 sTKkHJsz0qslYzsxgNwgcjkPJnjnr4qcRujKf1sQeDcoSvwEN+/9SSuTrxHTTWDLBYGm0TSLjdm/O l/CPxIM1wE772UFBPe1DRj82PuNz0beeob2viWswsRu9DrjB2lpvHI+yRXpn9Gc4ldGRFkXpKwslh E2nlol0A==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1ppwtU-00BlaZ-1j; Fri, 21 Apr 2023 19:58:08 +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, kbusch@kernel.org, mcgrof@kernel.org Subject: [PATCH 2/5] drbd: use PAGE_SECTORS_SHIFT and PAGE_SECTORS Date: Fri, 21 Apr 2023 12:58:04 -0700 Message-Id: <20230421195807.2804512-3-mcgrof@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230421195807.2804512-1-mcgrof@kernel.org> References: <20230421195807.2804512-1-mcgrof@kernel.org> MIME-Version: 1.0 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. 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