linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHSET driver-core-next] sysfs: separate out kernfs, take #3
@ 2013-11-23 22:21 Tejun Heo
  2013-11-23 22:21 ` [PATCH 01/41] sysfs: drop kobj_ns_type handling, take #2 Tejun Heo
                   ` (42 more replies)
  0 siblings, 43 replies; 92+ messages in thread
From: Tejun Heo @ 2013-11-23 22:21 UTC (permalink / raw)
  To: gregkh; +Cc: kay, linux-kernel, ebiederm, bhelgaas

Hey,

This is the third take of the patchset to separate out kernfs from
sysfs.

Changes between the second[S] and third take are

* cb26a311578e ("sysfs: drop kobj_ns_type handling") had a bug in
  symlink handling incorrectly enabling tag filtering in a directory
  which contains a symlink pointing to a tagged directory and got
  reverted.  0001-sysfs-drop-kobj_ns_type-handling-take-2.patch added
  to try it again.

* 0001 adds SYSFS_NS_FLAG and testing code in sysfs.
  0040-sysfs-kernfs-implement-kernfs_ns_enabled.patch added to
  encapsulate the flag access.

Changes between the first[F] and second[S] take are

* Patches applied to driver-core-next are dropped and the rest are
  refreshed.

* Mount portion of kernfs implemented.  kernfs now supports multiple
  sysfs_dirent hierarchies and sysfs is just one of them.

* Dummy interface for kernfs for !CONFIG_SYSFS updated to return
  -ENOSYS / ERR_PTR(-ENOSYS) where applicable.

* Several bug fixes.

This patchset contains 41 patches to separate out core sysfs features
into kernfs.  kernfs exclusively deals with sysfs_dirent, which will
be later renamed to kernfs_node, and kernfs_ops.  sysfs becomes a
wrapping layer over sysfs which interfaces kobject and
[bin_]attribute.

The goal of these changes is to allow other users to make use of the
core features of sysfs instead of rolling their own pseudo filesystem
implementation which usually fails to deal with issues with file
shutdowns, locking separation from vfs layer and so on.  This patchset
refactors sysfs and separates out core functionalities to kernfs.
After the patchset, kernfs is fully functional - multiple sysfs_dirent
hierarchies can be created and mounted and sysfs is just one user of
kernfs.

This patchset shouldn't introduce any behavior differences and
contains the following patches.

 0001-sysfs-drop-kobj_ns_type-handling-take-2.patch
 0002-sysfs-make-__sysfs_add_one-fail-if-the-parent-isn-t-.patch
 0003-sysfs-kernfs-add-skeletons-for-kernfs.patch
 0004-sysfs-kernfs-introduce-kernfs_remove-_by_name-_ns.patch
 0005-sysfs-kernfs-introduce-kernfs_create_link.patch
 0006-sysfs-kernfs-introduce-kernfs_rename-_ns.patch
 0007-sysfs-kernfs-introduce-kernfs_setattr.patch
 0008-sysfs-kernfs-replace-sysfs_dirent-s_dir.kobj-and-s_a.patch
 0009-sysfs-kernfs-introduce-kernfs_create_dir-_ns.patch
 0010-sysfs-kernfs-prepare-read-path-for-kernfs.patch
 0011-sysfs-kernfs-prepare-write-path-for-kernfs.patch
 0012-sysfs-kernfs-prepare-mmap-path-for-kernfs.patch
 0013-sysfs-kernfs-prepare-open-release-poll-paths-for-ker.patch
 0014-sysfs-kernfs-move-sysfs_open_file-to-include-linux-k.patch
 0015-sysfs-kernfs-introduce-kernfs_ops.patch
 0016-sysfs-kernfs-add-sysfs_dirent-s_attr.size.patch
 0017-sysfs-kernfs-remove-SYSFS_KOBJ_BIN_ATTR.patch
 0018-sysfs-kernfs-introduce-kernfs_create_file-_ns.patch
 0019-sysfs-kernfs-remove-sysfs_add_one.patch
 0020-sysfs-kernfs-add-kernfs_ops-seq_-start-next-stop.patch
 0021-sysfs-kernfs-introduce-kernfs_notify.patch
 0022-sysfs-kernfs-reorganize-SYSFS_-constants.patch
 0023-sysfs-kernfs-revamp-sysfs_dirent-active_ref-lockdep-.patch
 0024-sysfs-kernfs-introduce-kernfs-_find_and-_get-and-ker.patch
 0025-sysfs-kernfs-move-internal-decls-to-fs-kernfs-kernfs.patch
 0026-sysfs-kernfs-move-inode-code-to-fs-kernfs-inode.c.patch
 0027-sysfs-kernfs-move-dir-core-code-to-fs-kernfs-dir.c.patch
 0028-sysfs-kernfs-move-file-core-code-to-fs-kernfs-file.c.patch
 0029-sysfs-kernfs-move-symlink-core-code-to-fs-kernfs-sym.patch
 0030-sysfs-kernfs-drop-unused-params-from-sysfs_fill_supe.patch
 0031-sysfs-kernfs-make-sysfs_super_info-ns-const.patch
 0032-sysfs-kernfs-no-need-to-kern_mount-sysfs-from-sysfs_.patch
 0033-sysfs-kernfs-introduce-sysfs_root_sd.patch
 0034-sysfs-kernfs-implement-kernfs_create-destroy_root.patch
 0035-sysfs-kernfs-make-inode-number-ida-per-kernfs_root.patch
 0036-sysfs-kernfs-make-super_blocks-bind-to-different-ker.patch
 0037-sysfs-kernfs-prepare-mount-path-for-kernfs.patch
 0038-sysfs-kernfs-move-mount-core-code-to-fs-kernfs-mount.patch
 0039-sysfs-kernfs-make-sysfs_dirent-definition-public.patch
 0040-sysfs-kernfs-implement-kernfs_ns_enabled.patch
 0041-sysfs-kernfs-remove-cross-inclusions-of-internal-hea.patch

 0001 retries removing kobj_ns_type handling.

 0002 is prep patch.

 0003 preps fs/kernfs/ directory with skeleton files.

 0004-0024 refactor various code paths so that all externally visible
 interfaces are split to core kernfs interface which deals with
 sysfs_dirent and kernfs_ops and sysfs wrapping it to provide the
 existing interface.

 0025-0029 move kernfs part of the implementation under fs/kernfs.

 0030-0036 update mount logic so that it can support multiple
 sysfs_dirent hierarchies instead of assuming single sysfs hierarchy.

 0037-0038 refactor mount code path for kernfs and moves kernfs
 interface and implementation to fs/kernfs.

 0039-0041 cut the remaining entanglement between sysfs and kernfs and
 make the former proper user of the latter.

Multiple hierarchy support tested with the attached module (needs
adding EXPORT_SYMBOL to kernfs interface).  Works as expected.

This patchset is on top of

  v3.13-rc1 6ce4eac1f600 ("Linux 3.13-rc1")
+ [1] sysfs: handle duplicate removal attempts in sysfs_remove_group()
+ [2] sysfs: use a separate locking class for open files depending on mmap

The patches are also available in the following git branch.

 git://git.kernel.org/pub/scm/linux/kernel/git/tj/misc.git review-separate-out-kernfs

diffstat follows.  Thanks.

 fs/Makefile                 |    2 
 fs/kernfs/Makefile          |    5 
 fs/kernfs/dir.c             | 1014 +++++++++++++++++++++++++++++++++++++++++++
 fs/kernfs/file.c            |  814 ++++++++++++++++++++++++++++++++++
 fs/kernfs/inode.c           |  337 ++++++++++++++
 fs/kernfs/kernfs-internal.h |  115 ++++
 fs/kernfs/mount.c           |  165 +++++++
 fs/kernfs/symlink.c         |  149 ++++++
 fs/namespace.c              |    2 
 fs/sysfs/Makefile           |    2 
 fs/sysfs/dir.c              | 1030 --------------------------------------------
 fs/sysfs/file.c             |  931 +++++++--------------------------------
 fs/sysfs/group.c            |   59 +-
 fs/sysfs/inode.c            |  331 --------------
 fs/sysfs/mount.c            |  182 -------
 fs/sysfs/symlink.c          |  179 -------
 fs/sysfs/sysfs.h            |  228 ---------
 include/linux/kernfs.h      |  348 ++++++++++++++
 include/linux/sysfs.h       |   43 -
 lib/kobject.c               |   27 -
 20 files changed, 3252 insertions(+), 2711 deletions(-)

--
tejun

[F] https://lkml.kernel.org/g/1382629780-10006-1-git-send-email-tj@kernel.org
[S] https://lkml.kernel.org/g/1383472398-17812-1-git-send-email-tj@kernel.org
[1] https://lkml.kernel.org/g/20131123183508.GA28162@mtj.dyndns.org
[2] https://lkml.kernel.org/g/20131123183540.GB28162@mtj.dyndns.org

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

end of thread, other threads:[~2013-11-30 13:05 UTC | newest]

Thread overview: 92+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-23 22:21 [PATCHSET driver-core-next] sysfs: separate out kernfs, take #3 Tejun Heo
2013-11-23 22:21 ` [PATCH 01/41] sysfs: drop kobj_ns_type handling, take #2 Tejun Heo
2013-11-23 23:05   ` [PATCH v2 " Tejun Heo
2013-11-23 22:21 ` [PATCH 02/41] sysfs: make __sysfs_add_one() fail if the parent isn't a directory Tejun Heo
2013-11-23 22:21 ` [PATCH 03/41] sysfs, kernfs: add skeletons for kernfs Tejun Heo
2013-11-24 14:54   ` [PATCH REPOST " Tejun Heo
2013-11-23 22:21 ` [PATCH 04/41] sysfs, kernfs: introduce kernfs_remove[_by_name[_ns]]() Tejun Heo
2013-11-23 22:21 ` [PATCH 05/41] sysfs, kernfs: introduce kernfs_create_link() Tejun Heo
2013-11-23 22:21 ` [PATCH 06/41] sysfs, kernfs: introduce kernfs_rename[_ns]() Tejun Heo
2013-11-23 22:21 ` [PATCH 07/41] sysfs, kernfs: introduce kernfs_setattr() Tejun Heo
2013-11-23 22:21 ` [PATCH 08/41] sysfs, kernfs: replace sysfs_dirent->s_dir.kobj and ->s_attr.[bin_]attr with ->priv Tejun Heo
2013-11-23 22:21 ` [PATCH 09/41] sysfs, kernfs: introduce kernfs_create_dir[_ns]() Tejun Heo
2013-11-23 23:07   ` [PATCH v4 " Tejun Heo
2013-11-28  6:05     ` Greg KH
2013-11-28 19:54       ` [PATCHSET PARTIAL REPOST driver-core-next] sysfs: separate out kernfs, take #3 Tejun Heo
2013-11-28 19:54         ` [PATCH 01/34] sysfs, kernfs: replace sysfs_dirent->s_dir.kobj and ->s_attr.[bin_]attr with ->priv Tejun Heo
2013-11-28 19:54         ` [PATCH 02/34] sysfs, kernfs: introduce kernfs_create_dir[_ns]() Tejun Heo
2013-11-28 19:54         ` [PATCH 03/34] sysfs, kernfs: prepare read path for kernfs Tejun Heo
2013-11-28 19:54         ` [PATCH 04/34] sysfs, kernfs: prepare write " Tejun Heo
2013-11-28 19:54         ` [PATCH 05/34] sysfs, kernfs: prepare mmap " Tejun Heo
2013-11-28 19:54         ` [PATCH 06/34] sysfs, kernfs: prepare open, release, poll paths " Tejun Heo
2013-11-28 19:54         ` [PATCH 07/34] sysfs, kernfs: move sysfs_open_file to include/linux/kernfs.h Tejun Heo
2013-11-28 19:54         ` [PATCH 08/34] sysfs, kernfs: introduce kernfs_ops Tejun Heo
2013-11-28 19:54         ` [PATCH 09/34] sysfs, kernfs: add sysfs_dirent->s_attr.size Tejun Heo
2013-11-28 19:54         ` [PATCH 10/34] sysfs, kernfs: remove SYSFS_KOBJ_BIN_ATTR Tejun Heo
2013-11-28 19:54         ` [PATCH 11/34] sysfs, kernfs: introduce kernfs_create_file[_ns]() Tejun Heo
2013-11-28 19:54         ` [PATCH 12/34] sysfs, kernfs: remove sysfs_add_one() Tejun Heo
2013-11-28 19:54         ` [PATCH 13/34] sysfs, kernfs: add kernfs_ops->seq_{start|next|stop}() Tejun Heo
2013-11-28 19:54         ` [PATCH 14/34] sysfs, kernfs: introduce kernfs_notify() Tejun Heo
2013-11-28 19:54         ` [PATCH 15/34] sysfs, kernfs: reorganize SYSFS_* constants Tejun Heo
2013-11-28 19:54         ` [PATCH 16/34] sysfs, kernfs: revamp sysfs_dirent active_ref lockdep annotation Tejun Heo
2013-11-28 19:54         ` [PATCH 17/34] sysfs, kernfs: introduce kernfs[_find_and]_get() and kernfs_put() Tejun Heo
2013-11-28 19:54         ` [PATCH 18/34] sysfs, kernfs: move internal decls to fs/kernfs/kernfs-internal.h Tejun Heo
2013-11-28 19:54         ` [PATCH 19/34] sysfs, kernfs: move inode code to fs/kernfs/inode.c Tejun Heo
2013-11-28 19:54         ` [PATCH 20/34] sysfs, kernfs: move dir core code to fs/kernfs/dir.c Tejun Heo
2013-11-28 19:54         ` [PATCH 21/34] sysfs, kernfs: move file core code to fs/kernfs/file.c Tejun Heo
2013-11-28 19:54         ` [PATCH 22/34] sysfs, kernfs: move symlink core code to fs/kernfs/symlink.c Tejun Heo
2013-11-28 19:54         ` [PATCH 23/34] sysfs, kernfs: drop unused params from sysfs_fill_super() Tejun Heo
2013-11-28 19:54         ` [PATCH 24/34] sysfs, kernfs: make sysfs_super_info->ns const Tejun Heo
2013-11-28 19:54         ` [PATCH 25/34] sysfs, kernfs: no need to kern_mount() sysfs from sysfs_init() Tejun Heo
2013-11-28 19:54         ` [PATCH 26/34] sysfs, kernfs: introduce sysfs_root_sd Tejun Heo
2013-11-28 19:54         ` [PATCH 27/34] sysfs, kernfs: implement kernfs_create/destroy_root() Tejun Heo
2013-11-28 19:54         ` [PATCH 28/34] sysfs, kernfs: make inode number ida per kernfs_root Tejun Heo
2013-11-28 19:54         ` [PATCH 29/34] sysfs, kernfs: make super_blocks bind to different kernfs_roots Tejun Heo
2013-11-28 19:54         ` [PATCH 30/34] sysfs, kernfs: prepare mount path for kernfs Tejun Heo
2013-11-28 19:54         ` [PATCH 31/34] sysfs, kernfs: move mount core code to fs/kernfs/mount.c Tejun Heo
2013-11-28 19:54         ` [PATCH 32/34] sysfs, kernfs: make sysfs_dirent definition public Tejun Heo
2013-11-29 22:18           ` Tejun Heo
2013-11-29 22:19             ` Tejun Heo
2013-11-28 19:54         ` [PATCH 33/34] sysfs, kernfs: implement kernfs_ns_enabled() Tejun Heo
2013-11-29 22:19           ` [PATCH v2 " Tejun Heo
2013-11-28 19:54         ` [PATCH 34/34] sysfs, kernfs: remove cross inclusions of internal headers Tejun Heo
2013-11-29 22:21         ` [PATCHSET PARTIAL REPOST driver-core-next] sysfs: separate out kernfs, take #3 Tejun Heo
2013-11-30  2:55           ` Greg KH
2013-11-30 13:05             ` Tejun Heo
2013-11-23 22:21 ` [PATCH 10/41] sysfs, kernfs: prepare read path for kernfs Tejun Heo
2013-11-23 22:21 ` [PATCH 11/41] sysfs, kernfs: prepare write " Tejun Heo
2013-11-23 22:21 ` [PATCH 12/41] sysfs, kernfs: prepare mmap " Tejun Heo
2013-11-23 22:21 ` [PATCH 13/41] sysfs, kernfs: prepare open, release, poll paths " Tejun Heo
2013-11-23 22:21 ` [PATCH 14/41] sysfs, kernfs: move sysfs_open_file to include/linux/kernfs.h Tejun Heo
2013-11-23 22:22 ` [PATCH 15/41] sysfs, kernfs: introduce kernfs_ops Tejun Heo
2013-11-23 22:22 ` [PATCH 16/41] sysfs, kernfs: add sysfs_dirent->s_attr.size Tejun Heo
2013-11-23 22:22 ` [PATCH 17/41] sysfs, kernfs: remove SYSFS_KOBJ_BIN_ATTR Tejun Heo
2013-11-23 22:22 ` [PATCH 18/41] sysfs, kernfs: introduce kernfs_create_file[_ns]() Tejun Heo
2013-11-23 22:22 ` [PATCH 19/41] sysfs, kernfs: remove sysfs_add_one() Tejun Heo
2013-11-23 22:22 ` [PATCH 20/41] sysfs, kernfs: add kernfs_ops->seq_{start|next|stop}() Tejun Heo
2013-11-23 22:22 ` [PATCH 21/41] sysfs, kernfs: introduce kernfs_notify() Tejun Heo
2013-11-23 22:22 ` [PATCH 22/41] sysfs, kernfs: reorganize SYSFS_* constants Tejun Heo
2013-11-23 22:22 ` [PATCH 23/41] sysfs, kernfs: revamp sysfs_dirent active_ref lockdep annotation Tejun Heo
2013-11-23 22:22 ` [PATCH 24/41] sysfs, kernfs: introduce kernfs[_find_and]_get() and kernfs_put() Tejun Heo
2013-11-23 22:22 ` [PATCH 25/41] sysfs, kernfs: move internal decls to fs/kernfs/kernfs-internal.h Tejun Heo
2013-11-23 22:22 ` [PATCH 26/41] sysfs, kernfs: move inode code to fs/kernfs/inode.c Tejun Heo
2013-11-23 22:22 ` [PATCH 27/41] sysfs, kernfs: move dir core code to fs/kernfs/dir.c Tejun Heo
2013-11-23 22:22 ` [PATCH 28/41] sysfs, kernfs: move file core code to fs/kernfs/file.c Tejun Heo
2013-11-23 22:22 ` [PATCH 29/41] sysfs, kernfs: move symlink core code to fs/kernfs/symlink.c Tejun Heo
2013-11-23 22:22 ` [PATCH 30/41] sysfs, kernfs: drop unused params from sysfs_fill_super() Tejun Heo
2013-11-23 22:22 ` [PATCH 31/41] sysfs, kernfs: make sysfs_super_info->ns const Tejun Heo
2013-11-23 22:22 ` [PATCH 32/41] sysfs, kernfs: no need to kern_mount() sysfs from sysfs_init() Tejun Heo
2013-11-23 22:22 ` [PATCH 33/41] sysfs, kernfs: introduce sysfs_root_sd Tejun Heo
2013-11-23 22:22 ` [PATCH 34/41] sysfs, kernfs: implement kernfs_create/destroy_root() Tejun Heo
2013-11-23 22:22 ` [PATCH 35/41] sysfs, kernfs: make inode number ida per kernfs_root Tejun Heo
2013-11-23 22:22 ` [PATCH 36/41] sysfs, kernfs: make super_blocks bind to different kernfs_roots Tejun Heo
2013-11-23 22:22 ` [PATCH 37/41] sysfs, kernfs: prepare mount path for kernfs Tejun Heo
2013-11-24 14:57   ` [PATCH REPOST " Tejun Heo
2013-11-23 22:22 ` [PATCH 38/41] sysfs, kernfs: move mount core code to fs/kernfs/mount.c Tejun Heo
2013-11-23 22:22 ` [PATCH 39/41] sysfs, kernfs: make sysfs_dirent definition public Tejun Heo
2013-11-23 22:22 ` [PATCH 40/41] sysfs, kernfs: implement kernfs_ns_enabled() Tejun Heo
2013-11-23 22:22 ` [PATCH 41/41] sysfs, kernfs: remove cross inclusions of internal headers Tejun Heo
2013-11-23 22:48 ` [PATCHSET driver-core-next] sysfs: separate out kernfs, take #3 Tejun Heo
2013-11-23 23:09   ` Tejun Heo
2013-11-24  9:16 ` Christoph Hellwig
2013-11-24 14:28   ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).