Fix some outdated pre-kernfs doc references
Subsystems (2)
cover Fix some outdated pre-kernfs doc references
From: Ulf Magnusson <[email protected]>
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(-)
Signature · 1 line
2.1.4
PATCH 1/3 sysfs.txt: fix pre-kernfs sysfs_dirent reference
From: Ulf Magnusson <[email protected]>
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").
--- Documentation/filesystems/sysfs.txt | 2 +- Documentation/zh_CN/filesystems/sysfs.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Documentation/filesystems/sysfs.txt +1 -1
@@ -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
Documentation/zh_CN/filesystems/sysfs.txt +1 -1
@@ -61,7 +61,7 @@ Documentation/kobject.txt 文档以获得更多关于 kobject 接口的 内核的对象层次到用户空间。sysfs 中的顶层目录代表着内核对象层次的 共同祖先;例如:某些对象属于某个子系统。 -Sysfs 在与其目录关联的 sysfs_dirent 对象中内部保存一个指向实现 +Sysfs 在与其目录关联的 kernfs_node 对象中内部保存一个指向实现 目录的 kobject 的指针。以前,这个 kobject 指针被 sysfs 直接用于 kobject 文件打开和关闭的引用计数。而现在的 sysfs 实现中,kobject 引用计数只能通过 sysfs_schedule_callback() 函数直接修改。
Signature · 1 line
2.1.4
PATCH 2/3 sysfs-tagging.txt: fix pre-kernfs references
From: Ulf Magnusson <[email protected]>
- 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")
--- Documentation/filesystems/sysfs-tagging.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
Documentation/filesystems/sysfs-tagging.txt +7 -7
@@ -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.
Signature · 1 line
2.1.4
PATCH 3/3 configfs: fix pre-kernfs sysfs_dirent reference
From: Ulf Magnusson <[email protected]>
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.
--- fs/configfs/inode.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
fs/configfs/inode.c +6 -5
@@ -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;
Signature · 1 line
2.1.4
Jonathan Corbet
maintainerQuoted 9 lines · On Wed, 2 Sep 2015 14:34:51 +0200 [email protected] 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-kernfssysfs_direntreference 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.
Quoted 1 line
configfs: fix pre-kernfs
sysfs_direntreference
Not sure who handles configfs patches these days, but it's not me, so I've not done anything with this one.
Thanks,
jon