From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE810C3F2C6 for ; Tue, 3 Mar 2020 04:11:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AB96222B48 for ; Tue, 3 Mar 2020 04:11:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="ZaDEfaIB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AB96222B48 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 36B916B0007; Mon, 2 Mar 2020 23:11:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2A6A36B0008; Mon, 2 Mar 2020 23:11:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1BC036B000A; Mon, 2 Mar 2020 23:11:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0133.hostedemail.com [216.40.44.133]) by kanga.kvack.org (Postfix) with ESMTP id DAB5D6B0008 for ; Mon, 2 Mar 2020 23:11:30 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id BABAB16462 for ; Tue, 3 Mar 2020 04:11:30 +0000 (UTC) X-FDA: 76552726740.09.base07_647632340221e X-HE-Tag: base07_647632340221e X-Filterd-Recvd-Size: 4911 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf15.hostedemail.com (Postfix) with ESMTP for ; Tue, 3 Mar 2020 04:11:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=HKBj/r+5qqU/6u7ewI1vtbWk6uoWZrUXziCREGzxOm0=; b=ZaDEfaIBp0e7SRlNP7qYToDCnT nrY070FksYNS7cZ4OFndrIU11/vlWZZDerzFMURlm0V9W3aaEnLvXxTd2WA47vPB2d2HKmKSKbSUz dWR/pkrQ/lkQbtQyTJfkTea87uCmTZiXid1siufRdOCgMgoogw3oPZI79Tz7CovV7EdYduVUUTaXw X/Fz30Mlweot4VnUBFGh1nq9GoCBpFrfV8nriQeUnYqf8P3pHVFMhkbD8BPYMdd0dtWA64EctO2an 5JGTjnCT07e+FxcmiEnQvKnzgcNnebe1YE8IBjGVr2iCFMOcT1rv+kumy4ZvBKnAsB4vgg4tFFDIt E9x5MmJQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1j8ytz-00053c-Lh; Tue, 03 Mar 2020 04:11:27 +0000 From: Matthew Wilcox To: linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" , "Kirill A . Shutemov" Subject: [PATCH 6/6] mm: Rewrite pagecache_get_page documentation Date: Mon, 2 Mar 2020 20:11:25 -0800 Message-Id: <20200303041125.19358-7-willy@infradead.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200303041125.19358-1-willy@infradead.org> References: <20200303041125.19358-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: From: "Matthew Wilcox (Oracle)" - These were never called PCG flags; they've been called FGP flags since their introduction in 2014. - The FGP_FOR_MMAP flag was misleadingly documented as if it was an alternative to FGP_CREAT instead of an option to it. - Capitalisation, formatting, rewording. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Kirill A. Shutemov --- mm/filemap.c | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/mm/filemap.c b/mm/filemap.c index 83ce9ce0bee1..7de79a2b8220 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -1574,37 +1574,34 @@ struct page *find_lock_entry(struct address_space= *mapping, pgoff_t offset) EXPORT_SYMBOL(find_lock_entry); =20 /** - * pagecache_get_page - find and get a page reference - * @mapping: the address_space to search - * @offset: the page index - * @fgp_flags: PCG flags - * @gfp_mask: gfp mask to use for the page cache data page allocation - * - * Looks up the page cache slot at @mapping & @offset. + * pagecache_get_page - Find and get a reference to a page. + * @mapping: The address_space to search. + * @offset: The page index. + * @fgp_flags: %FGP flags modify how the page is returned. + * @gfp_mask: Memory allocation flags to use if %FGP_CREAT is specified. * - * PCG flags modify how the page is returned. + * Looks up the page cache entry at @mapping & @offset. * - * @fgp_flags can be: + * @fgp_flags can be zero or more of these flags: * - * - FGP_ACCESSED: the page will be marked accessed - * - FGP_LOCK: Page is return locked - * - FGP_CREAT: If page is not present then a new page is allocated usin= g - * @gfp_mask and added to the page cache and the VM's LRU - * list. The page is returned locked and with an increased - * refcount. - * - FGP_FOR_MMAP: Similar to FGP_CREAT, only we want to allow the calle= r to do - * its own locking dance if the page is already in cache, or unlock th= e page - * before returning if we had to add the page to pagecache. + * * %FGP_ACCESSED - The page will be marked accessed. + * * %FGP_LOCK - The page is returned locked. + * * %FGP_CREAT - If no page is present then a new page is allocated usi= ng + * @gfp_mask and added to the page cache and the VM's LRU list. + * The page is returned locked and with an increased refcount. + * * %FGP_FOR_MMAP - The caller wants to do its own locking dance if the + * page is already in cache. If the page was allocated, unlock it bef= ore + * returning so the caller can do the same dance. * - * If FGP_LOCK or FGP_CREAT are specified then the function may sleep ev= en - * if the GFP flags specified for FGP_CREAT are atomic. + * If %FGP_LOCK or %FGP_CREAT are specified then the function may sleep = even + * if the %GFP flags specified for %FGP_CREAT are atomic. * * If there is a page cache page, it is returned with an increased refco= unt. * - * Return: the found page or %NULL otherwise. + * Return: The found page or %NULL otherwise. */ struct page *pagecache_get_page(struct address_space *mapping, pgoff_t o= ffset, - int fgp_flags, gfp_t gfp_mask) + int fgp_flags, gfp_t gfp_mask) { struct page *page; =20 --=20 2.25.1