From patchwork Sat Sep 30 03:26:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Dickins X-Patchwork-Id: 13404927 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 E38F5E7734F for ; Sat, 30 Sep 2023 03:26:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 850C68D00E5; Fri, 29 Sep 2023 23:26:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7FFB78D002B; Fri, 29 Sep 2023 23:26:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6EEAC8D00E5; Fri, 29 Sep 2023 23:26:59 -0400 (EDT) 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 5E7018D002B for ; Fri, 29 Sep 2023 23:26:59 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 27EE540675 for ; Sat, 30 Sep 2023 03:26:59 +0000 (UTC) X-FDA: 81291827358.12.C0C215C Received: from mail-yw1-f174.google.com (mail-yw1-f174.google.com [209.85.128.174]) by imf01.hostedemail.com (Postfix) with ESMTP id 5BCF540003 for ; Sat, 30 Sep 2023 03:26:57 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=0xcq8iIz; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf01.hostedemail.com: domain of hughd@google.com designates 209.85.128.174 as permitted sender) smtp.mailfrom=hughd@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1696044417; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=sJer9ozabqTWGrTyLZzHy82X8q3kDfNExG34jhppfvQ=; b=0GVsENqUBcvTouNdsYwp2ZntI2EMoJ24NoMCftN2IRqDRJGz98dVvzw8YiAUgcWmzIlsOi v7r0KFHFIGcsl0Ym1UWnaaV5wxo+NfrRYIs/1B8ib7lhlHJ/ChW8FlQZCMuIg+ndGk6ihG xXLC9rywZtTTrLvLzjvSGdTYJkwV7bs= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=0xcq8iIz; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf01.hostedemail.com: domain of hughd@google.com designates 209.85.128.174 as permitted sender) smtp.mailfrom=hughd@google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1696044417; a=rsa-sha256; cv=none; b=NVsqf1fE3lt442IX5hebFlbrHgrvBQczp5qioPlBOSY6A2KyMNbUCU10pXLfsHZUGk2TsZ W/sldct0J6EF6CTOjPCr5xSuO4vXK2Ix+JM+NIF4LpK+Q+PUEvYO7QogAOB51l0IKIfaCd sm0qBELRvYGEgCXWUVnQxSOfES9H5UA= Received: by mail-yw1-f174.google.com with SMTP id 00721157ae682-5a1ec43870cso80224637b3.0 for ; Fri, 29 Sep 2023 20:26:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696044416; x=1696649216; darn=kvack.org; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=sJer9ozabqTWGrTyLZzHy82X8q3kDfNExG34jhppfvQ=; b=0xcq8iIzVnPI6fFNyt3Wp/oU/tAuQZPNvze2qyjRa2l1OnrizvuIL2KKB4HD4vo+S7 hiPekzhvKgFpnvrQO2cVIxOmbOdI2dRoVdwOu9iKMHFYAjjyuAqJGbtRrB7b3F3sUszs Hdti/e9kNDvcCupuKlEDnFI8rRJV9JrSBlacVg5lJ8zxwR6zAhHtYKBWxf59+28W+JLR Vd8K8tCz02jnex/mm7aOwsFYO+MGYdPtWPxnggoxOxnQs7Vbjw3UUe5xyNhcRJLHD3xB aPB40jfKrf9fpGxyq0Ry4GBOHLZUT+UBik9FDvfrk49yJMb+989emWbbZHVkkF5JjiFA ojYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696044416; x=1696649216; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=sJer9ozabqTWGrTyLZzHy82X8q3kDfNExG34jhppfvQ=; b=AlzxfWOQfdTLF3UbKdSqdeYk/OvngipTcFZz8EGW3vcJSJ+oyjbBC6uJkmwGi3N4og u1Vj9KbKHqolXSmzG5ediVNUMExN6khUcirnYG3iATUepVVtou6gdzPwNmdQRQbrgj8A W7Kp2J8D7UlsbnA0+dgKgpZtl8WLdn0LohHMcrwr69gR9DbLKaqj9fqRLsxsA+1ls/V3 RZgQ3JtO1til5o/nWBJfIt8uKLTlThqyRbxJXTRSz3vCaiedFtV6APYCBpzYH2Ifnc/b eGv5k8zNrtSOst0JHkpu9q9yXYavoGekEA3mtVJHf1/pOmfuGe1jGPWCTHCkkD8yR7L2 nVOA== X-Gm-Message-State: AOJu0YyNvTVZff5IWX/3dgGmQP9HurSa10n3qmvoup7Vk5eQDhP6hDhe rI7k1WTRbcXz9izRAaL93pCGVw== X-Google-Smtp-Source: AGHT+IGY8b1GCtjEjvU2ttKYxnk/izTsxRAU1oyYCFwLsKOA7sQuqVX2C4n+cWR1fH9H4i0FnhEwjg== X-Received: by 2002:a0d:cc4d:0:b0:5a1:8b2:4330 with SMTP id o74-20020a0dcc4d000000b005a108b24330mr6138174ywd.10.1696044416338; Fri, 29 Sep 2023 20:26:56 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id w5-20020a0dd405000000b00570599de9a5sm2955343ywd.88.2023.09.29.20.26.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 20:26:55 -0700 (PDT) Date: Fri, 29 Sep 2023 20:26:53 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.attlocal.net To: Andrew Morton cc: Christian Brauner , Carlos Maiolino , Chuck Lever , Jan Kara , Matthew Wilcox , Johannes Weiner , Axel Rasmussen , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 2/8] shmem: remove vma arg from shmem_get_folio_gfp() In-Reply-To: Message-ID: References: MIME-Version: 1.0 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 5BCF540003 X-Stat-Signature: 3fikazun7i6jcew347gh35czg4kmyo3r X-Rspam-User: X-HE-Tag: 1696044417-25432 X-HE-Meta: U2FsdGVkX1+D599oQ+3Ha5gph5aHw1Br0OzlBgz8m6F7A05/m0m5YIRwVuZGHh8+muSrkzielRQiE4MP3YaVyxMfEvAUBUTTKoR9e3EIA8p7bC1b0tIcZ7EWWlClGUsBrSKqPWM2sGJS5SPlymFnrOmsJXUiLyw2xBYaUUs7419mHLuYVuq8Izaej40mcwQ7F3K2DHK6+K8L4IPp24viqyhEP9DHezMN0Jq31CEMvbi5enlf4hOhQTHcmiXjmHUm22sSH1mV7N0xuHwioCEKjjCDPbNQC3MmxXtPnmbFKlgFwSSFA0mYyhya4BH5Xv+76rvsIpR8BYZ18chVPO5suXJ6cDaBl1yaDZZrjhi6+wckwVjZUS5T3JmIxf0pgRS9bpTUOTi6/0oob8t13kVVsYynWq5I1iaw+1GO6EP2So+9FyPaowyqdCH2haQkmQrwutOO6NxWJ0GNimh+0fvQspNhbbkqjN8tR2zwWqG+pdlW3hXKKzGTnW5bp28QW9RQRiSEdEOkc4FRRwLGE+CM5hX1KUqWdN7YQ8N9M6+GooGGBptvDok1ppsq0yWnuyYIFHULMsUjl2UgSI3U4PoinKDll6kOiPtPDSlPFfmUll1uPJZ9Gam0u9R84do7zAqZ9TmtVH22fFBDklN/eJP1XofmPxWyO7W14XcNKyZNmGciaCICQuzgUgNJqLWq/+uAzEsb+UCfTs8sNBOUnvtY7QSWg4UVS0r2qN+hPVOIwoTmlNgk9AC0ztvpGx2+eakfzkILVEMSFdHzUzK+BO87EYTmVuV1swfyIIwj98xTWDJvtAnRZWdWEWkGcmnWk66Kfw+AmaquLePxC86u0AZuaxY9RX8f/s+dR8sPYgOL3PWGs6KL1dk/Bm44JueCeF6dnztdLDcCi6cKmohEbMTrdYcO1IDcbgy6BDn8EYPkzUihFjbkVR3Ywo/mfT1cQRg73MfjRuMtNO7AhlfTnJ5 9VB4QF3Z CB9y1tlWUjSeS0Vlx55o2BsTO+MUYeGj2h+pftioTZbHUU5X85QDQVZbvdfSuOyYtmsmPpls/BUaDChwB1ZHMe9LAABJrrlFV5qBEbLbvtnXYj88AUwsLo/VpuPJRn4qTBFqPGdMC+31MKH8JB/IyX8DQWKX1ie2AEc/G1SMXxF9KWloz5T4QjD3iuEHFuiZPuDN44E5CNr+Xt3ZrKm/pa04Bk2XGedqmfps2nzCaj47WiPDfnPjvAHU+3b48yePmpiz0uPHmjfp2WqA6ioerkWcCEUADZRS28L1wiN2anGI4HXiJOZcSpeoQY6WclwymZMytxsGkxlD6fW4XhLpWYL7rRg== 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: The vma is already there in vmf->vma, so no need for a separate arg. Signed-off-by: Hugh Dickins Reviewed-by: Jan Kara --- mm/shmem.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index 69595d341882..824eb55671d2 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1921,14 +1921,13 @@ static int shmem_swapin_folio(struct inode *inode, pgoff_t index, * vm. If we swap it in we mark it dirty since we also free the swap * entry since a page cannot live in both the swap and page cache. * - * vma, vmf, and fault_type are only supplied by shmem_fault: - * otherwise they are NULL. + * vmf and fault_type are only supplied by shmem_fault: otherwise they are NULL. */ static int shmem_get_folio_gfp(struct inode *inode, pgoff_t index, struct folio **foliop, enum sgp_type sgp, gfp_t gfp, - struct vm_area_struct *vma, struct vm_fault *vmf, - vm_fault_t *fault_type) + struct vm_fault *vmf, vm_fault_t *fault_type) { + struct vm_area_struct *vma = vmf ? vmf->vma : NULL; struct address_space *mapping = inode->i_mapping; struct shmem_inode_info *info = SHMEM_I(inode); struct shmem_sb_info *sbinfo; @@ -2141,7 +2140,7 @@ int shmem_get_folio(struct inode *inode, pgoff_t index, struct folio **foliop, enum sgp_type sgp) { return shmem_get_folio_gfp(inode, index, foliop, sgp, - mapping_gfp_mask(inode->i_mapping), NULL, NULL, NULL); + mapping_gfp_mask(inode->i_mapping), NULL, NULL); } /* @@ -2225,7 +2224,7 @@ static vm_fault_t shmem_fault(struct vm_fault *vmf) } err = shmem_get_folio_gfp(inode, vmf->pgoff, &folio, SGP_CACHE, - gfp, vma, vmf, &ret); + gfp, vmf, &ret); if (err) return vmf_error(err); if (folio) @@ -4897,7 +4896,7 @@ struct folio *shmem_read_folio_gfp(struct address_space *mapping, BUG_ON(!shmem_mapping(mapping)); error = shmem_get_folio_gfp(inode, index, &folio, SGP_CACHE, - gfp, NULL, NULL, NULL); + gfp, NULL, NULL); if (error) return ERR_PTR(error);