From patchwork Tue Mar 26 17:10:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13604748 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 73671CD11DF for ; Tue, 26 Mar 2024 17:11:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E1C706B0087; Tue, 26 Mar 2024 13:11:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DCD136B0088; Tue, 26 Mar 2024 13:11:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C46016B0099; Tue, 26 Mar 2024 13:11:23 -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 B579C6B0087 for ; Tue, 26 Mar 2024 13:11:23 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 95941120E08 for ; Tue, 26 Mar 2024 17:11:23 +0000 (UTC) X-FDA: 81939831246.27.91D52F9 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf07.hostedemail.com (Postfix) with ESMTP id EA48A40005 for ; Tue, 26 Mar 2024 17:11:21 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=tkWgyz2o; dmarc=none; spf=none (imf07.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711473082; h=from:from: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=0T1BzIrxwYy/rsmBWKCabOr0L5fd6baKhpuvPYzfXmM=; b=Y/Bx70CSnR65OSYe6njKTxCvdkswNkXsE1erUqFsUdYP1wb/2zpQXa1f7aFTH4+PvW+w9h u7Azf5k2eZ2dqmd/beaIffWGU0AMA9p/onZrBk04O3qYs5HFkf9pVYf6NDP0Zh/jA9+9zs eWKwjry1vWBdZuOHF+6L8QR/EeQ6Uhc= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=tkWgyz2o; dmarc=none; spf=none (imf07.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711473082; a=rsa-sha256; cv=none; b=Iu+FVJn6nqGjSz6X2kZ8IEQAyvahv36CvgeyxNeGOwM7Npny3tgCzJPd2nUe9TZ7vbSENU Yheg5qM/kxHywNxht3p1cOXn2xZxMBWyfKy6p0dqrLm0DCyjHBvyEn5I4N8GP8kYqqXz7+ B62r7o2q/E9+0ytFZ4a8O65+D8zegeo= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=0T1BzIrxwYy/rsmBWKCabOr0L5fd6baKhpuvPYzfXmM=; b=tkWgyz2o0lAYHIR/c7OGHAgCqw wSdAEYzZauYcC/o+lMb0SNoE8IjO+kKW2e7l4HbYgWk+5+pJBrQz9fmT7wm4JdsI5yGijF691iHVW lJTg7xARfv6C0MudCiedSGwIvMb985SFjf2RmM/wOzuC+Ewopt/GKW7wpSAFHanAB8NBjy20pbd99 N16j241NZ94nyDZAydaWhLTx44rjW9HUy6oCP6a/+RbPspfomzAxMSEmzMMurTJq5r9Q2W3h9GqU5 i5y0DJhOpZ1UskaScfuEDq6q19QLjzCMZrD/HMgTYbOBwN6FYD+wcBdCrzADSvBlhTVCPva7VcufC L4jWYjag==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rpAJz-00000001is3-49po; Tue, 26 Mar 2024 17:10:48 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 03/10] mm: Make page_ext_get() take a const argument Date: Tue, 26 Mar 2024 17:10:25 +0000 Message-ID: <20240326171045.410737-4-willy@infradead.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240326171045.410737-1-willy@infradead.org> References: <20240326171045.410737-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: EA48A40005 X-Stat-Signature: pm34j74jr8ufzsreyb5wogqj198bfjp5 X-Rspam-User: X-HE-Tag: 1711473081-697577 X-HE-Meta: U2FsdGVkX19z8Oq4BECSvtvc0Latpgem37NKxrfjNl8qP/I2/s7EuApu8yN8Se4YeKN+AJj+cRpzVfYMbOv56jMi0zJU6tcdJE1jDX/bV0N+4ixL6MvpNJVhy+69cEyDeObmhGQY/TSjDF02DgzgFegL1KWOMagv+eNpDwYnpQWGKo8Q5qs7CJb77xi73MdTxbFph1enEzPvOX2FNlxXNLQ3ARe8XuJ/GTKabXoW6x1vqle4cMrlORoLQUGyENwWtowOo/ulw+omR+HTwhU/nZ2iY7nMOFAQ9Sx8DtzRRTGKMoh7ssGTm3NE+RZQ4ivANAjbsGNJzFQ7+CeuAgfx0NcYfLRrWcXisiti6WJx/EbF155VeqF/25OvneZcXFXNue4QyLJgm85JWZt+8Qhgs4locD/f8A2vp+2/peDYS9hmpQmSXYCU+B3nKlsIJ2dF8m/rKiybcqYgTd5T/EHUC2+ay5ZlA2cFKB0JV5j1Y8GGWRObCwAR95T8oefprqVPyg1uMwIqUTaaH2K4ryMvArY7F+uEoDCutRt6EifkOndt8X2gp8P7ShZB1x9r0gyQZCcVAmhUMPz8YbEpomBpK1dbDfOCeM9YQIJxyUmdLrhPX2VE3tBLWORmHDvF1eol6OeUQsVoxiKU36DlHPT2JXcD1gJ639P4Mc5rMK+2jD4DmYBzTliuq6Hy6DHidBGbtDLxv2Jjw+8f+6Yyr/oYXfVhqb6v/cmnr8TXjPPwTF8e9Gd9M32jh8qUGehcImc1NucYm/0ldYxha0rxhVSwzyktUeLitET3V6Lab8gidaetbUnidAMzvVlAjbGmpfIIBPvzg+Txzxun/ewE4H/n68TPLPF8BC2GmdWTUh98/kaMDdINUsUI/hRUmCp+J+4f63mXkOIXaxEwqeXmm5Nbh8So+v2OgHjiPzrzbEASVh5bC49aO7XyFlMvgyXMCl3h0B8M6wDfcx1QiChzsnI Q3Xtig78 bwzUifad4eDtzvWWof4ksjTGr1XcHILhxjWJdx6Z3rDVglf2PwndpswPzRTa5v12uYmFm77rjGRi474Vv7oNs0wRIxJ3jyEPiwBkc3BuktFEnKOcPTyf1giFLBAZ3ubBXbeoS29HqJ/tW9ckFwExkPF8EZM6/tgxyG9lSCiVS8nDDy5X1AuBXIFj2wVwaqor+lCY0WW2wQlPYrYd+C4lcNSaegiDKrlshUCEz 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: List-Subscribe: List-Unsubscribe: In order to constify other functions, we need page_ext_get() to be const. This is no problem as lookup_page_ext() already takes a const argument. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/page_ext.h | 4 ++-- include/linux/pgalloc_tag.h | 2 -- mm/page_ext.c | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/linux/page_ext.h b/include/linux/page_ext.h index 07e0656898f9..e4b48a0dda24 100644 --- a/include/linux/page_ext.h +++ b/include/linux/page_ext.h @@ -77,7 +77,7 @@ static inline void page_ext_init(void) } #endif -extern struct page_ext *page_ext_get(struct page *page); +extern struct page_ext *page_ext_get(const struct page *page); extern void page_ext_put(struct page_ext *page_ext); static inline void *page_ext_data(struct page_ext *page_ext, @@ -117,7 +117,7 @@ static inline void page_ext_init_flatmem(void) { } -static inline struct page_ext *page_ext_get(struct page *page) +static inline struct page_ext *page_ext_get(const struct page *page) { return NULL; } diff --git a/include/linux/pgalloc_tag.h b/include/linux/pgalloc_tag.h index 62d8dad74b37..86ba5d33e43b 100644 --- a/include/linux/pgalloc_tag.h +++ b/include/linux/pgalloc_tag.h @@ -12,8 +12,6 @@ #include extern struct page_ext_operations page_alloc_tagging_ops; -extern struct page_ext *page_ext_get(struct page *page); -extern void page_ext_put(struct page_ext *page_ext); static inline union codetag_ref *codetag_ref_from_page_ext(struct page_ext *page_ext) { diff --git a/mm/page_ext.c b/mm/page_ext.c index e7d8f1a5589e..95dd8ffeaf81 100644 --- a/mm/page_ext.c +++ b/mm/page_ext.c @@ -514,7 +514,7 @@ void __meminit pgdat_page_ext_init(struct pglist_data *pgdat) * Context: Any context. Caller may not sleep until they have called * page_ext_put(). */ -struct page_ext *page_ext_get(struct page *page) +struct page_ext *page_ext_get(const struct page *page) { struct page_ext *page_ext;