From patchwork Sun Jan 2 21:57:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12702369 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 7876FC433EF for ; Sun, 2 Jan 2022 21:57:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 33AF56B007E; Sun, 2 Jan 2022 16:57:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 29B0C6B0080; Sun, 2 Jan 2022 16:57:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 006876B0081; Sun, 2 Jan 2022 16:57:40 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0067.hostedemail.com [216.40.44.67]) by kanga.kvack.org (Postfix) with ESMTP id D10366B007E for ; Sun, 2 Jan 2022 16:57:40 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 8F0698EBFC for ; Sun, 2 Jan 2022 21:57:40 +0000 (UTC) X-FDA: 78986709480.01.62D766A Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf05.hostedemail.com (Postfix) with ESMTP id 3911710000A for ; Sun, 2 Jan 2022 21:57:40 +0000 (UTC) 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=lkzBBTBtnaYHbEwMclgvuY6YoqFw72+OidxpJYTyEVk=; b=nhRTvks2nUT4t4t9TEwzGs4x9o NBCf32l1eVloky9O/jtn7odwou6rxHG9i9v6VVxXjGfO1diKu5NW3m0B7i8ZAbyzXYE+JLporRSd/ 85YivczD/jrT5Hy6bVfvGuF36DgSo7OeGV7bcfogtT2fYeMKCAAE1IBJW7p0+SPLCgBxWocLz1ofI vv1OoOZwAzt0tZhKh+hzwBzc98iBdnTSlDC7dTCf+qaR1yKDTKQGJZSbE2JJWNMiODWMDziT1vq00 RON7MhOW/sI//Yj3A+g4Jbsyvku5IJnsZK5jBWkwzZHVPOSao45AkTDh8NGLiOpuvJ5utjTSYJvrA APPTm0mg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1n48r6-00CLo4-1o; Sun, 02 Jan 2022 21:57:32 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" , John Hubbard , Andrew Morton Subject: [PATCH 03/17] mm: Add folio_pincount_ptr() Date: Sun, 2 Jan 2022 21:57:15 +0000 Message-Id: <20220102215729.2943705-4-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220102215729.2943705-1-willy@infradead.org> References: <20220102215729.2943705-1-willy@infradead.org> MIME-Version: 1.0 X-Stat-Signature: x19hh34tjg3nnya6aegj7jfmyn9cxeto X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 3911710000A Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=nhRTvks2; spf=none (imf05.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-HE-Tag: 1641160660-440852 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 is the folio equivalent of compound_pincount_ptr(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: John Hubbard --- include/linux/mm_types.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index c3a6e6209600..09d9e2c4a2c5 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -309,6 +309,12 @@ static inline atomic_t *compound_mapcount_ptr(struct page *page) return &page[1].compound_mapcount; } +static inline atomic_t *folio_pincount_ptr(struct folio *folio) +{ + struct page *tail = &folio->page + 2; + return &tail->hpage_pinned_refcount; +} + static inline atomic_t *compound_pincount_ptr(struct page *page) { return &page[2].hpage_pinned_refcount;