Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp336910ybz; Tue, 21 Apr 2020 09:57:06 -0700 (PDT) X-Google-Smtp-Source: APiQypJJ7O1o+ldUkKFF4VKo5y3X3QbwpOJMna1ObeddmDU0pFdBCsg/fWSCTRzqC5qWqN0OtGFR X-Received: by 2002:a05:6402:319c:: with SMTP id di28mr10596132edb.185.1587488226368; Tue, 21 Apr 2020 09:57:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587488226; cv=none; d=google.com; s=arc-20160816; b=NESAlnwrsCB8bKaA1Flhu6PuEcmSh2PA7YXYDy02r0vrSTxkpw0QIT4tiGyuyqw5Zn 3NZfmI3NvRn0Z5DE2oF6hhrmm8nIgUD8UmZHvg8hsM8gAWIFe0yn3LSlApppdX3ufLw1 OuHiY13GXHfdsZnQNDVN/BZZfQpRLXqZwNSp7EJ0STVtitKSpYfnz63vYGmOPeSCtOfG gj8CDJwfADo8/jWnCrwhjo/H1ylArzVnUkRZ6RV9nzmHlfIZjuE+08LWxI44IweZZ1Yt sd+B5mZdeGyx3wdBhw3pXCluMIQbetBplBJjJJGlTnLG3Tw3GXWmxx/QGkb8pFU4xc8Z HweA== 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=6VrXu16HhAGpS2dVnepG3cBwuMQHwnYpxsz+BR7Gpuc=; b=aZukXyw/aJzhB/KA/tr6siz9ttD3nxmAkf3bAUF6o1u/nLbXmJZrblE5xTVFaZvM9K 2/iCBIrHHTIbaBO2upUwLallr8M3x6wUNVRSChuwSWvD9t1lZnC7WG402QM7lVlIU2N+ t2d94a2ngFb9rA5OcZWrTDs7DqAv8WhIvBGzZc2ekTNMHNPve2CoNZ2sQepf7FxkvdWn M+rSLNHrXyKxlqTnugKJh5ECVu4cCHOg39DmrXV18nTSjCp/OMcb19HxosbF9JvK/wwA 3TLpiU9aR5NJRgGVVPzMdRWGJ9RLN3ktbkEZqsoRecgaeVv7CSGYxa5UbzsN9VLhnISR VOog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bBffsWa8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y5si2257143edm.492.2020.04.21.09.56.42; Tue, 21 Apr 2020 09:57:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bBffsWa8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729320AbgDUQzS (ORCPT + 99 others); Tue, 21 Apr 2020 12:55:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:57360 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729166AbgDUQyt (ORCPT ); Tue, 21 Apr 2020 12:54:49 -0400 Received: from mail.kernel.org (ip5f5ad4d8.dynamic.kabel-deutschland.de [95.90.212.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B30CF21835; Tue, 21 Apr 2020 16:54:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587488084; bh=6P3d7tlTVXktXH1qYOmLWzh/BIfI7nP2c8dcG01RCxQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bBffsWa8xietF/t8IPBimM9kxpT/HAR6HMIY0d1hmZ8ghpQJxgos2nZQvg+606uf5 0YZU4FXgHlALBqIP/6cguCf+vx5iwZXjbdxnKGuimBQSJ2wE4uIi3Pfg4Lqn47M+XJ EP+6Nk6zg26y58BIKmVOns5LKHcKUSUnuI+WEj50= Received: from mchehab by mail.kernel.org with local (Exim 4.92.3) (envelope-from ) id 1jQwAU-00CmFU-Ux; Tue, 21 Apr 2020 18:54:42 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet Subject: [PATCH v2 27/29] docs: filesystems: convert sysfs-tagging.txt to ReST Date: Tue, 21 Apr 2020 18:54:38 +0200 Message-Id: <6f0686877612cdd66147c83a3ad339bdaee6d4f8.1587487612.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.25.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org - Add a SPDX header; - Adjust document title; - Some whitespace fixes and new line breaks; - Mark literal blocks as such; - Add it to filesystems/index.rst. Signed-off-by: Mauro Carvalho Chehab --- Documentation/filesystems/index.rst | 1 + .../{sysfs-tagging.txt => sysfs-tagging.rst} | 22 ++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) rename Documentation/filesystems/{sysfs-tagging.txt => sysfs-tagging.rst} (72%) diff --git a/Documentation/filesystems/index.rst b/Documentation/filesystems/index.rst index 65719684295e..11852bf3e758 100644 --- a/Documentation/filesystems/index.rst +++ b/Documentation/filesystems/index.rst @@ -35,6 +35,7 @@ algorithms work. seq_file sharedsubtree sysfs-pci + sysfs-tagging automount-support diff --git a/Documentation/filesystems/sysfs-tagging.txt b/Documentation/filesystems/sysfs-tagging.rst similarity index 72% rename from Documentation/filesystems/sysfs-tagging.txt rename to Documentation/filesystems/sysfs-tagging.rst index c7c8e6438958..8888a05c398e 100644 --- a/Documentation/filesystems/sysfs-tagging.txt +++ b/Documentation/filesystems/sysfs-tagging.rst @@ -1,5 +1,8 @@ +.. SPDX-License-Identifier: GPL-2.0 + +============= Sysfs tagging -------------- +============= (Taken almost verbatim from Eric Biederman's netns tagging patch commit msg) @@ -18,25 +21,28 @@ in the directories and applications only see a limited set of the network devices. Each sysfs directory entry may be tagged with a namespace via the -void *ns member of its kernfs_node. If a directory entry is tagged, -then kernfs_node->flags will have a flag between KOBJ_NS_TYPE_NONE +``void *ns member`` of its ``kernfs_node``. If a directory entry is tagged, +then ``kernfs_node->flags`` will have a flag between KOBJ_NS_TYPE_NONE and KOBJ_NS_TYPES, and ns will point to the namespace to which it belongs. -Each sysfs superblock's kernfs_super_info contains an array void -*ns[KOBJ_NS_TYPES]. When a task in a tagging namespace +Each sysfs superblock's kernfs_super_info contains an array +``void *ns[KOBJ_NS_TYPES]``. When a task in a tagging namespace kobj_nstype first mounts sysfs, a new superblock is created. It will be differentiated from other sysfs mounts by having its -s_fs_info->ns[kobj_nstype] set to the new namespace. Note that +``s_fs_info->ns[kobj_nstype]`` set to the new namespace. Note that through bind mounting and mounts propagation, a task can easily view the contents of other namespaces' sysfs mounts. Therefore, when a namespace exits, it will call kobj_ns_exit() to invalidate any kernfs_node->ns pointers pointing to it. Users of this interface: -- define a type in the kobj_ns_type enumeration. -- call kobj_ns_type_register() with its kobj_ns_type_operations which has + +- define a type in the ``kobj_ns_type`` enumeration. +- call kobj_ns_type_register() with its ``kobj_ns_type_operations`` which has + - current_ns() which returns current's namespace - netlink_ns() which returns a socket's namespace - initial_ns() which returns the initial namesapce + - call kobj_ns_exit() when an individual tag is no longer valid -- 2.25.2