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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55739C433FE for ; Tue, 11 Oct 2022 21:57:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 72035900003; Tue, 11 Oct 2022 17:57:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6CFAF900002; Tue, 11 Oct 2022 17:57:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 52159900003; Tue, 11 Oct 2022 17:57:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 40878900002 for ; Tue, 11 Oct 2022 17:57:13 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 0063A1407A4 for ; Tue, 11 Oct 2022 21:57:12 +0000 (UTC) X-FDA: 80010029946.30.8BF7B91 Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by imf09.hostedemail.com (Postfix) with ESMTP id A31C3140023 for ; Tue, 11 Oct 2022 21:57:12 +0000 (UTC) Received: by mail-pj1-f50.google.com with SMTP id l1-20020a17090a72c100b0020a6949a66aso245999pjk.1 for ; Tue, 11 Oct 2022 14:57:12 -0700 (PDT) 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=yKhqZ9JRxfUHd7ueXHu2hnxQ9xN5WH2xdUaf7T3ps+Y=; b=dur9V8U6avr6eGkxSZVUrKpuSoFFEw3r5SOEyHC0jqIiLFPOMXjVnqgh7rsvGgMJG0 6TfwFx3ajZ6v8lUQK/ljFO4/hzHBOlj0lEA8YLPsPLoLMsoHP29A/dC+cU2vEMpZZocn 36P7QGWbcTaTFZKWn0aSnczlTD0TSNV8ZzkFmr4X43sv9QQyyDXmpPZ5EMtC9Qkwm0bJ 6p5HMmqvoYWgDwaOwECANtWpHQh/a7lu3EwtFJamvh0YiuoQTzM3ebX9CCwtknosf6Hw nS5vPV+oe/1v7IJcBDTtMF4xkb9c6f78WXQ6ap4LAiIdoOPx68WG3gr853+NSp0KOpEu YlKg== 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=yKhqZ9JRxfUHd7ueXHu2hnxQ9xN5WH2xdUaf7T3ps+Y=; b=td4h39VLk+UTVfdoGZAVxSVlhXS8jjxMc6diPRK/Y1wwYSNq1fnLEAGB5rJ1hMvr5H irpo5F4L25ZknxCSCdK52/U/vfV26K8SnnyIXdWYwSPoIdDiL9cFUQlKZGYxj1zk6wCv fjd2b92cIybfN0juZLHP01G0TobpLKVYvkmNER6bLpNOl22FmeydZKtVwN5VHHM8HxUs d2OPr3DyTAuRpdCvac1C7SxmrEtkAGeomHrJ12XLerf3nrZXN8fC6Bh3bfFeiMZL8w4r GDBBeyFJ+M4UoXBpPVF6S6KHTREo+nXIe/praCNudUoMg7OcMr6p7rla4bqOWQZdWGNv 8QTw== X-Gm-Message-State: ACrzQf0MShZN5j0d9ZFjqNT4p+hcFxLbfaps1P9igU7J2F6ftwrEuBtG 2LYYCB8dGturihye8pqWwM2Lvfbx1moEqw== X-Google-Smtp-Source: AMsMyM5nSGmPeX92wxZjVokYJ/kQ1ovTA200qlKORsoRtP5J+yxFeMykTyyDynSg41ww8vRb7zIEkw== X-Received: by 2002:a17:902:e9ca:b0:17f:93b5:5ec8 with SMTP id 10-20020a170902e9ca00b0017f93b55ec8mr26066551plk.59.1665525431654; Tue, 11 Oct 2022 14:57:11 -0700 (PDT) Received: from vmfolio.. (c-76-102-73-225.hsd1.ca.comcast.net. [76.102.73.225]) by smtp.googlemail.com with ESMTPSA id z17-20020a170903019100b0018123556931sm6580371plg.204.2022.10.11.14.57.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Oct 2022 14:57:11 -0700 (PDT) From: "Vishal Moola (Oracle)" To: akpm@linux-foundation.org Cc: willy@infradead.org, hughd@google.com, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Vishal Moola (Oracle)" Subject: [PATCH 3/4] truncate: Remove indices argument from truncate_folio_batch_exceptionals() Date: Tue, 11 Oct 2022 14:56:33 -0700 Message-Id: <20221011215634.478330-4-vishal.moola@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221011215634.478330-1-vishal.moola@gmail.com> References: <20221011215634.478330-1-vishal.moola@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=dur9V8U6; spf=pass (imf09.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.50 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1665525432; a=rsa-sha256; cv=none; b=oGpCyxRTmhHqT9GgbKARTsSUSJmSmx8GC2UnNERLZCZvWt7ChTWihCIh/O+agufHyEnS8l CTLIpMuvs8MlN0uN8K/FcViJUeKHcDiKAXF7fkYNMO66bHJa1N5GfI4IJZLx93UShgnDgd eLQapPjGPWR4uLk4kDewV5FOT7UcTL4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1665525432; 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=yKhqZ9JRxfUHd7ueXHu2hnxQ9xN5WH2xdUaf7T3ps+Y=; b=CvwAPM7Cy34H7Ple1zMXDCWpZ/nu6JUTT3AOJy/p49ZtQDdVOxSgxF3NfTZ8Ob6CJ7Qute z/hvYCJsoEA4kFoP/OqyyEBWNaKM0JnnzGEB72sBuRPi55fvJ8lowRFwVOmQB8HJ4tDU6r bht1rEu/D+icMJvbXgF4zc88jYpTNvw= X-Rspamd-Server: rspam05 X-Rspam-User: Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=dur9V8U6; spf=pass (imf09.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.50 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Stat-Signature: yirao5ft71shbicipd7nxcn7dyhi8ya9 X-Rspamd-Queue-Id: A31C3140023 X-HE-Tag: 1665525432-164026 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 indices array is unnecessary. Folios keep track of their xarray indices in the folio->index field which can simply be accessed as needed. This change is in preparation for the removal of the indices arguments of find_get_entries() and find_lock_entries(). Signed-off-by: Vishal Moola (Oracle) --- mm/truncate.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/mm/truncate.c b/mm/truncate.c index 846ddbdb27a4..4e63d885498a 100644 --- a/mm/truncate.c +++ b/mm/truncate.c @@ -58,7 +58,7 @@ static void clear_shadow_entry(struct address_space *mapping, pgoff_t index, * exceptional entries similar to what folio_batch_remove_exceptionals() does. */ static void truncate_folio_batch_exceptionals(struct address_space *mapping, - struct folio_batch *fbatch, pgoff_t *indices) + struct folio_batch *fbatch) { int i, j; bool dax; @@ -82,7 +82,6 @@ static void truncate_folio_batch_exceptionals(struct address_space *mapping, for (i = j; i < folio_batch_count(fbatch); i++) { struct folio *folio = fbatch->folios[i]; - pgoff_t index = indices[i]; if (!xa_is_value(folio)) { fbatch->folios[j++] = folio; @@ -90,11 +89,11 @@ static void truncate_folio_batch_exceptionals(struct address_space *mapping, } if (unlikely(dax)) { - dax_delete_mapping_entry(mapping, index); + dax_delete_mapping_entry(mapping, folio->index); continue; } - __clear_shadow_entry(mapping, index, folio); + __clear_shadow_entry(mapping, folio->index, folio); } if (!dax) { @@ -363,7 +362,7 @@ void truncate_inode_pages_range(struct address_space *mapping, index = start; while (index < end && find_lock_entries(mapping, &index, end - 1, &fbatch, indices)) { - truncate_folio_batch_exceptionals(mapping, &fbatch, indices); + truncate_folio_batch_exceptionals(mapping, &fbatch); for (i = 0; i < folio_batch_count(&fbatch); i++) truncate_cleanup_folio(fbatch.folios[i]); delete_from_page_cache_batch(mapping, &fbatch); @@ -424,7 +423,7 @@ void truncate_inode_pages_range(struct address_space *mapping, truncate_inode_folio(mapping, folio); folio_unlock(folio); } - truncate_folio_batch_exceptionals(mapping, &fbatch, indices); + truncate_folio_batch_exceptionals(mapping, &fbatch); folio_batch_release(&fbatch); } } -- 2.36.1