Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4932669rdb; Fri, 15 Sep 2023 17:57:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFFK1LfUSNfbGwU1CLd+hYvmQFiITba4di1VjED0c8ww7DrYJkNFYQ7Ptt8qpPGLgZbjiTF X-Received: by 2002:a05:6870:20f:b0:1bf:61e3:df1 with SMTP id j15-20020a056870020f00b001bf61e30df1mr3365269oad.50.1694825874606; Fri, 15 Sep 2023 17:57:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694825874; cv=none; d=google.com; s=arc-20160816; b=wADM0AKUXpMKkhgpptSzsGhQwYHXwyEsMznXIkltya3CnAG2i2KxedpOn8lGDGRVrb mfNqTsYnbTBsXkDX0adaeWvbIg6y/KQ5052yZlpMZz4WBgSA5hceQMYxQcAKvXS6a74T dsbJm9nEIE3KmH2Io2J9xVxHelztfw4pcOYhSabzd5EZdI5QNlv/tsTBPpYknlq389rn whro8lYnqaUlAhjaKeXFhelCJUPFygwa8kRfiNMBqRNlKl/9lC24G+acdAXaD7mbKZGO oV485ktMsQ3dqTB+8mTi2pTmMnBwiKTJai9oRgGq1fM5MzRl3oHZtte6B+7ipW11eul9 q/fw== 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=q5kC8lKXTQQVIY9YNTK1DwlfcMyU3THWqOh+LBupeKg=; fh=hgzuTJvh2MGmSAj7548Uai+xz4x/sLKMXSOZO1HhhCk=; b=PeqPQINCXIIJzFg4fKUwfTiUv4DOjJw3xyEUkjHmCcmQbQKHUhVoXbnTc966a3Basn +sya3O6zloSsWKqqH6YeE1Q9TFo2EOMmbw37Iy38eKGS7BQHERqPLFu+0Ctti4wpRmg3 QxXbf1p7mcq2y/w0Xvk5bPy8b3Kv2y8b57ZvK1enYrG0cKsXqY19V8VZ1Qz1oq5AVm3j Tvfxwl2og/A7KRx+C1w9ZaNIQXUcqYp2HkfP3lxpIQiLv/0tpuxWFIwYVB51a4BduiiH ssrIJNerZKV7kSKnD0i+EVBQb+UWwBMMjdv5NX6MFAHWNJwL8/o6PlojJa8tLOePFL98 SdXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=XIkzA4O9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id r3-20020a635d03000000b00569dfeb8123si3334600pgb.189.2023.09.15.17.57.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 17:57:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=XIkzA4O9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 3867A858A39F; Fri, 15 Sep 2023 15:49:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238149AbjIOWoT (ORCPT + 99 others); Fri, 15 Sep 2023 18:44:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238109AbjIOWn4 (ORCPT ); Fri, 15 Sep 2023 18:43:56 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB4732718; Fri, 15 Sep 2023 15:43:49 -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=q5kC8lKXTQQVIY9YNTK1DwlfcMyU3THWqOh+LBupeKg=; b=XIkzA4O9wGqO2WtO8tF1Z+xTn6 38fyqpIf4n/IRVBBYSnI4HTtxoGdQ8LSxZIP8/NSOPmdJX/6DryFm1LyL2/rS5Wthw0D9Rc5scxXx LeBfwDOWskLDMOD5Txbwvzoa8w47Q+FzsTwVlhtZIXH8t5goceyGum2sBY4q4juffs5HTbYPQASpT iQMJK8QZZL36GAP7fFFC9PfseuwA7wua+m3Sm1TqVEdTdAbNRv6nBe+cI0DCPcBiEFH5r0zh2G8tV 4s4fP5cV+wF3aIWx2BG++FJ3o6PNKFE+Z1nWnlngkygbY4QmNH8SvuZMwjZKYMIc4beAWEP5tblOE kS4wAVZA==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1qhHXM-00BUtR-2z; 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 Subject: [PATCH v3 3/4] dm bufio: simplify by using PAGE_SECTORS_SHIFT Date: Fri, 15 Sep 2023 15:43:42 -0700 Message-Id: <20230915224343.2740317-4-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 Content-Transfer-Encoding: 8bit Sender: Luis Chamberlain X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=no 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 15 Sep 2023 15:49:18 -0700 (PDT) The PAGE_SHIFT - SECTOR_SHIFT constant be replaced with PAGE_SECTORS_SHIFT defined in linux/blt_types.h, which is included by linux/blkdev.h. This produces no functional changes. Signed-off-by: Luis Chamberlain --- drivers/md/dm-bufio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c index 62eb27639c9b..a5b48be93b30 100644 --- a/drivers/md/dm-bufio.c +++ b/drivers/md/dm-bufio.c @@ -1152,7 +1152,7 @@ static void *alloc_buffer_data(struct dm_bufio_client *c, gfp_t gfp_mask, gfp_mask & __GFP_NORETRY) { *data_mode = DATA_MODE_GET_FREE_PAGES; return (void *)__get_free_pages(gfp_mask, - c->sectors_per_block_bits - (PAGE_SHIFT - SECTOR_SHIFT)); + c->sectors_per_block_bits - PAGE_SECTORS_SHIFT); } *data_mode = DATA_MODE_VMALLOC; @@ -1173,7 +1173,7 @@ static void free_buffer_data(struct dm_bufio_client *c, case DATA_MODE_GET_FREE_PAGES: free_pages((unsigned long)data, - c->sectors_per_block_bits - (PAGE_SHIFT - SECTOR_SHIFT)); + c->sectors_per_block_bits - PAGE_SECTORS_SHIFT); break; case DATA_MODE_VMALLOC: -- 2.39.2