Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp843497rdh; Thu, 23 Nov 2023 22:06:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IGGgcLBUMJgnDka4fY74RejIXGh7wXtNx3mINMg92ok+UyUQEMGQnA1fqRtmIP3dDmD8rpB X-Received: by 2002:a17:902:e54b:b0:1bb:598a:14e5 with SMTP id n11-20020a170902e54b00b001bb598a14e5mr2176124plf.43.1700805998918; Thu, 23 Nov 2023 22:06:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700805998; cv=none; d=google.com; s=arc-20160816; b=vf66atLHQPIKE/Xhn6kElD5aKEdlK52Ioo+nW/VBD8E/VYfwOhnzqAFTlrJQxV+pn9 twccswJwbafz/D5wpKVKqrirgBGtIs5wGgJV8MlHf1escyLLXwO8YCyuxjdgElebAiMz s9xDs/W3hMI8KvdfaX/dgV1ij0/3fgKgjaRzsR/aS/SKVfP8TxDhQz+d5W3LhEn0DElm jFu51HodT+bddSosKWiDPQnlN2pSSlKAw4FLN9H5hQy0t1ZK/lj5YZwYrOx4EdJJc42b w2xdyX26YUztCBPhv7kTu1Ox3hkJjsJbAKcrOGA74CxfO0iQXcZawVhQY8+VdPTqNbAw 0hfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DSWH6ypd/JmZdBaXpi9Usyj9hcz5TwIIngwOFUz72p0=; fh=vDsv/0Rb6aybIi/Xas2DR+uQpFXMLtn4no3J1t38V0s=; b=oai6Es6mZ8LrWBn3pB5qzcOolttCnMZk38ZvqCHvJntq9Ds+WW3OLIV8qrpqPGTwXv sPJFa7t7y3KakNllUvhtHq8MIJ183YX/YSD3qQZYTgj3OLpGgRUxe81+e91OOaIB9OED bijSinqolWcE5iA9cUfqIe58OhzdxTpIdvAxKkpiK/YpCkR4M2DpRn15CMA3idpOp58J bpLtedfpzAJrq0i+BQHRTZjLzqNHPz20aF5b898V9fIUu8rfyX3KiyaTflMq0A+XZd9Q 195905YarNHurA0XbHxDmO2K9dGpw9LAGmSqOoHwbzFYc0i8Nb+BMF3HBnXU3jHbJNmI genQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=wYsIeqWc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id jw10-20020a170903278a00b001cf5cb5ac88si2574753plb.486.2023.11.23.22.06.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 22:06:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=wYsIeqWc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 4FD4780AC597; Thu, 23 Nov 2023 22:06:11 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344820AbjKXGFn (ORCPT + 99 others); Fri, 24 Nov 2023 01:05:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231494AbjKXGEV (ORCPT ); Fri, 24 Nov 2023 01:04:21 -0500 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D84A0D71; Thu, 23 Nov 2023 22:04:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=DSWH6ypd/JmZdBaXpi9Usyj9hcz5TwIIngwOFUz72p0=; b=wYsIeqWcIUAkisRbAQQlxrGg9H wT3mQx86KdlVBqT3CGV62ZKmSv/1hbtfusFE9jTKNQS2pv30R40rxjtOSpYgjIdQx4JHlzSNLYBGB tIJ2h/0YVaUStN/PgXYuf8B8L1xDeNuzFG8GPQVOlFpy7du8fwvuJ6Rglp7Dp2GNOQ70PQOUYOVaf UnDfHG1jBS7uq2MQJwQfV58ozzPnYMQdT7xMq7xooQ/kbA3/66LeoS2fW+wS7TFpdXwQ/nKThawU4 prA5QQC3IiLS7AkwTVUzJdBVNtlFI2koKhLJbH3aQBJv5ghsPV12InRel94v0ewAo16ZBAGi2wLo4 nfLekm3A==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1r6PIg-002Pv9-1S; Fri, 24 Nov 2023 06:04:26 +0000 From: Al Viro To: linux-fsdevel@vger.kernel.org Cc: Linus Torvalds , Christian Brauner , linux-kernel@vger.kernel.org Subject: [PATCH v3 18/21] switch select_collect{,2}() to use of to_shrink_list() Date: Fri, 24 Nov 2023 06:04:19 +0000 Message-Id: <20231124060422.576198-18-viro@zeniv.linux.org.uk> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231124060422.576198-1-viro@zeniv.linux.org.uk> References: <20231124060200.GR38156@ZenIV> <20231124060422.576198-1-viro@zeniv.linux.org.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Al Viro X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Thu, 23 Nov 2023 22:06:11 -0800 (PST) Reviewed-by: Christian Brauner Signed-off-by: Al Viro --- fs/dcache.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/fs/dcache.c b/fs/dcache.c index 704676bf06fd..f68fe7c863e0 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -1495,13 +1495,9 @@ static enum d_walk_ret select_collect(void *_data, struct dentry *dentry) if (dentry->d_flags & DCACHE_SHRINK_LIST) { data->found++; - } else { - if (dentry->d_flags & DCACHE_LRU_LIST) - d_lru_del(dentry); - if (!dentry->d_lockref.count) { - d_shrink_add(dentry, &data->dispose); - data->found++; - } + } else if (!dentry->d_lockref.count) { + to_shrink_list(dentry, &data->dispose); + data->found++; } /* * We can return to the caller if we have found some (this @@ -1522,17 +1518,13 @@ static enum d_walk_ret select_collect2(void *_data, struct dentry *dentry) if (data->start == dentry) goto out; - if (dentry->d_flags & DCACHE_SHRINK_LIST) { - if (!dentry->d_lockref.count) { + if (!dentry->d_lockref.count) { + if (dentry->d_flags & DCACHE_SHRINK_LIST) { rcu_read_lock(); data->victim = dentry; return D_WALK_QUIT; } - } else { - if (dentry->d_flags & DCACHE_LRU_LIST) - d_lru_del(dentry); - if (!dentry->d_lockref.count) - d_shrink_add(dentry, &data->dispose); + to_shrink_list(dentry, &data->dispose); } /* * We can return to the caller if we have found some (this -- 2.39.2