Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp782300pxb; Wed, 27 Jan 2021 23:09:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJx+7llY8P9n47GHppdqcCiDZNjbZyIhRlqpTlQTByp1XZ/SY0pAkB90TcFjdocYK9dfrWYa X-Received: by 2002:a17:906:3f89:: with SMTP id b9mr9398244ejj.204.1611817787758; Wed, 27 Jan 2021 23:09:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611817787; cv=none; d=google.com; s=arc-20160816; b=h7vCb3VEUtpHz+KLv/l33HYh58pILludp2ImydL+GIzntC/60p1jY8ooR7GeFJUG+j /m6+nNFfmoXi/SmhLsGWDghNRP8787Hf743pLM5M45Q01WtDh+4sygu+fq0t2VnGuC7d 6QVBvOR+HY70SOYhnToWwm6R2j8AjHrlude0/Pg7q62kYE+5apvukwVnueVOr6KDhGNu uM7bg5/1ERmDL/xvAktPtn0Isw5qhiFAsQzGHe2iPG41svo+nlg2X37/HdKSZaKR1B9y 8MhMf4dTVyphgGr36bst6mq+lYXVu2O4p/CZPggNG8AodEX4bdHEXsSX2KrCGvV3xoga smew== 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=WrcE9wDLGwcgqmg9jOBMPtFnKP9h0xvtDeRBx/lUkUM=; b=uVEOMEXQIGIteUsptGHrtcXZST9csrC+q72LEl1umSl5+UoqIJ/qu+riVmzOYCZwo9 cI2SxdAp8OZUV7eQskMM2XcAPHay/qWSdXA1Di7WGX66MpdhDjk3qoK+LIVVCFAVObrW imUhtiW4c8Jaa/HQCH/WkpxWU++2Z7Km6WbkXsAhprPnca5lDco6A0k5MT++waWA+XPW y6NijZ9fp3tNdzHUOhslXD+Ai5tfMuNuNZyiiKD/T9E9IsJNDUT+8nl7XyHGC+GTIdCd 0asYGIWE+9pQ8FQRI8LTbOaMWt9d5s3gQ4npOsbDYZaes4drAjlKPuZHGEW0HKu1gc4v hYYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=R4a+DNuR; 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 f15si2068166ejh.394.2021.01.27.23.09.23; Wed, 27 Jan 2021 23:09:47 -0800 (PST) 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=R4a+DNuR; 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 S231597AbhA1HHq (ORCPT + 99 others); Thu, 28 Jan 2021 02:07:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231540AbhA1HGp (ORCPT ); Thu, 28 Jan 2021 02:06:45 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D67DC061573; Wed, 27 Jan 2021 23:04:52 -0800 (PST) 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=WrcE9wDLGwcgqmg9jOBMPtFnKP9h0xvtDeRBx/lUkUM=; b=R4a+DNuRMUROgC5bZJpYYWEIKq cG+V8j2Im9pzS9xlxg7vBc9Pq2AnAjWq7DNKFQbCwfk9M5unx0e5ExjyMnQUDHmLhQWO1FcqUVAu0 tSeIo4KLmO2eS51f28D2jIEsCTr1RA+uEMWeDhE/S/yItfs0luLTHRw32i+CPdTvtMNfMzGNRrJof M8UGoJHkk4qLcKzC5ZOZ1ol7BXk32+zn6rSXCsHaYAT5qeKbo9tl3OwFUGi0Px/FNYfpodwHXEJhs Oh2JGB90MNWCasKj6cvLUJT2e0ejCsxAniSVlprgeN42swk0wSwY4Sr9VGJzUSGh26IcNS8LwA8lB YLgKDZCw==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1l51MF-00848W-Mn; Thu, 28 Jan 2021 07:04:48 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" , linux-kernel@vger.kernel.org Subject: [PATCH v3 20/25] mm: Add wait_on_folio_locked & wait_on_folio_locked_killable Date: Thu, 28 Jan 2021 07:03:59 +0000 Message-Id: <20210128070404.1922318-21-willy@infradead.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210128070404.1922318-1-willy@infradead.org> References: <20210128070404.1922318-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Turn wait_on_page_locked() and wait_on_page_locked_killable() into wrappers. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/pagemap.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 757e437e7f09..546565a7907c 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -730,16 +730,14 @@ extern int wait_on_folio_bit_killable(struct folio *folio, int bit_nr); * ie with increased "page->count" so that the page won't * go away during the wait.. */ -static inline void wait_on_page_locked(struct page *page) +static inline void wait_on_folio_locked(struct folio *folio) { - struct folio *folio = page_folio(page); if (FolioLocked(folio)) wait_on_folio_bit(folio, PG_locked); } -static inline int wait_on_page_locked_killable(struct page *page) +static inline int wait_on_folio_locked_killable(struct folio *folio) { - struct folio *folio = page_folio(page); if (!FolioLocked(folio)) return 0; return wait_on_folio_bit_killable(folio, PG_locked); @@ -759,6 +757,16 @@ static inline void wait_on_page_fscache(struct page *page) wait_on_folio_bit(folio, PG_fscache); } +static inline void wait_on_page_locked(struct page *page) +{ + wait_on_folio_locked(page_folio(page)); +} + +static inline int wait_on_page_locked_killable(struct page *page) +{ + return wait_on_folio_locked_killable(page_folio(page)); +} + int put_and_wait_on_page_locked(struct page *page, int state); void wait_on_folio_writeback(struct folio *folio); static inline void wait_on_page_writeback(struct page *page) -- 2.29.2