Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6868431rwr; Tue, 2 May 2023 06:40:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5+8uaslDLKq6wKLgE+NKFAiDpIV2o+JNOi1I7O64LT3Bz2thtBdnNaBCOgXDGz9ZRmhYF6 X-Received: by 2002:a17:903:11cf:b0:1a9:95fa:1fa8 with SMTP id q15-20020a17090311cf00b001a995fa1fa8mr21247012plh.41.1683034830927; Tue, 02 May 2023 06:40:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683034830; cv=none; d=google.com; s=arc-20160816; b=bjWHLdykhZENHSOfruzb+Yalvrxzrv6SMLm8uUZ0MheH9LytsOfVVtdtnO+qQ4a74s uHAlmkgBWWdVFM3P4gYQjyVemTqzTL/ACjj8YvzCYNa4a4fuSZRu1mHuwEIzZ6K34N4r NGEopBbFIMyrh3Ni0jkzCzpj4Ar57gbBEYNcpxoe1QMoohVz1osbdKV2rvJMEviKqh8S 2eAHBzjlEZ0XVXHWnBfUtz8h4GWRj9NJ5FzYrSkXVxy0mnHJxuA1iCRDplX8oEGGOURH 0SYk0ftN5Xxh36J1bMAnawmcPNCad6tUEYCgSfdNBaLpy9CjHZIQC12Dhw5Xj0JDLDV6 k84g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=HAg4rxVkAQ9qbbHiRpMQeKxQl0QBkdUCjNX5t2zLxPg=; b=1FGo+ldSf2GK7ftdfYuknRIxfG43vb1x4DNsvAFSEFS75KQqck9ZUgowXezRydLgsm qt7N6qXkH5zmef8+YiwYbXQmzf8lUvx7VpDZKW/2RzoAgYp0EbiuefrE/tX+lYmQ2/Ao aCvFN6Lj2IpCEnR2E7yRfoEK37LeLvfgvYf7EKyphkrptmgQCqKgQOs+t7ER1OixLRba 6voinqcES5CZhksmvOpkUPuym5mewZHxa5IS8uCsDDj50IwUNdCVRL9yueiOykmae3f5 RajoWMpcdBWoBbEiEl8l0yjL0g6i8URNRFrBuMFqpQyvekUjNKembrWhp06ZpptmSBs7 m3Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=ucryHQBD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w1-20020a170902e88100b001a971d32b41si23279809plg.267.2023.05.02.06.40.16; Tue, 02 May 2023 06:40:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=ucryHQBD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234253AbjEBNju (ORCPT + 99 others); Tue, 2 May 2023 09:39:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234101AbjEBNja (ORCPT ); Tue, 2 May 2023 09:39:30 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F30C6E87; Tue, 2 May 2023 06:38:56 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id D19311FD63; Tue, 2 May 2023 13:38:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1683034729; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HAg4rxVkAQ9qbbHiRpMQeKxQl0QBkdUCjNX5t2zLxPg=; b=ucryHQBDna3EZnuiMh3G9y4iAHPKeJYgG5vW3YRNWNx+RmQanqEifFfVPpU4RuNZvgpLzK dMzvFoUWdePAEGbT1Akvg+MJoZuf3pHOAN0HwewEt2EjQLKqfdq4pEq4k4CABGqPdn/hh6 72u9XPh9PqGjmr7yHuob9GzfKzp2ql8= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A245C139D2; Tue, 2 May 2023 13:38:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 2MHVJmkSUWTOYQAAMHmgww (envelope-from ); Tue, 02 May 2023 13:38:49 +0000 From: =?UTF-8?q?Michal=20Koutn=C3=BD?= To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org Cc: Alexander Viro , Christian Brauner , Tejun Heo , Zefan Li , Johannes Weiner , Dave Chinner , Rik van Riel , Jiri Wiesner Subject: [RFC PATCH 1/3] cgroup: Drop unused function for cgroup_path Date: Tue, 2 May 2023 15:38:45 +0200 Message-Id: <20230502133847.14570-2-mkoutny@suse.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230502133847.14570-1-mkoutny@suse.com> References: <20230502133847.14570-1-mkoutny@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is no current user and there are alternative methods to obtain task's cgroup path. Signed-off-by: Michal Koutný --- kernel/cgroup/cgroup.c | 39 --------------------------------------- 1 file changed, 39 deletions(-) diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index 625d7483951c..55e5f0110e3b 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -2378,45 +2378,6 @@ int cgroup_path_ns(struct cgroup *cgrp, char *buf, size_t buflen, } EXPORT_SYMBOL_GPL(cgroup_path_ns); -/** - * task_cgroup_path - cgroup path of a task in the first cgroup hierarchy - * @task: target task - * @buf: the buffer to write the path into - * @buflen: the length of the buffer - * - * Determine @task's cgroup on the first (the one with the lowest non-zero - * hierarchy_id) cgroup hierarchy and copy its path into @buf. This - * function grabs cgroup_mutex and shouldn't be used inside locks used by - * cgroup controller callbacks. - * - * Return value is the same as kernfs_path(). - */ -int task_cgroup_path(struct task_struct *task, char *buf, size_t buflen) -{ - struct cgroup_root *root; - struct cgroup *cgrp; - int hierarchy_id = 1; - int ret; - - cgroup_lock(); - spin_lock_irq(&css_set_lock); - - root = idr_get_next(&cgroup_hierarchy_idr, &hierarchy_id); - - if (root) { - cgrp = task_cgroup_from_root(task, root); - ret = cgroup_path_ns_locked(cgrp, buf, buflen, &init_cgroup_ns); - } else { - /* if no hierarchy exists, everyone is in "/" */ - ret = strscpy(buf, "/", buflen); - } - - spin_unlock_irq(&css_set_lock); - cgroup_unlock(); - return ret; -} -EXPORT_SYMBOL_GPL(task_cgroup_path); - /** * cgroup_attach_lock - Lock for ->attach() * @lock_threadgroup: whether to down_write cgroup_threadgroup_rwsem -- 2.40.1