Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp277114rdb; Sat, 30 Sep 2023 04:22:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHtaqjZDJ2m0tWneB99q4M49rvJXev7XKQmV5kzR5njfOJgYVVBwxY8UJahIbJih1KKZNeR X-Received: by 2002:a05:6808:498:b0:3a8:8ea9:76f1 with SMTP id z24-20020a056808049800b003a88ea976f1mr6610045oid.15.1696072925715; Sat, 30 Sep 2023 04:22:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696072925; cv=none; d=google.com; s=arc-20160816; b=iLcF8ZF9LH/FMKCDBMYaU4SpZkw2fbm3U+q/eh5shJMt3mKopmVMqtZ4nlFzRiTA5b VRgy/lf947KKBacX5E5Sb2VshFgg+gJ9q4azf4a/YgaZwB2t1jZ2CHUzc88qcLQri9zA 50g4YyLdn1fApv4Ti5/Yl2Nr0eToNmc7zkOHLGASyD+eU6d6+ALRzuOqzUmLTtUI6xhE bqHlyL3+vdevt4ts5aaPQzz2J3anuCajmpZjt+HsV+iIv5eBrzPiNkeAUSVJy/db7Cx6 8uVAnd889AgLh8N939GVkze/f+9M3HF9NM6jMjesITZ/6a8uQBCHVCLvhFzlal6st4rw sUbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=sJer9ozabqTWGrTyLZzHy82X8q3kDfNExG34jhppfvQ=; fh=/7ATBtl13IkXPUVLJiWoEEujdBMJVg+aOBnIIWbOQtQ=; b=scAEuYNh0IJb24d3cZ/i+6GOpCVkT+c+fpCeIKxRSiGVv9ty/XNBj5PR9zPRgVWZHD sKTLTetdpb4uX9J+YxaKNVdTOXOo60DGiWT9tgDMUPEGLSvjrcjGLdn/W11rcK6whybO 1uGr6bwTkiyYfq16RbN3u/lgPTB53QHXia2tAnQWUpS1je3djZ5ybcwZ+L20HAWbjoi3 HRMvNgLL/XqIETaHSddE4XSeM8PUUTgGvVlnLwB0KeH/sIdUShEUyRdajTzUh8gJS+tu nY97MkLpiHwgxso8Z0GHVcZ03AFOCoBu1lcJAO7l1mss7ZAP5iQLZ6XmTx3Zl6lJZsGs 3a2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="wMIcQ/+d"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id s132-20020a63778a000000b0057ab7f46d3dsi2268559pgc.108.2023.09.30.04.22.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 04:22:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="wMIcQ/+d"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 6AAA8819CC35; Fri, 29 Sep 2023 20:27:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233945AbjI3D1C (ORCPT + 99 others); Fri, 29 Sep 2023 23:27:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbjI3D1A (ORCPT ); Fri, 29 Sep 2023 23:27:00 -0400 Received: from mail-yw1-x1132.google.com (mail-yw1-x1132.google.com [IPv6:2607:f8b0:4864:20::1132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44A41DE for ; Fri, 29 Sep 2023 20:26:57 -0700 (PDT) Received: by mail-yw1-x1132.google.com with SMTP id 00721157ae682-59bbdb435bfso179943597b3.3 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=vger.kernel.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=wMIcQ/+dS4AwwLKyybFNw8DoqNOiJuTnJ8FkHUqUoh/zQG755xqHxSNKErdpWzj9ne 3Afh993WJw4H2ZQm+cPo2ivxijiF6o9yvTiA+oGXy+GGckZzV48i6cOh4yCt4xC1kFdW icenesc0Qe0UIrHXTM6M0+lw/vI9DjwmL+ElmakEjToPVIPDT4rffLd+4dY3YL283RA2 GUriBonnTU4rux3MLs7llH2bA/iALKvFhxvs83DY6vgaandorED9f+C24BQBQj6HuORu wtciLO21kZzvcHlZeZLR5h2CK4HakY5lUnH84XAOf5oqwxR1+feuhuU7l+8+FChF/w/n /X8w== 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=q9GokbMvRia28xW2BPRcdF4hhOW6Jos4Bj5KpqVWhKmaJMyE5cV+0zSEbEqcju2iIS 8ZWOeZKF6aIHh9RxQ7Ci/WzTZP8FGt3rm6ks6lG+OUDf5EvjDPIdBTh2raVlQy+hMkeI 9/9IxtINaFNlsFr6N0kTHa0NDQhRoOPSiVEo5eI5ZUmDHy9OfuyvHm6hgbEKrmD07mc0 Namq8eoR2c8Vb7nmfslNN/if6vNn6qCJnV7SWRivTVOIWvzNnZbhlPQxKDUadOtKtc7C gOc+YawpF/ku9mNeoswKOJ7iLCi275w2MlAE8Nj5YtWVQMhQpthOYMTE/QrkuZ2C8UOu tzyQ== X-Gm-Message-State: AOJu0YxIsj95Vs5zru4kPR0rjgw0tk5vJx70/PqrX7GXnt0iZ45CAh+h bx9VMrAZKbsZgRvwMlnAvGbJRw== 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 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 29 Sep 2023 20:27:24 -0700 (PDT) The vma is already there in vmf->vma, so no need for a separate arg. Signed-off-by: Hugh Dickins --- 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); -- 2.35.3