Message ID | 20230104211448.4804-2-vishal.moola@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 706F8C46467 for <linux-mm@archiver.kernel.org>; Wed, 4 Jan 2023 21:15:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E9E8E8E0005; Wed, 4 Jan 2023 16:14:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E4EA78E0001; Wed, 4 Jan 2023 16:14:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CC8FE8E0005; Wed, 4 Jan 2023 16:14:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id B2F088E0001 for <linux-mm@kvack.org>; Wed, 4 Jan 2023 16:14:59 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 8FE2E80C4D for <linux-mm@kvack.org>; Wed, 4 Jan 2023 21:14:59 +0000 (UTC) X-FDA: 80318371518.28.9E33F13 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by imf11.hostedemail.com (Postfix) with ESMTP id EE78940018 for <linux-mm@kvack.org>; Wed, 4 Jan 2023 21:14:57 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=bjZkMxIP; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf11.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.214.178 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1672866898; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Yo+m9KCho02Llmwjmz5bDSbKVzw32DqjrZ5KrSHhgyc=; b=Ru1674ke7biYXpHmqXpd9UPDFeOe60tnghYnuTNjzbvpTpIwmjfk5XHOm6P8J+Hu/I5sLi 9jTqdOY7zc6AkZjgQz5eVAgeVfw4ufdnX5Anod2EwQ+zaLO3kkJf4fbPLtukrF50Z9406N RbdGwR6abJGwhhPESThF/3Tu88cZ5hc= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=bjZkMxIP; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf11.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.214.178 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1672866898; a=rsa-sha256; cv=none; b=ovJ0U53K3Dxy6S0FmcgSG1CbGmY8F6K6pygq7UGS4x2oDk5FfHpzrbOXMEoAbFuWs7eNCl +m2g1VxsRrsnPojWJAduYYk8cIHWUICsLocvxJkRwc3nj89RvKqQ7LY9o1bipbA5G3afgJ BaES6Zi2NIzAeFVXJIzE/2uJz1Qn9PE= Received: by mail-pl1-f178.google.com with SMTP id jl4so30935588plb.8 for <linux-mm@kvack.org>; Wed, 04 Jan 2023 13:14:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Yo+m9KCho02Llmwjmz5bDSbKVzw32DqjrZ5KrSHhgyc=; b=bjZkMxIPNZ3wmKI3QGSepT81I5OzcwJOIb/dnupKeJzgemoOZcjM4yfreHA+pwVbeP HOd/bgUCet0z9B/XX2tfep3wWWWYLyeCIHFa1NDUjFWQdX5A572uwUJHv92lvCUSn0jH nDD1ayF0cF1sYXZY6D7okVUr906wpDImdUvSkzV/8th2CAYrKdz3orCKBweWTHnMlK4j 8Q9LXTwaogmTrXs5Gj4PAGJAZD90/jRoTwO/o58iZ0J59ckgaPVRY99HTFyy5G/KNc7Q k+iq8jJPMbsMV3H/So6AzW1W8RbB4qBsSsxHHBAFfFQVhi108BAllJmmP6SyPMsZeGbG 6mUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Yo+m9KCho02Llmwjmz5bDSbKVzw32DqjrZ5KrSHhgyc=; b=MhDEKpUA9L1v+QQUoCTnKUC0d3mud2FQGQmLV6LXfQwDIh6OkwSWv8t9zQEEp1fhxJ D9q7h6K81gMfw/7qhT1dchQ7t4nQPkSBWZzq/n7IR/dB9PiB16UzManwb22WbfQC2ypD D0UjTYQpbSzDkAgG2+0/QYsWCpJHRvdPGVbSrFuEVSgqw3uIWUdBri1VU1qEolC3yO9S +Y67GxSxcy+nOP/JMv/4KGcYWWJ6Vt78xSESXTbtWvgQnS148Kn+ri6U7fGIBs8HhNGI aBTFGDM330jxOt2C9R894Upu/H8du/vPLDdoacH/7vUQkmgnPPWefBohHHAeHmIm1SIh l7YQ== X-Gm-Message-State: AFqh2kpMbfgoYBRa5W7LatsEa+cQcYYhFEowSKFuMk+EmWSC+mS2wdX5 BDKFJ9JYg6i1VOPHw/9nwvk= X-Google-Smtp-Source: AMrXdXtzyCslo5KrrtE6aj4KE0tZMImyQpChectqYz62yJ5Pkw2zwmGtohmj+/DGwHCRBdZk95hgJQ== X-Received: by 2002:a17:90b:92:b0:225:eda7:13e with SMTP id bb18-20020a17090b009200b00225eda7013emr35757516pjb.40.1672866896879; Wed, 04 Jan 2023 13:14:56 -0800 (PST) Received: from fedora.hsd1.ca.comcast.net ([2601:644:8002:1c20::a55d]) by smtp.googlemail.com with ESMTPSA id i8-20020a17090a138800b00226369149cesm6408pja.21.2023.01.04.13.14.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Jan 2023 13:14:56 -0800 (PST) From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com> To: linux-fsdevel@vger.kernel.org Cc: linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, linux-cifs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, linux-nilfs@vger.kernel.org, linux-mm@kvack.org, "Vishal Moola (Oracle)" <vishal.moola@gmail.com>, Matthew Wilcox <willy@infradead.org> Subject: [PATCH v5 01/23] pagemap: Add filemap_grab_folio() Date: Wed, 4 Jan 2023 13:14:26 -0800 Message-Id: <20230104211448.4804-2-vishal.moola@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230104211448.4804-1-vishal.moola@gmail.com> References: <20230104211448.4804-1-vishal.moola@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: EE78940018 X-Stat-Signature: 9zagu6ijkhph3rztbfaxoahrzmcp1h8g X-HE-Tag: 1672866897-521526 X-HE-Meta: U2FsdGVkX1+KiHTYE71qz8Bq8QpWzjy1wleW8y4MBt/WG3KhMSZNjXt+TCczX0hBqnWYGDzXoa/B9GHgGHXoHKXlWypWGAVWLOWa6/t6cGTbaZ2yVDhWVV9erBJky8UfO0BvM90X7uUVtMD6Et7AtVcfVbNlvIuzYd5dAj08C5dcY59Kz9fOjikH56AF4ZaCmLWZdNQBvVjz1Zxad9+PNEoIZOQRDLHldgqejtd7vy5WpYnPTD+HoCQiiHxR/Ur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ux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
Convert to filemap_get_folios_tag()
|
expand
|
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 29e1f9e76eb6..468183be67be 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -546,6 +546,26 @@ static inline struct folio *filemap_lock_folio(struct address_space *mapping, return __filemap_get_folio(mapping, index, FGP_LOCK, 0); } +/** + * filemap_grab_folio - grab a folio from the page cache + * @mapping: The address space to search + * @index: The page index + * + * Looks up the page cache entry at @mapping & @index. If no folio is found, + * a new folio is created. The folio is locked, marked as accessed, and + * returned. + * + * Return: A found or created folio. NULL if no folio is found and failed to + * create a folio. + */ +static inline struct folio *filemap_grab_folio(struct address_space *mapping, + pgoff_t index) +{ + return __filemap_get_folio(mapping, index, + FGP_LOCK | FGP_ACCESSED | FGP_CREAT, + mapping_gfp_mask(mapping)); +} + /** * find_get_page - find and get a page reference * @mapping: the address_space to search