From patchwork Fri Sep 15 22:43:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13387797 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 344F3CD37AA for ; Fri, 15 Sep 2023 22:44:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AAC198D0005; Fri, 15 Sep 2023 18:43:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A37EA8D003B; Fri, 15 Sep 2023 18:43:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 79ADF8D0041; Fri, 15 Sep 2023 18:43:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 67A168D003B for ; Fri, 15 Sep 2023 18:43:55 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 3BD27C0840 for ; Fri, 15 Sep 2023 22:43:55 +0000 (UTC) X-FDA: 81240310830.25.A87FFC9 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf20.hostedemail.com (Postfix) with ESMTP id 9C7651C000F for ; Fri, 15 Sep 2023 22:43:53 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=XIkzA4O9; spf=none (imf20.hostedemail.com: domain of mcgrof@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=mcgrof@infradead.org; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=none) 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=q5kC8lKXTQQVIY9YNTK1DwlfcMyU3THWqOh+LBupeKg=; b=zqjqumMChl8kEc030D3DVlq+r2KQSxFevuZHmFQ25kqmrtnnbbmepxFI6WEgbv7F8an+/H VcLPhyVSB3OgTj/L3ype3DNBgNf007a9ieJeriMQe05DygdxNfELADMZx2Qmg9crVdgKBW hNOACnHo6kl5WNpKHfRWa9n/sALkQ4M= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=XIkzA4O9; spf=none (imf20.hostedemail.com: domain of mcgrof@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=mcgrof@infradead.org; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=none) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1694817833; a=rsa-sha256; cv=none; b=jGhjNSrTqG4Ie5VWlSvu06R54KtsZ1YTc7IZP28P54FuygVoKOZN9NGaW6+LDERfNPdBIY xwfffIjimGHI0l8jaRFl4/k4MEO3WS+ydV+ajU4gxgpxSF4cR6XjpPDBcqnXFF7Y4T3s63 NCpoXOuAIMyqL57f2ksU2/7NgX94Gdo= 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 X-Rspamd-Queue-Id: 9C7651C000F X-Rspam-User: X-Stat-Signature: ro9f4oso3kskp3m8x8er8s6p4ygk6j4u X-Rspamd-Server: rspam01 X-HE-Tag: 1694817833-827280 X-HE-Meta: U2FsdGVkX1+Zx7s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G/+wo+rNANagd23jwB4eIji3XJE/RYf1yS5LLdr7cfHHOKbfJwuo7e02YeM6nsCLsxTpS5Y+i8T8TCmHUPI2/nwnJcgbhDeKpsjG9pYqJbUS9Lae7Ec3LsMOO1APSmBt423KFWmj4E+Fm0DPDNWa+3TWSt/F9CBr12zgCJoAg3UKhnaNiqzs6cEdRfJagsWFP1oTushExW6IoNdMMLcXOq9X19ggErJ0asZ5SS946fkLYCLYosG7anQbTVI1ulRCnCwZYVgOpxcI6/wnm/j5uwjxIAz0hR1XLyIH+y5aystIM/KynMGSjWZPaEk1HUc8tCAcdj38JzELSaxm0/mbkSgEAUsqK+D128T9n0pQowkYzisDM2uD4ChuKwujdA4u/rOawhCGiUs= 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: 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 Reviewed-by: Johannes Thumshirn --- 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: