From patchwork Fri May 26 07:33:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13256512 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 1E90AC7EE31 for ; Fri, 26 May 2023 07:33:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3F0E3900002; Fri, 26 May 2023 03:33:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3A01E6B0074; Fri, 26 May 2023 03:33:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2194A900002; Fri, 26 May 2023 03:33:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 112166B0072 for ; Fri, 26 May 2023 03:33:49 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id CA3A31C7D4C for ; Fri, 26 May 2023 07:33:48 +0000 (UTC) X-FDA: 80831591736.13.0E30BA3 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf13.hostedemail.com (Postfix) with ESMTP id 28E5020011 for ; Fri, 26 May 2023 07:33:45 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=JFyweRH3; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=none); spf=none (imf13.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=1685086426; 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=mp0R5kJjV9ATA7f3wCKoUGxZA6HQSlfyegxBHwX5Bjk=; b=5e5fyP6xCTMB1KIsceAIbTYVOQmGZInj7S90l+mgHXGeNFTwnjL6kLHj4w3mhQYoKHVc+7 rCZoMgagO5kDbnqJyNu1xsu565l7BQEX4RxR9/vlUEjc1QLzWguAH5YORxfKGv9Ax8/Lwo 0O0B2/q+vllFO8N0fY8k48M86ny2QnU= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=JFyweRH3; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=none); spf=none (imf13.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=1685086426; a=rsa-sha256; cv=none; b=RSqjsOHDXnQSA51/k6s2bG8aPSon1FggSNlqQR7rWquVWcUXftdZaNRvSWdUmrut1urRi5 hhBYdon2qYsXjnNHwPSmWaAsi2AfC1i56KxUhqf2o2oWGh7dbg8Lq2qbom7W7lSLkMKiRE KEHYz8MERoXiWEMOYvcRfy4oKzfUds0= 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=mp0R5kJjV9ATA7f3wCKoUGxZA6HQSlfyegxBHwX5Bjk=; b=JFyweRH3uI2LUIKa6CevDLZKGx TKIgB0Y1EjmjhgQtYqrSPkMNG5keYraDpb6BQnGzIKLhMTVo0oblR4jwgMIB6HIdUXSpGXq28Xvyh mtYzmXcLkLNuZP2TpCA4lzDp1RA2SxN0/ENDC+tnH0vBOiJFjpSdfkBUaUztNotfiYNvg1cz1G7/1 zF7NHp330UXzfhSxJuQ3/eJkFTHFymVoG8RVBzcYY3SMWY45Ut2V3AZToDDkiy4FZEh+w6+Ma+nuF OtmnMOJt2rZqs5q6W/LuP6PHm5KmPG18Oz3Qh8+WAau3MwsT+44Wt7PDwRVd38S7pB26tTKLzCQ3m oxCy1d7A==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1q2RxA-001RdR-3D; 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 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 v2 1/5] block: annotate bdev_disk_changed() deprecation with a symbol namespace Date: Fri, 26 May 2023 00:33:32 -0700 Message-Id: <20230526073336.344543-2-mcgrof@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230526073336.344543-1-mcgrof@kernel.org> References: <20230526073336.344543-1-mcgrof@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Stat-Signature: ryaaq4j5ntt98a4aocsyuwkibfqr48ow X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 28E5020011 X-HE-Tag: 1685086425-195411 X-HE-Meta: U2FsdGVkX1+41WGp2K7HzByRRBS1J3hsVoYiWG7+tWdBQoal0PEqjt1jZAWPUJzu0/21a+TQk75TnBn5tXXV0rL4/Jehh08X3Toy+1vrV6oR7QKqzEzmqLG+HFmAlGarciD0Fuk0G+M5PBUesEG6VqXMfkHzG3UpoaxNtxZbHhaVwXNOOI+foKkCeu5OR/SOLi9CKM+7iaSCzlc2ym4lmYrxqUepJaCthyYkbsAgnoi2QG0c5kUVMerAQBCuoiN3NS8FSJx/33/5NaUkppuKDhhfJkddOBMX7Epx0pkocxZuP/IfaUMfhCcxJv7VeBiDKcsJzWp6lmZFI0Wq6ihPsTHtfd7cOVsUE/Ruyoq7B0ahSKW9RCh9l6C1K3Sf/NMmzEUhrEMGBmh23Z0lTyOv8SFwltlu/QX7RO12V3Jj9VNaooahzaxK6kaWNChn8WuPgN8xPT0TFJNbtb2+x0fu1nKdrK9WafmwfDH876INRLP+78GaCBjMi30Nmt9Min69/5y4Rug5NOoo5ygaTSfqA69LCHdZ+6sp01Tnk5caTv3oalNEuLDIVTdIS2YQfNJ+k+8E5DA9VZwuORcku6D/CcQfe0MesVGNK9PDMt4l/6h2ueZAX2I/qW7/xp3IU19ugS3CCYcnShrIiff/QSfHlvXm8yYETgxFHO92ZxnVBarHwQ2/ZqqfhAgqdcN+wwyZX6itPdMSiQZwlLTgatZoSP9j8UOpyep8uqdg4gg1gHOMn2eYPgATxdIfhBXV/gihUfNwv0eCZyW0Khrwil7qparlehwItNqMJ0tUiH8vCXXmyARo/6btczGE4Ioyh4NDAbyoAdExLENdraUetn8ZFRlqkNaoh4vm+NBU9GqNgkUIs9TK1+a11z9q4VHRldYpqYrHogu6S7L+ZhNK9zT6dvkTtx2hTZmO6CAdutoEyo14umG0Fjw5yfDIe5jymdd6iqNOahlpMLhRpYycsw1 3b3mrqdP KM3tQnNIPho8oZ63BsMFQsTJF7ev90EOoXLlTSge35Mv7C6Ug2sgpdDbB12H+99CJVNkJs3hXzLfvCBUJqPhp5Tdc3FmCmhrISHhpzDFDJPHi32r9m0jYM8mUTSCY6SxKrLCT+wJwfQZymaN1+JdmeXluuPHoMnCERILaTquIeduPsPVTUdDIVGtl3B9W/Rkj/isaawpaybfiNKFN2YiJemokh0Ox7o5VpiXZy7ZbeIKQE8xH8mRQ9NlnU1l7ceEQDROlNr3ufMejhikEg3BdouoxkViO0yXrwDgEKB2O6Zsv8wW/kW86KMBhnaDQa8NtVMSScLPU0PfSY6WGpQ0ms6jO5uo2NYMTl5d5WyfqswHrI+uDaoTPkZqMGpQs5Vwar+Org/1iXOzUN+5e2+G6GDzO/XtEG3otiQN1hiU81LeqEF8CJijgZQdF0Ev1WA7I5Qyj/GjtGu6b+Iz8WV0kwdLfzsbjnkqtpfEYNI3bh60Y5EXd2Rg/khqOK5PKcoFj8yF++FZM94xlsUM= 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: This ensures no other users pop up by mistake easily and provides us a with an easy vehicle to do the same with other routines should we need it later. Signed-off-by: Luis Chamberlain --- block/partitions/core.c | 6 +----- drivers/block/loop.c | 2 ++ drivers/s390/block/dasd_genhd.c | 2 ++ 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/block/partitions/core.c b/block/partitions/core.c index 49e0496ff23c..6f18444be4fe 100644 --- a/block/partitions/core.c +++ b/block/partitions/core.c @@ -690,11 +690,7 @@ int bdev_disk_changed(struct gendisk *disk, bool invalidate) return ret; } -/* - * Only exported for loop and dasd for historic reasons. Don't use in new - * code! - */ -EXPORT_SYMBOL_GPL(bdev_disk_changed); +EXPORT_SYMBOL_NS_GPL(bdev_disk_changed, BLOCK_DEPRECATED); void *read_part_sector(struct parsed_partitions *state, sector_t n, Sector *p) { diff --git a/drivers/block/loop.c b/drivers/block/loop.c index bc31bb7072a2..50aa5b4c0c56 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -37,6 +37,8 @@ #include #include +MODULE_IMPORT_NS(BLOCK_DEPRECATED); + /* Possible states of device */ enum { Lo_unbound, diff --git a/drivers/s390/block/dasd_genhd.c b/drivers/s390/block/dasd_genhd.c index 998a961e1704..5ea244aec534 100644 --- a/drivers/s390/block/dasd_genhd.c +++ b/drivers/s390/block/dasd_genhd.c @@ -25,6 +25,8 @@ #include "dasd_int.h" +MODULE_IMPORT_NS(BLOCK_DEPRECATED); + static unsigned int queue_depth = 32; static unsigned int nr_hw_queues = 4; 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: 13256516 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 C2649C77B7C for ; Fri, 26 May 2023 07:33:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 02897900007; Fri, 26 May 2023 03:33:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CF2DC900004; Fri, 26 May 2023 03:33:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A3084900006; Fri, 26 May 2023 03:33:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 516A1900005 for ; Fri, 26 May 2023 03:33:49 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 18DC3160DAF for ; Fri, 26 May 2023 07:33:49 +0000 (UTC) X-FDA: 80831591778.11.9707EEB Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf28.hostedemail.com (Postfix) with ESMTP id 0BFB6C0013 for ; Fri, 26 May 2023 07:33:45 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=xIU9TLdn; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=none); spf=none (imf28.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=1685086427; 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=RQzHrIRCFqHArqIrnKCyvyHklB4zdcXT4MP2qOnLDko=; b=d7Mx4oQM1ImEAEDeR6Esnrq6qxWra0B8iaYH14bMSKiceq8u5imwvOUfMeUWXfGNuceC/l q9XHplVASEFt8XCpJaOSCyraQtx5vLxqY9brb+oiMdHnrgQ7L9292oDQLLqRewQfCt2slx /94pRAhnC5gUtU78lPglXHTmchcEk24= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=xIU9TLdn; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=none); spf=none (imf28.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=1685086427; a=rsa-sha256; cv=none; b=kOeV4vDvpX0sjQ9JA3szdO0i7n8Cmu9Kx41KfGayIMebXtdRmD+IkyBal+um6BlSF1Vuel EUBFUzNHtmZMAqOsERypmIuSzD0MezSrbzANQlCICqFx0rymYROdUkvU2wgx/1bI8gjXs+ SDHq4Ev2gztyct7ySRJ7NzrOYyk2D5M= 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=RQzHrIRCFqHArqIrnKCyvyHklB4zdcXT4MP2qOnLDko=; b=xIU9TLdnNYizB06PmvtzYlTdR5 HlTQdpKGeyyWACTTR95smi75XqDqgG9cDCVGjAOdZdR3m8BPT3TY8BNggYNMWsvJTYAI3fPk8ZdnX +BPgRSFHUYMlBkhvzll8T3HI/Xl9csNmtX8QKMKtP/iRaIPqnstKYFRv4S7XfWPyCylLC1KlvR72z xZm4OyGRiK0FlBL7bEZCD6oegED5VqaXt1eqNzYb6Rc3bdAejGjBTYfmdB5Mdvz6UDPn/5p642Nn9 5WC3HcP4OrbSccmqITnp/WDQKvQYcQr/4mAHruC7ragwNbVz4FX6+BYEFG0dF9uA91YTcz/4vzB+7 v43VXK/A==; 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 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 v2 2/5] drbd: use PAGE_SECTORS_SHIFT and PAGE_SECTORS Date: Fri, 26 May 2023 00:33:33 -0700 Message-Id: <20230526073336.344543-3-mcgrof@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230526073336.344543-1-mcgrof@kernel.org> References: <20230526073336.344543-1-mcgrof@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 0BFB6C0013 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: ih5476riboyh67c47kfcrwuusn4uifqn X-HE-Tag: 1685086425-433133 X-HE-Meta: U2FsdGVkX1/A4aQXyjTB2EUGcd9Swo4bT6hzgfe2iiDmLy/nXPvC+mA3AsqNYGfP/P8JDQipMVfCEnhzUEvezWnxL3u2jeU2nleWBCNd9U32kv2w+a7vlD0t03EdUNfpd122xyzUb6ckGaNm0EIu18j5A0d0j5zh4l3pdQNJv+d0FO3HVCEfVvyc1zjTmjq+H5DTnHtxbEAxyaQ3mrTBDy5BywB50RZd8QkhzeEAV10t2ugrc+l3bASKvERW1ECW5BH0c2BfLh/2Gg5Hsp7WDWdD5tzfG2w53Adp2umQXSaNcb+vAh98lxKSlvkPcC1gwZQOYbK3xWCi2ErWkzYtWtQZQHPjwtcrUn1A/VepZUT3kmtZkZ5EN+DOJj0cNTQYMVoINBkTEFH8hkM1ble8bH1kjcGndTGLIIfbWOd4foefnoiRY7VFQVNruq755E4R9XclJug5oC1rverMAj9swU068o0tquwrNZdsDRCD8thvGXuM5GwmwZlB+pe2z8oblNXyvxSSRjufcqRrLEW1sr3+0CkZGzB/kQoLgNUkWAfIsDOxvZy6Fp4IOG89eHzdwgi/NGhG0iwAvnFqHDNm5fOpRpsX+U4x3rhiXeCbRxO0RgC1qd6QUSxMUlLly6WYy3zVxDScEJL9DyOj2fGnjtlbQNNa+H+VUTRKDkcw/qmqNRsoeS71BIOV8FurTaviUw86mTta1nWn3iPyzu2DXxT50CIBx2h1AuQcCkGqBfOv0AGYrXJo7luihm6B9sw9NQbRoIvvqFe0DloSBXcdApUQc1/3V7lXTA8f11tayrPMMDLRlvfAabpt0lCilgbxg67RwjQ9JYJT11gqLuY2iDOb8Nhlp5cd2CcqxpDZj0sbpqXoETjqAS7iIXwYtqcNguWa6KQZbQtaq0Dve4aWD/QbdGB9cz4AL/GCmNGwvkgUwVXOsuJ2IIFGXMVZqUG450Zbc50URjylhCw00vV tPV6lXXn 88lzuV6Xujpw68ZUMfKtnD9kw62PZ/YgED6+tbw3QGjkQccGMqXCT+tBk35n1ks1H1TvD5Yaj2DcmBMN2JcDTgP8P4gSwxPDBOsHfr7lhnGhBU0IIuV5jWMfAX5enkXvoquWoC00eYjbOX7ftnhqxSePbsNC24drgHbqImZXprndxq6p66/KZljBS2DW3/1/lMfzRl0CdaNYYG7/sYJvYy5JqEhM4ToARYKBLaZgbjx5fIZkEpHcUP9XkTOAqgRhLpqGmN2Nl71WzAy8tCQxhy7KXbFFtI4bQDtvvrNxntekTzKq5JgQtbRuFHuWd+ecFAQltCQUfS6Iu+Eydt3EiGdrXqCdgxHBqsfZcOITeSG9LtNFJIbxXqfCs0KilJ5Ct26kxVf0pGlunhlIoCDkcj8rOAgF5LtrXIpukfRLaA0OQN7k2mcvdEGh1Z6omIOFWgBcxmphZJ4b846IE5BewArO9IvQtRPxqscu1/aMPiHGa/IR1gLhy5c3E9AXX94iBBTCjBRmYD2Qt/lWZn1jsLfu/aVAWxUKZWU86AYKQGSRA3ZyPs3hO4JdLhMcmgaoqD7RJky6G9XvOnHE= 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 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; From patchwork Fri May 26 07:33:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13256514 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 4D757C7EE2D for ; Fri, 26 May 2023 07:33:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9FA91900005; Fri, 26 May 2023 03:33:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 887AE900003; Fri, 26 May 2023 03:33:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 686EA280003; Fri, 26 May 2023 03:33:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 4DA14900004 for ; Fri, 26 May 2023 03:33:49 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 18CE480D66 for ; Fri, 26 May 2023 07:33:49 +0000 (UTC) X-FDA: 80831591778.06.776EFD7 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf04.hostedemail.com (Postfix) with ESMTP id DE60340017 for ; Fri, 26 May 2023 07:33:45 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b="TvnkXj/I"; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=none); spf=none (imf04.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=1685086425; 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=FJ06IRMbDJJrXOTKvODn3h7mdJ3kw+A63u/ZaBgMzfY=; b=Y9tiMafOXE1T3f2FoNWMNK0b69X5zpsNWPpDZVa7zNCgAiie0MN8JWq1faed580RvBmwI3 Pz5xEEeXB4wfsSFQWYQHqIWXX7stCN1utxgbbakE4Rc3I+4jE2gvS1QeQSD1Fe62a6V9cd s+jANxtDZ4GOJ443x7371WGHsyqBmlo= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b="TvnkXj/I"; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=none); spf=none (imf04.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=1685086425; a=rsa-sha256; cv=none; b=tTlrwLi8eCJfA68+vcD5Gc/BRRHzjl6ZiADznKwVwUMd4dXNw3jhyQUcKA0DQqHE79LMZG 3pQKwohqtQ2CP7O/sFBG3YGX5ARhWE99ZHqLexaH3dwSiSc4+hQqdS/BMrdaxEweZU/w1L gmtIsDI8byZlNBfGBr0sw0RRo05OZew= 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=FJ06IRMbDJJrXOTKvODn3h7mdJ3kw+A63u/ZaBgMzfY=; b=TvnkXj/I5pCGoRzwSTLwGngHMk E/yOSJcwi8/rld1LFK0la1ONOTYE8kgf0sYeSy7EeAw2M9xM5dchixMhcAFI/dyqAGMeMxn0UGWi1 Z/L2v0EUnETlmhx6yMZ2Pkv6KIyQ8DKIRJ9Z3+q5vWbT43/UJgv8w1w9fmLU9F4PjN8odpQtJNiIB V0/+D3Bej6fJHhwfmMBkg/16PEO3VhSIPA07vAmIXi2OuTn4BsoPVzH5VuDjE1wyPEPK76ic2KxwQ ifNUkHYRpWB9KO5IxFO4z82u0HHr7NQ518//dHvsxFWjq0yZXCx7CPAKr73uGMcywgLPIN9gHZEHu NBTI3fcw==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1q2RxB-001RdW-0P; 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 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 v2 3/5] iomap: simplify iomap_init() with PAGE_SECTORS Date: Fri, 26 May 2023 00:33:34 -0700 Message-Id: <20230526073336.344543-4-mcgrof@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230526073336.344543-1-mcgrof@kernel.org> References: <20230526073336.344543-1-mcgrof@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Stat-Signature: 8snmrnddrutut35fhy3psn81xiqwjtui X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: DE60340017 X-HE-Tag: 1685086425-696504 X-HE-Meta: U2FsdGVkX1/jzw6J11zMww0zLRJFgRLcxrHLTs8YsKEC0s3oRhyFwjlyHsSgEJZzotZisCl0LKIsTHdOWO6GItqdn9ZRJ8vFLcWtNE9tqpc6vIZakjb2p3pc5h5y9jRgnUiPvwxjBlipOD5XLCSFG1/21cdYTnZVFqE3720MXZmHJuLVk7FBDOqhzX+llaUjb+j9A46B/Ck7sggc7IfNmEPZXMFNeVrGNTeTnxqTIetE2N/9my+UOInRIOAWWAgIONYxrDzRciDaK0DE/dyAry5OOLSRuDypXNPrng32Csh8OiwTLzQzQHoGh0pWqjDU+VE3cPuvBX2j2jPjRNAAqbNojOwsCk+OTEWu29R7z+pOIfhZ3mc2HH1EQXKZSKViYdMQWLi+7QNslQeFHuBepBCFunI3kiJ9wRH/BeVO56LSQiAPjfzpsh5wGARGcgtdX5xTpK9nJL44PAZo9nl6D9nwR+Cy3Ufflbloe0sYIvc4tzi/kKuBRSteDrfk3Vj4tqDl09okntgzpkTUPjyHn5fIZfOPPPoxDMCdVns+MMgLKoYMtMaDUGSPIGZkNbEqkBuj7JoZh1bnja8jgw4opCKS4BELopE+l6GIvCEI7tpGKa0z9C+fnMexQSE7qyeY313pFAlsqNHbqmL60XfpDJ6CfS9gbkXAJLY85ue21gqukVZJ4AcG/XpFX9f9H97Q/LBr/JbYhycw2V1IWDrdf+2K+PNMZMvIlEjBYt/9lNHKQxYBJd+/0vQ7Ok1OgJ74qmOisynjaEhk47pHnHRS7F8JfvWjok3qp2QgvINUtGxanJX8dp2mCw1MVC40RW8PEFQOYw7OTOqnQ1td3+7n5sFxcyzWnUk7uq4i/PcNnMu0Hgde/RkQsB7ui9aigiez4dbqxIwz15aJzgHsoNDwRHx5vlIHslKyKb99ZXNcgSrhE9O1VDe35AF/abhhh7Qu1FBig/9y31o+Zq7XAgC 2mstkovF noqp5U1y8d9qgzwY6qZs7oXJQgXbEeWPFMVwD6juMpLIj1kiVakoazhI/9K0jGfkmcVoR2vh3oEOj0DZAv2fhJxwq5kfbAjOQPvzdAmvSjb8fIiZlSsMk3OAT6dqkvAqe6gci1qcN1ppT5mDglrBHW1mgnhrd9T8FsIeiflmRlWlxXNEw2tb6L26hber6sNwWmbGl344UanceI9nT9+tDgdbAlnddXh8O8MT/FkMEf84MLEr4l9IP1G6ebElfJmUV7qbJ0oxx9IufyH5fxWIF1EIBY+X3InD4qcmNjZJtY++FsA0RAG4ZFImV3pPp688hMlAbbVYb1rbJhw+BCu/hRKWh+zKcuCCDhbibY5m/ntZv7BQElQIbMqt8y2iHUQU41YsZ0AE6DgUFFA9LSzmHGD92nmYWWeKpgUb3EI92use9ELxqneK00DSL6eLxiBrcinbj0qo+WwuEaNzM3/0Vn0DGJF97+WDikn9kXLzBd5oJjASFrlw+afMpjKpXW/jTbHtmStFc2r5wbgo= 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. Signed-off-by: Luis Chamberlain Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- fs/iomap/buffered-io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 915b448b8554..5641e696fb3f 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -1831,7 +1831,7 @@ EXPORT_SYMBOL_GPL(iomap_writepages); static int __init iomap_init(void) { - return bioset_init(&iomap_ioend_bioset, 4 * (PAGE_SIZE / SECTOR_SIZE), + return bioset_init(&iomap_ioend_bioset, 4 * PAGE_SECTORS, offsetof(struct iomap_ioend, io_inline_bio), BIOSET_NEED_BVECS); } From patchwork Fri May 26 07:33:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13256515 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 7C321C77B7C for ; Fri, 26 May 2023 07:33:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D67DA900003; Fri, 26 May 2023 03:33:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BB5F3280001; Fri, 26 May 2023 03:33:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 99318900004; Fri, 26 May 2023 03:33:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 521DB900006 for ; Fri, 26 May 2023 03:33:49 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 1B54EAE9E7 for ; Fri, 26 May 2023 07:33:49 +0000 (UTC) X-FDA: 80831591778.07.06BDCD7 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf05.hostedemail.com (Postfix) with ESMTP id 72C77100010 for ; Fri, 26 May 2023 07:33:46 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=k7xswGiv; spf=none (imf05.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=1685086427; a=rsa-sha256; cv=none; b=JfQuMRW+Gr5B0h6vBg36bmw4IPW4W2qHbpITm3hkGHiB1JBFiLmIiOOCz7liT0w5ux8cRl Hxky9ESPTCnoybDjaB4E3wsEuTNYesBmbapn21UsI3pnk/L57y0eYJRwTZ0LrG9soE/vwL gnwvEWxxilXA5EzdsO0trCoFzt8j2Bs= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=k7xswGiv; spf=none (imf05.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=1685086427; 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=E+NZJmg2wGtl9UTyedalDySM8eWxNnKVjwcpkkZSi1c=; b=7TRxKG/anbPvEsC1T+1MYWqT4Zd8vc6f9jGzawu5v+pUDV5EXy3UGLFvx/3uoCur7fv/Ny YI3LXmVwdnOpOfXBtUsEdrLpHs8sQHxd9XUrhHksMkHgu3sZLo5ZmpT841dcs4M2lLuE/g Ej50YbDTUQOncYgtDP20FaBWS+ybyMI= 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=E+NZJmg2wGtl9UTyedalDySM8eWxNnKVjwcpkkZSi1c=; b=k7xswGivErozFTM0k3Rp4cWzQN Dude5lKSUZQHlx044tzpe9pekiIonmIyRsCOSAE/ne2v3XWULeyuNagveDJKhCzwzIwpSet/GGPTJ 8L/umLYOEmo939tVe8b1LzFSz79yTjVEuVIgi+ODI0gNHPJzRXAzmGEU0uy4w/FXD8FDw1HodRkaX btZ7Pstk2ZQrBoYKCxDF4cnrUuEu7/zPG5VMnZ4MmRE8wjWzPVYHyD4I14U/h9QOMlW+outkkAGYH SVGlcZvTv6O1xgbkdMhgnkGWCImDJG2q5kh2QMmZXxgVfAIEwdNjbjI5gtlCTmuU6FJUWDjjt1SoK m8YH8JIg==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1q2RxB-001RdY-0Z; 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 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 v2 4/5] dm bufio: simplify by using PAGE_SECTORS_SHIFT Date: Fri, 26 May 2023 00:33:35 -0700 Message-Id: <20230526073336.344543-5-mcgrof@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230526073336.344543-1-mcgrof@kernel.org> References: <20230526073336.344543-1-mcgrof@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 72C77100010 X-Stat-Signature: cw4a9qaquwxd6g7487ibqi7ru3cfst93 X-Rspam-User: X-HE-Tag: 1685086426-364603 X-HE-Meta: U2FsdGVkX19sAOUtEVDV6qSPFGONqxX9gwveV6KxEp0Sm286yIHa+L1Jx/AS7M+fv36g027ydmSk5MfgjpC1T/+S9Ef0xYibmRnXev1mGFJGKADeKcrfm3iN49pE6+Ufy0WUnqii1QP+T1fWzOM4Z5aKURgzk8XWdsURinLV6dJTq+Vl2dMndYwjEWUDSrQkD5mk//qrec/+u9xxeW6dhUejpDdRxDaqRuv2iLNN5FCv1EaCGZub5R3RNHkWTvLDxwzHfTlhPK0t70XlcM3xJVU03sSSbEmETdk5gqVdv9nKFOfnP822Rh6DMoEq9SmJEBkxXhI/tQPGEEzI21nxucv8+O4K7p1rR0U7kdbc4UxIdLZ3isKYoMCrrKcaxB2RcXvcx6Vapi/bdrR4SeKA3/FjOvJIJoTIXOAcdVRF7EF6H3soUDyEgzfdFAAHllydbwvi+ADqDF1Z8yDJU+6Joll87JbKaTl8Msznosj0KPSWGRYxGOtIt+i3bB4ojsEHB/dwFHaQG/wZzONATGUGCXGGqcn7w01fPb8d2hHcAbGFzluOcrOXKgM2iHvok4QNZgoPc0+h6DnFbRzaZDSkDbyGJBRmO1l2OIBxKRO+SUdm7prQxIOGH5DDikl8ev4pbZD3Plt85gj/Ct+gcZUFRQnqCAVPB/kPyrOHUHOHKovB87yAgFdJSH8L2JC4T98s9beweSY4Awkd4/3lH5YrNiRPG70bpX1QVXDB0V5LbT2JBFj3A8QSd0OTnwY+SfNsOcVBejVlnfP6lp2rJuI/3/icPrVH5ut3My2EUqGHzJpdZ/8h7byybm7UrsP3gSnd8FWtJJW+tUd2VUEQ1Duzf465jNmcMozXYfb/KaK6CTBn23GwjfYC3Kc7XELdySJURZ7ypx4+F0gHuw5/XPxlv7PxtgAfRYPZaWuzEN4Wllrze+dDKeVKpoyXT1pmt+Rh5TY17HHj0pH8ElVrLIH C+ty2F3G de5xPaXpzL6PHPeft5cE4AIENj8RUfpIr5EzRYe+ZQcVIIKE4WBZc7oTSB1E91p2aQBrSAwqf4AumXyUTmC/mA4LLQxYcmcMjRDDLrCYFxBdmQKHrlFMDvm6F0VugnHCHYcs09WscnGYp4y7H0Vz6lMjkNcmQarKvOROa5X7RfqdxZEu6+aNts1Rg9nXssMdwGDA3Brv7b7rt48NlZ3+rWrZeKg5iQUOpDldNar1yG3beDtm1a9CHuyaF2b7LqTdA0kV9Il0G/PuW6PGdKpQK2MY0VwZrAVoTUfQ7I8nJgPeAXcPDbWboLJ+Gx9F0lmPp+UJVoxxmBIzawaRXmmKCqj4mnSKm3pi3yPKq0YQkl3dMEm2O36XtDlgofmdImViEpS8jHgG7Mt6/YP42H5EBfS9NszaYD6x2HpFe8+G3uKHHP6Frof0kLymMCk0jjFJ2DP8nKTH7BnBzcmFgycPtDgWyCc4jjpJMZPvn3MqyvJXWqRzp2kvAK9HPh4itfaFuBexjczcX7QW0TOY= 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 --- 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 eea977662e81..08c4730e1819 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; @@ -1190,7 +1190,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: From patchwork Fri May 26 07:33:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13256517 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 0E8B6C77B7C for ; Fri, 26 May 2023 07:34:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 23307900004; Fri, 26 May 2023 03:33:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E9C31900006; Fri, 26 May 2023 03:33:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ACE78280002; Fri, 26 May 2023 03:33:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 5BC56280001 for ; Fri, 26 May 2023 03:33:49 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 3AB5A140E0C for ; Fri, 26 May 2023 07:33:49 +0000 (UTC) X-FDA: 80831591778.11.EAD5803 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf16.hostedemail.com (Postfix) with ESMTP id D04F318000F for ; Fri, 26 May 2023 07:33:45 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=A0xPKQUo; spf=none (imf16.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=1685086427; 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=l8SXSO/lmiFeJihMCTRRFm0o8Ak15fMAUhw4BXdB6WA=; b=7t1/aiEljr6SWKCiDE67PGpSVxE5afW+U4QZ8odIeZncpgJj34Ha35Z3iCO8eKcwuZvYWk i20qb9eOW8dOlUkYGeYH8H9cPXiNaJ4zr2/82xgmVpbSevmRdHt5V955Go3Ai5/Ez+n0Oa VsFO4llLWqyGnnJMkALt9GSEe+GMk1o= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685086427; a=rsa-sha256; cv=none; b=7kcqogEa7+Ev0fysS3tFDv8mU3lfwqEcksIB1MI6My3rgOodtTVKoB+4JJ19+xecqNe/8E 1WCfGqBwCRrI6vFym1qSZCKJ/jh8we8Z4Mf9r7L1UssQhKSvElVCoO1OOavTA2e9lAuMOg l3F04huuOnxRu6Sv9n7qZwgqg/9b25Y= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=A0xPKQUo; spf=none (imf16.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) 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=l8SXSO/lmiFeJihMCTRRFm0o8Ak15fMAUhw4BXdB6WA=; b=A0xPKQUoDsDrFgURMQlgZXIoK4 lF0smhhvDr9DIwh3hI5+Foy4jSB44qqYKTW9k2PV/7PuWcBUSeOo6jWJLU2DNhMOCi1CTP1Vr1qXN cB1zrc2ldkTJb0i1ydOhaeGCJSHRsdi8p9dUGm95225TqZGlE84F6Y3mfrRFtVU8AAk/LeILUvTzj DCxobQiHgxGi8mvk1uiSyIKFvEMqMniMXjlXlxhbRRhvWQ3LnJ21MPhaTWeTq5Fi6r/fGfhBlXjzW o+5/0Ft/FRALeNM171FNjOPX7gizDDJyiLwYYmSgprAWBoMr6t5XCcMourkOlUq8zpJCEwA9TAgAY J55czzyw==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1q2RxB-001Rda-0i; 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 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 v2 5/5] zram: use generic PAGE_SECTORS and PAGE_SECTORS_SHIFT Date: Fri, 26 May 2023 00:33:36 -0700 Message-Id: <20230526073336.344543-6-mcgrof@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230526073336.344543-1-mcgrof@kernel.org> References: <20230526073336.344543-1-mcgrof@kernel.org> MIME-Version: 1.0 X-Stat-Signature: mp1x1aj3i6pt9ty75skgssp7dknue38q X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: D04F318000F X-Rspam-User: X-HE-Tag: 1685086425-39706 X-HE-Meta: U2FsdGVkX19HGGXXz/ackLqU8DOlHqdEP2F+8E5EAmpeKHhKtQaPISVGtYMsbQ4oKAcpjGRh6kgZIYyIN6dTEV6iU/uGNiMW86VATxEWmNL8rPK+YX00EwvX1IW9vHhpEOTOU/aO8q9HsBLvLQhitSdLfmJnjaLiLVae0+6AvitxG9ZaxceeIVhyCQlwfjBYIB1tbExAjb6r+0P2ZJQS/dIboJdwj9n1+onYLrI0rSEhUHeDLCfo/gCb4dz+GMdgjHSVudwb647v9X1nzh1zTLkP1Ty/zGj1AIhzyazy1KEUErbNCseN4s3s4qokzZreE+ZmIiJEO94Ly+yza8YkGnZ8uTeLklob4PsmyQhIyBx0B940izLigjxtqhUBLx6iJ6k2+0qIqinWoWeGkFBHKFDnZLTp6I3J0kHFWxrWpqxy/b1V2acpdsAwAcuPJ30RmOx45Qkr6e62/kUr3q2ILf0nHyfYnux/T+/cuzNrSMd/vo6TvvB8eDXE50L9lfvZp/RE8zY0D/1keaWCnygEpEvXv62oBHcTsoxn6tA09Ph01oCh2FEWXk3m2GgOj7vR4877NLrexQrlKNlbixMhT/yUDa9ljkMCNEpTCRzJn16A9Bkj+E1wtIUi/EnA34+bUUiGDuxUegQwxm5eJiDjL33C4n2V98aKNSgRTuMjqznfxtkknpZ2Sb8ankr2t2g7t5Flwc5DuMcIrEIlknaacjShBvXgBJiqbiGO7LTAxXzKYWVwGkta7j52aUkuQVe/DsRHPUjMsHmL2vf8bvjhRgOhHYgku3gJ0rY49JP1s7jTJRfv4pCeLlKNwInTwMhaj2JNHR8hzdZ86LO5b9FTMAQHwlRwvD5xFZd8gjuCEkoUwbiW7LYeBwsB3VvK/JPz0qk5ttbIJiJXeci9MyV21I/nd1huBooGXfdxZY8K6GEOanmOT8mDUjNzNqFHYN3JK68i0ZOFDOksI9XKkHU cmOhHCvg ZmrN3oKYt7w23vf77YKvHvrruPJvepI6SFJ5uI4s3HrnGiaVlPDSiuSQs41yHUzYYjcViWHuFWd0/Nv5ry9WKgJvPEL3d5nK7B92LXsBpw18VuejDJqAQEFE6RRPNmIvjxfR6PJQA/CXLlakfFZQM3qg2qxVg1E+wSszDRXBXCRStJZmZnTVZqfuA9oRV/LFAe3WTd+7FzGa+eCSh1hEHrf5QjqQG8Vw7IhyEgn/f1fbvd9uUQmq1HdSJGA4ZLcKvnQYdVm4QYb/9FPr7Pi1l7OCi9mq6Nucm7zIEI7ShQpjqv8pd6ik5m7G8mRoC6WsHjAc8rNY+nLZMZcOTvWAom+AcO09wNW7GVnN2yUnQ6e93Hcck6UUWVTCRGmJC25IX9gQCDWgYAJH3AlWDazsO8jNVZs9/MI3vmV1LjWiyp65fzcfwV2RBVVupSj0haGP3FoLRq1xJozMwzPpswMOJdVZSCp0ylC2Dq2xSkgPHVsegDgNawFazJZ5yFJJ0G5kifmOOWYQptl/dhGMQzmThuX7FiX4Nt73JIO3BRpWaQj4Rfa3ANiR2WftF83nJ9CmFBO48 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: Instead of re-defining the already existing constants use the provided ones: So replace: o SECTORS_PER_PAGE_SHIFT with PAGE_SECTORS_SHIFT o SECTORS_PER_PAGE with PAGE_SECTORS This produces no functional changes. Reviewed-by: Sergey Senozhatsky Signed-off-by: Luis Chamberlain --- drivers/block/zram/zram_drv.c | 12 ++++++------ drivers/block/zram/zram_drv.h | 2 -- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index f6d90f1ba5cf..5fdeb78ace9a 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -1834,8 +1834,8 @@ static ssize_t recompress_store(struct device *dev, static void zram_bio_discard(struct zram *zram, struct bio *bio) { size_t n = bio->bi_iter.bi_size; - u32 index = bio->bi_iter.bi_sector >> SECTORS_PER_PAGE_SHIFT; - u32 offset = (bio->bi_iter.bi_sector & (SECTORS_PER_PAGE - 1)) << + u32 index = bio->bi_iter.bi_sector >> PAGE_SECTORS_SHIFT; + u32 offset = (bio->bi_iter.bi_sector & (PAGE_SECTORS - 1)) << SECTOR_SHIFT; /* @@ -1876,8 +1876,8 @@ static void zram_bio_read(struct zram *zram, struct bio *bio) start_time = bio_start_io_acct(bio); bio_for_each_segment(bv, bio, iter) { - u32 index = iter.bi_sector >> SECTORS_PER_PAGE_SHIFT; - u32 offset = (iter.bi_sector & (SECTORS_PER_PAGE - 1)) << + u32 index = iter.bi_sector >> PAGE_SECTORS_SHIFT; + u32 offset = (iter.bi_sector & (PAGE_SECTORS - 1)) << SECTOR_SHIFT; if (zram_bvec_read(zram, &bv, index, offset, bio) < 0) { @@ -1903,8 +1903,8 @@ static void zram_bio_write(struct zram *zram, struct bio *bio) start_time = bio_start_io_acct(bio); bio_for_each_segment(bv, bio, iter) { - u32 index = iter.bi_sector >> SECTORS_PER_PAGE_SHIFT; - u32 offset = (iter.bi_sector & (SECTORS_PER_PAGE - 1)) << + u32 index = iter.bi_sector >> PAGE_SECTORS_SHIFT; + u32 offset = (iter.bi_sector & (PAGE_SECTORS - 1)) << SECTOR_SHIFT; if (zram_bvec_write(zram, &bv, index, offset, bio) < 0) { diff --git a/drivers/block/zram/zram_drv.h b/drivers/block/zram/zram_drv.h index ca7a15bd4845..9f2543af5c76 100644 --- a/drivers/block/zram/zram_drv.h +++ b/drivers/block/zram/zram_drv.h @@ -21,8 +21,6 @@ #include "zcomp.h" -#define SECTORS_PER_PAGE_SHIFT (PAGE_SHIFT - SECTOR_SHIFT) -#define SECTORS_PER_PAGE (1 << SECTORS_PER_PAGE_SHIFT) #define ZRAM_LOGICAL_BLOCK_SHIFT 12 #define ZRAM_LOGICAL_BLOCK_SIZE (1 << ZRAM_LOGICAL_BLOCK_SHIFT) #define ZRAM_SECTOR_PER_LOGICAL_BLOCK \