Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp699293pxb; Fri, 16 Apr 2021 16:20:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyClJj1fauS7MlR0SKV8Wcqp3Q3G8eD/J6XYytfRz+7axcTaWvPbsN4X8E9pWyn2/+u7Jf X-Received: by 2002:a17:90a:9f8c:: with SMTP id o12mr11882344pjp.215.1618615213341; Fri, 16 Apr 2021 16:20:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618615213; cv=none; d=google.com; s=arc-20160816; b=MOpRYntdJ1sMFGfWwH1MsUYaQ5P/ER21yg3HhZoMQelYoFTP0TkFpnckt/JfSkW2Oe fNou+sj09tLwA67OMQoG/yt/6ChPkx8t9zPhX56VVr3qMEvwUI8kWy8JKYsgdcGKvMDH DpIrSXRSUYk1zUaomfEO2G+X+x5bvw9cDNhzpvkxNtihjg9Qax5lPB/DVR0YUy6HrA+U CCINVI2gZ6JgcGHBuce9BQVBkjp7CV8zpcuEo3vWeyF5sAJ5h4lVFEsZ1X3mXqBYavqG RaWxhtsyCpNUpTiNtFhEhAcdp1M6uxjjY66mVAZqkZNH9N0UkgNnVJMfRigUN1Xf9/Xt UdkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RXY5FTJ1nqvThpmAhIHHuvbXbki8r7wSKFoq944vSMQ=; b=reoFFW7/+UH8yNC4McwZikOjYUQtu5PmL93oh4xElyXw8IMWWNRjFted7n7d7r1x9g h2ECtG3mGxfsnIyeeHpoMwhFrPTZOP1TA34Y6/f7GE9uj5VjJ9/DEAxPr57+NQidt9gD e2gK56IJphcxjN87g5A9KmHvyuM8Gwul/CguuQAQPRomhLZjbvmGeqkQ+idSd27huAD2 L8cMEPKdqamVCHF6oxp/9vBdEDPinweB7DkD3ZO9ZWDNhAfp0IasPVupCYEbha+nRLP7 SZtHGsz1C3km7+1wf8oipKxEvC78LPfhwKUPl4g0vGj5Za6y39mhMMq7sgWgU8IPwIAr pZTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Fupb4VUC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d24si7884645pjx.57.2021.04.16.16.20.01; Fri, 16 Apr 2021 16:20:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Fupb4VUC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234777AbhDPXSu (ORCPT + 99 others); Fri, 16 Apr 2021 19:18:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231510AbhDPXSt (ORCPT ); Fri, 16 Apr 2021 19:18:49 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC438C061574 for ; Fri, 16 Apr 2021 16:18:23 -0700 (PDT) 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=RXY5FTJ1nqvThpmAhIHHuvbXbki8r7wSKFoq944vSMQ=; b=Fupb4VUCIKlRD7f3HV4DpEpbaU JRDXCJkbxCbA9h7Vff8Wso3lFbjWxbjBq9PnaS0dLT7UNJ5Y6meOyzKl5QLSM0L0HWVPGJP3/p6Lz k6aR2EY1iPKYcrhjaequcIJxeQu+WXOzh9aqfg9/DCA+j2KEKLHiH4hP1SUfPBtDy1LNh35LyV3A8 Y1kzXoZCm0XSb9lVHpJETqDKwfKP0pGzlcyh83qOX5Mq0UWH6ZlHOzkrt77mqEjyznINhU++SN6hZ In9fxqu5qoBVDZz5rVH/D3LJnw4KjEeIZPAQzFKBjkzn5vj4wQav+J5qUwgdQj2mSw9wXM/qZ9tqp UjCwhO/g==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lXXi7-00Aa34-SO; Fri, 16 Apr 2021 23:17:23 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" , Andrew Morton , linux-kernel@vger.kernel.org Subject: [PATCH 6/6] mm: Constify page_count and page_ref_count Date: Sat, 17 Apr 2021 00:15:31 +0100 Message-Id: <20210416231531.2521383-7-willy@infradead.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210416231531.2521383-1-willy@infradead.org> References: <20210416231531.2521383-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that compound_head() accepts a const struct page pointer, these two functions can be marked as not modifying the page pointer they are passed. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/page_ref.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/page_ref.h b/include/linux/page_ref.h index f3318f34fc54..7ad46f45df39 100644 --- a/include/linux/page_ref.h +++ b/include/linux/page_ref.h @@ -62,12 +62,12 @@ static inline void __page_ref_unfreeze(struct page *page, int v) #endif -static inline int page_ref_count(struct page *page) +static inline int page_ref_count(const struct page *page) { return atomic_read(&page->_refcount); } -static inline int page_count(struct page *page) +static inline int page_count(const struct page *page) { return atomic_read(&compound_head(page)->_refcount); } -- 2.30.2