Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2090281pxf; Sat, 20 Mar 2021 04:17:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwfXiECHs/ARgq++jGpB51yVY5pScd29GSXh+Glf3BK1sv3noPDv1cbQ/GNeVgXaZpWF5L X-Received: by 2002:aa7:c98f:: with SMTP id c15mr15247093edt.231.1616239031031; Sat, 20 Mar 2021 04:17:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616239031; cv=none; d=google.com; s=arc-20160816; b=NrGLEtrpZfnGnOa92SbE1st0+XnCzVjH25TL3zt+IHDAu/c0om8ZbKzCGysDQGCxNr xTyg1RzC9Zz3pcciVOxBY4Pzu1Alz8T/wZVby/jKY1DyIWk710BRCJZFHRn2486Ves3j 1QGLjT1aM42Ycu0JQ981YlofSdQ62nX+dZhAmq6Pm/xa50TUJlFffum0+ZVN5zuqwKDU YX06xCYNqfvzvJqLS1ZVVxBdl+svNeExiMrd2hlhDxdSFbNQSfmev3U91oNyLygYJDhF Dv2MlIk3NpkJ775CQn5NnkXYiddyasmErvf81OQdIEKO2o/YWgEiKtgeHCgRdvpXLfOx WBOA== 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=wGOrmW1WO8PLFeoyKHq4CM70Gdmu6Y9uruxKpwDZheo=; b=GiV6jRsboG4l7nw7n7SW3So9j+c6em4pqPag8XGG6Z35/hl3TZpXUv+rUDZ12XuugP xbMXtMzIheW3Q5ZXAkdx0hjszcuiKB7hZK2KjDMjY70ZA8eFy0tLmWxbiI1woKCqFiWG mWRX2/bXTaKfhtAW1GMXTJp24YYH5Rj67411gEpl97lqGqQEKAMyKmFVeVCx10sS/CAU bbIUvDQ95sjshMFF9gcLZAJi6c8ANHiKtYu+xSfqxBOqnfcSMaE9oyner1LYp4UcJ72L /ki7zsneerIGGCRXxee5qElXy2eFy6G/q4hcuw56tVIF9+aoBeAa1a/qeCoOyabayUSh qIhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=d6BkK24W; 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 bf4si6154166edb.291.2021.03.20.04.16.49; Sat, 20 Mar 2021 04:17:11 -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=d6BkK24W; 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 S230254AbhCTFpR (ORCPT + 99 others); Sat, 20 Mar 2021 01:45:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230252AbhCTFoy (ORCPT ); Sat, 20 Mar 2021 01:44:54 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0964C061762; Fri, 19 Mar 2021 22:44:53 -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=wGOrmW1WO8PLFeoyKHq4CM70Gdmu6Y9uruxKpwDZheo=; b=d6BkK24WNV2S6p2a/K54YZ9thk g/e93oCy6EW9ZhCGbMwtNDxd11lqt2vkf6CgQ2cFSb4BJHMYTPmj/ktIFXDYbGiYp8kd3CyejC31b kN1ECEdCsldtPY46OPpNtNrcAW922lK2GQix/NMR6liSctD57vBy7BvKOVNh+M8gCKdC/AAhwKMO7 K0dmnvpD/IqyWPFAShl1VSuZgYkRalzqk8tfnTnvDAntYqEL1KPU8MnVmAWzyIaDzFSfoK+sktIok EJaqMOaUikEdqHFQRB3idWmr1gSrNdrSQ+wpGJoiV45O+qF1Yezfaf44iCLwKeryD7JELKDmQFyaR aRMpOafQ==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lNUP7-005Sj5-3W; Sat, 20 Mar 2021 05:44:07 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-cachefs@redhat.com, linux-afs@lists.infradead.org Subject: [PATCH v5 25/27] mm/filemap: Convert wake_up_page_bit to wake_up_folio_bit Date: Sat, 20 Mar 2021 05:41:02 +0000 Message-Id: <20210320054104.1300774-26-willy@infradead.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210320054104.1300774-1-willy@infradead.org> References: <20210320054104.1300774-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org All callers have a folio, so use it directly. Signed-off-by: Matthew Wilcox (Oracle) --- mm/filemap.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/mm/filemap.c b/mm/filemap.c index f8746c149562..f5bacbe702ff 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -1121,14 +1121,14 @@ static int wake_page_function(wait_queue_entry_t *wait, unsigned mode, int sync, return (flags & WQ_FLAG_EXCLUSIVE) != 0; } -static void wake_up_page_bit(struct page *page, int bit_nr) +static void wake_up_folio_bit(struct folio *folio, int bit_nr) { - wait_queue_head_t *q = page_waitqueue(page); + wait_queue_head_t *q = page_waitqueue(&folio->page); struct wait_page_key key; unsigned long flags; wait_queue_entry_t bookmark; - key.page = page; + key.page = &folio->page; key.bit_nr = bit_nr; key.page_match = 0; @@ -1163,7 +1163,7 @@ static void wake_up_page_bit(struct page *page, int bit_nr) * page waiters. */ if (!waitqueue_active(q) || !key.page_match) { - ClearPageWaiters(page); + ClearFolioWaiters(folio); /* * It's possible to miss clearing Waiters here, when we woke * our page waiters, but the hashed waitqueue has waiters for @@ -1179,7 +1179,7 @@ static void wake_up_folio(struct folio *folio, int bit) { if (!FolioWaiters(folio)) return; - wake_up_page_bit(&folio->page, bit); + wake_up_folio_bit(folio, bit); } /* @@ -1444,7 +1444,7 @@ void unlock_folio(struct folio *folio) BUILD_BUG_ON(PG_waiters != 7); VM_BUG_ON_FOLIO(!FolioLocked(folio), folio); if (clear_bit_unlock_is_negative_byte(PG_locked, folio_flags(folio, 0))) - wake_up_page_bit(&folio->page, PG_locked); + wake_up_folio_bit(folio, PG_locked); } EXPORT_SYMBOL(unlock_folio); @@ -1461,10 +1461,10 @@ EXPORT_SYMBOL(unlock_folio); */ void unlock_page_private_2(struct page *page) { - page = compound_head(page); - VM_BUG_ON_PAGE(!PagePrivate2(page), page); - clear_bit_unlock(PG_private_2, &page->flags); - wake_up_page_bit(page, PG_private_2); + struct folio *folio = page_folio(page); + VM_BUG_ON_FOLIO(!FolioPrivate2(folio), folio); + clear_bit_unlock(PG_private_2, folio_flags(folio, 0)); + wake_up_folio_bit(folio, PG_private_2); } EXPORT_SYMBOL(unlock_page_private_2); -- 2.30.2