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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BDE47C433F5 for ; Wed, 8 Dec 2021 09:30:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=p8UuQAoDYndaP11dVyVwUIU5W34ZzxsnHxb4z4/MBLI=; b=iRErw1qLDCBg/F aax62r0WOxFU5L2T+mZB7TwhhCVNewWHq83cdRAnXSfx7YQJSYAnzBFDtljtNja4wiStGcDspjkpr pr8NMMitK6l3f6Aj5ZP7RuXugzfQ5tWq+PkiTSlcBXk//sb9RHVlEwKUXPbqLgfbMJoXOvEchaXk6 5zfwXInyIQLjT7kAFuJyggVESsUNmgZcd60ZoJeaDhPBgINl+z+cRylIRnu1K2g7nKSUfQUZPdUuf Am4GCCBm6G7N6ImUjuMo7/Jbz2mlyUh5gqnFrGTTPf78gyrgMuUE+Fx/tTIxeWScLTprtNPQQxZ25 EolHRZ4qwvGwZMw+T8Qg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mutFn-00Bu7A-Uy; Wed, 08 Dec 2021 09:28:48 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mutFi-00Bu4g-Ps for linux-arm-kernel@lists.infradead.org; Wed, 08 Dec 2021 09:28:44 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 815E8CE2073; Wed, 8 Dec 2021 09:28:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9BCAC00446; Wed, 8 Dec 2021 09:28:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1638955718; bh=wPLoCgEiGSFzZaa084ljFEQkOegpE0+U9VnbZ8HMw0M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LuJrgbpgPLbIgIWCE1a0PvHDcB/xlrNqQOi0zfmZSruQTKn8m5BXD25ByikS3TIaB 3+j9MAoUf+fnf5zEEr9uMKC/SU62f9LoHn2SYDsSyAB6v3tjzkhfloxQ6Wmsfnq8V4 E8ITvnTd4C3kxB5vWMgp/ZC7NRY5xAipewdGpvXzz6s1SnWrDJBRFpskcrTrgJxuDH zarM0/6a6tbwy8d/lucdqyCMd7Bg0LVdf2nLeHrAHyE+1MIjFDRh77X3FkSvwMs8uR RQn9rgWA7O2Y+gc3sDB0NSFJwLVQI8fg3AY4dw/wQH3ILO7Pal8OhvLpbFCgpM+73e eXbfSGAAFbaww== Date: Wed, 8 Dec 2021 11:28:34 +0200 From: Leon Romanovsky To: Leo Yan Cc: "David S. Miller" , Jakub Kicinski , Mathieu Poirier , Suzuki K Poulose , Mike Leach , Alexander Shishkin , Jan Harkes , coda@cs.cmu.edu, Paul Moore , Eric Paris , Balbir Singh , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, codalist@coda.cs.cmu.edu, linux-audit@redhat.com Subject: Re: [PATCH v2 1/7] pid: Introduce helper task_is_in_init_pid_ns() Message-ID: References: <20211208083320.472503-1-leo.yan@linaro.org> <20211208083320.472503-2-leo.yan@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211208083320.472503-2-leo.yan@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211208_012843_058220_8B7039F8 X-CRM114-Status: GOOD ( 14.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Dec 08, 2021 at 04:33:14PM +0800, Leo Yan wrote: > Currently the kernel uses open code in multiple places to check if a > task is in the root PID namespace with the kind of format: > > if (task_active_pid_ns(current) == &init_pid_ns) > do_something(); > > This patch creates a new helper function, task_is_in_init_pid_ns(), it > returns true if a passed task is in the root PID namespace, otherwise > returns false. So it will be used to replace open codes. > > Suggested-by: Suzuki K Poulose > Signed-off-by: Leo Yan > --- > include/linux/pid_namespace.h | 5 +++++ > 1 file changed, 5 insertions(+) > Thanks, Reviewed-by: Leon Romanovsky _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel