mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] Fix some outdated pre-kernfs doc references
@ 2015-09-02 12:34 ulfalizer.lkml
  2015-09-02 12:34 ` [PATCH 1/3] sysfs.txt: fix pre-kernfs sysfs_dirent reference ulfalizer.lkml
  2015-09-12 20:15 ` [PATCH 0/3] Fix some outdated pre-kernfs doc references Jonathan Corbet
  0 siblings, 2 replies; 5+ messages in thread
From: ulfalizer.lkml @ 2015-09-02 12:34 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-doc, corbet, harryxiyou, jlbec, ulfalizer, gregkh,
	shane.seymour, tj, bvanassche, serue

From: Ulf Magnusson <ulfalizer@gmail.com>

sysfs-tagging.txt contains more outdated references (e.g., to various
kobj_ns_*() functions that no longer exist), but hopefully it should be in
a better shape than before. I'm new to sysfs internals in general.

The configfs change is a guess that seemed reasonable.

Ulf Magnusson (3):
  sysfs.txt: fix pre-kernfs sysfs_dirent reference
  sysfs-tagging.txt: fix pre-kernfs references
  configfs: fix pre-kernfs sysfs_dirent reference

 Documentation/filesystems/sysfs-tagging.txt | 14 +++++++-------
 Documentation/filesystems/sysfs.txt         |  2 +-
 Documentation/zh_CN/filesystems/sysfs.txt   |  2 +-
 fs/configfs/inode.c                         | 11 ++++++-----
 4 files changed, 15 insertions(+), 14 deletions(-)

-- 
2.1.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] sysfs.txt: fix pre-kernfs sysfs_dirent reference
  2015-09-02 12:34 [PATCH 0/3] Fix some outdated pre-kernfs doc references ulfalizer.lkml
@ 2015-09-02 12:34 ` ulfalizer.lkml
  2015-09-02 12:34   ` [PATCH 2/3] sysfs-tagging.txt: fix pre-kernfs references ulfalizer.lkml
  2015-09-12 20:15 ` [PATCH 0/3] Fix some outdated pre-kernfs doc references Jonathan Corbet
  1 sibling, 1 reply; 5+ messages in thread
From: ulfalizer.lkml @ 2015-09-02 12:34 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-doc, corbet, harryxiyou, jlbec, ulfalizer, gregkh,
	shane.seymour, tj, bvanassche, serue

From: Ulf Magnusson <ulfalizer@gmail.com>

sysfs_dirent went away when kernfs was extracted from sysfs. The reference
to the kobject now lives in a kernfs_node (in the 'priv' member).

See commit 324a56e16e44 ("kernfs: s/sysfs_dirent/kernfs_node/ and rename
its friends accordingly").

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
---
 Documentation/filesystems/sysfs.txt       | 2 +-
 Documentation/zh_CN/filesystems/sysfs.txt | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/filesystems/sysfs.txt b/Documentation/filesystems/sysfs.txt
index 9494afb..78170ed 100644
--- a/Documentation/filesystems/sysfs.txt
+++ b/Documentation/filesystems/sysfs.txt
@@ -40,7 +40,7 @@ ancestors of object hierarchies; i.e. the subsystems the objects
 belong to. 
 
 Sysfs internally stores a pointer to the kobject that implements a
-directory in the sysfs_dirent object associated with the directory. In
+directory in the kernfs_node object associated with the directory. In
 the past this kobject pointer has been used by sysfs to do reference
 counting directly on the kobject whenever the file is opened or closed.
 With the current sysfs implementation the kobject reference count is
diff --git a/Documentation/zh_CN/filesystems/sysfs.txt b/Documentation/zh_CN/filesystems/sysfs.txt
index e230eaa..7d3b05e 100644
--- a/Documentation/zh_CN/filesystems/sysfs.txt
+++ b/Documentation/zh_CN/filesystems/sysfs.txt
@@ -61,7 +61,7 @@ Documentation/kobject.txt 文档以获得更多关于 kobject 接口的
 内核的对象层次到用户空间。sysfs 中的顶层目录代表着内核对象层次的
 共同祖先;例如:某些对象属于某个子系统。
 
-Sysfs 在与其目录关联的 sysfs_dirent 对象中内部保存一个指向实现
+Sysfs 在与其目录关联的 kernfs_node 对象中内部保存一个指向实现
 目录的 kobject 的指针。以前,这个 kobject 指针被 sysfs 直接用于
 kobject 文件打开和关闭的引用计数。而现在的 sysfs 实现中,kobject
 引用计数只能通过 sysfs_schedule_callback() 函数直接修改。
-- 
2.1.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/3] sysfs-tagging.txt: fix pre-kernfs references
  2015-09-02 12:34 ` [PATCH 1/3] sysfs.txt: fix pre-kernfs sysfs_dirent reference ulfalizer.lkml
@ 2015-09-02 12:34   ` ulfalizer.lkml
  2015-09-02 12:34     ` [PATCH 3/3] configfs: fix pre-kernfs sysfs_dirent reference ulfalizer.lkml
  0 siblings, 1 reply; 5+ messages in thread
From: ulfalizer.lkml @ 2015-09-02 12:34 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-doc, corbet, harryxiyou, jlbec, ulfalizer, gregkh,
	shane.seymour, tj, bvanassche, serue

From: Ulf Magnusson <ulfalizer@gmail.com>

 - sysfs_dirent is now kernfs_node - see commit 324a56e16e44 ("kernfs:
   s/sysfs_dirent/kernfs_node/ and rename its friends accordingly")

 - sysfs_super_info is now kernfs_super_info - see commit c525aaddc366
   ("kernfs: s/sysfs/kernfs/ in various data structures")

 - the 's_' prefix was dropped from various fields - see
   commit adc5e8b58f48 ("kernfs: drop s_ prefix from kernfs_node members")

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
---
 Documentation/filesystems/sysfs-tagging.txt | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/Documentation/filesystems/sysfs-tagging.txt b/Documentation/filesystems/sysfs-tagging.txt
index eb843e4..c7c8e64 100644
--- a/Documentation/filesystems/sysfs-tagging.txt
+++ b/Documentation/filesystems/sysfs-tagging.txt
@@ -17,13 +17,13 @@ the sysfs directory entries we ensure that we don't have conflicts
 in the directories and applications only see a limited set of
 the network devices.
 
-Each sysfs directory entry may be tagged with zero or one
-namespaces.  A sysfs_dirent is augmented with a void *s_ns.  If a
-directory entry is tagged, then sysfs_dirent->s_flags will have a
-flag between KOBJ_NS_TYPE_NONE and KOBJ_NS_TYPES, and s_ns will
-point to the namespace to which it belongs.
+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
+and KOBJ_NS_TYPES, and ns will point to the namespace to which it
+belongs.
 
-Each sysfs superblock's sysfs_super_info contains an array void
+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
@@ -31,7 +31,7 @@ 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
-sysfs_dirent->s_ns pointers pointing to it.
+kernfs_node->ns pointers pointing to it.
 
 Users of this interface:
 - define a type in the kobj_ns_type enumeration.
-- 
2.1.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 3/3] configfs: fix pre-kernfs sysfs_dirent reference
  2015-09-02 12:34   ` [PATCH 2/3] sysfs-tagging.txt: fix pre-kernfs references ulfalizer.lkml
@ 2015-09-02 12:34     ` ulfalizer.lkml
  0 siblings, 0 replies; 5+ messages in thread
From: ulfalizer.lkml @ 2015-09-02 12:34 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-doc, corbet, harryxiyou, jlbec, ulfalizer, gregkh,
	shane.seymour, tj, bvanassche, serue

From: Ulf Magnusson <ulfalizer@gmail.com>

sysfs_dirent was renamed in 324a56e16e44 ("kernfs:
s/sysfs_dirent/kernfs_node/ and rename its friends accordingly").

Do s/sysfs_dirent/configfs_dirent/ - possibly a copy-paste error to
begin with. Clean up the language a bit too.

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
---
 fs/configfs/inode.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c
index eae8757..e076661 100644
--- a/fs/configfs/inode.c
+++ b/fs/configfs/inode.c
@@ -133,13 +133,14 @@ struct inode *configfs_new_inode(umode_t mode, struct configfs_dirent *sd,
 		inode->i_mapping->a_ops = &configfs_aops;
 		inode->i_op = &configfs_inode_operations;
 
-		if (sd->s_iattr) {
-			/* sysfs_dirent has non-default attributes
-			 * get them for the new inode from persistent copy
-			 * in sysfs_dirent
+		if (sd->s_iattr)
+			/*
+			 * configfs_dirent has non-default attributes. Set them
+			 * on the new inode from the persistent copy in
+			 * configfs_dirent.
 			 */
 			set_inode_attr(inode, sd->s_iattr);
-		} else
+		else
 			set_default_inode_attr(inode, mode);
 	}
 	return inode;
-- 
2.1.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/3] Fix some outdated pre-kernfs doc references
  2015-09-02 12:34 [PATCH 0/3] Fix some outdated pre-kernfs doc references ulfalizer.lkml
  2015-09-02 12:34 ` [PATCH 1/3] sysfs.txt: fix pre-kernfs sysfs_dirent reference ulfalizer.lkml
@ 2015-09-12 20:15 ` Jonathan Corbet
  1 sibling, 0 replies; 5+ messages in thread
From: Jonathan Corbet @ 2015-09-12 20:15 UTC (permalink / raw)
  To: ulfalizer.lkml
  Cc: linux-kernel, linux-doc, harryxiyou, jlbec, ulfalizer, gregkh,
	shane.seymour, tj, bvanassche, serue

On Wed,  2 Sep 2015 14:34:51 +0200
ulfalizer.lkml@gmail.com wrote:

> sysfs-tagging.txt contains more outdated references (e.g., to various
> kobj_ns_*() functions that no longer exist), but hopefully it should be in
> a better shape than before. I'm new to sysfs internals in general.
> 
> The configfs change is a guess that seemed reasonable.
> 
> Ulf Magnusson (3):
>   sysfs.txt: fix pre-kernfs sysfs_dirent reference
>   sysfs-tagging.txt: fix pre-kernfs references

So, I sure would have rather seen a patch that actually documents kernfs
rather than just swapping a few names here and there, but so be it.  I've
applied these two to the docs tree, since they make things better than
they were before.

>   configfs: fix pre-kernfs sysfs_dirent reference

Not sure who handles configfs patches these days, but it's not me, so
I've not done anything with this one.

Thanks,

jon

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-09-12 20:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-02 12:34 [PATCH 0/3] Fix some outdated pre-kernfs doc references ulfalizer.lkml
2015-09-02 12:34 ` [PATCH 1/3] sysfs.txt: fix pre-kernfs sysfs_dirent reference ulfalizer.lkml
2015-09-02 12:34   ` [PATCH 2/3] sysfs-tagging.txt: fix pre-kernfs references ulfalizer.lkml
2015-09-02 12:34     ` [PATCH 3/3] configfs: fix pre-kernfs sysfs_dirent reference ulfalizer.lkml
2015-09-12 20:15 ` [PATCH 0/3] Fix some outdated pre-kernfs doc references Jonathan Corbet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®