sysfs, kernfs: make inode number ida per kernfs_root
authorTejun Heo <tj@kernel.org>
Thu, 28 Nov 2013 19:54:41 +0000 (14:54 -0500)
committerPawel Osmialowski <p.osmialowsk@mcdsrvbld02.digital.local>
Fri, 27 Mar 2015 17:13:18 +0000 (18:13 +0100)
commit2856420896f24ced79bde2697f61c6d5faec6ac2
tree1b938aa70d3a1a960fb7c0e51cd1095e15c66972
parentadba613153108155b41b210ab20de68b4323da4f
sysfs, kernfs: make inode number ida per kernfs_root

kernfs is being updated to allow multiple sysfs_dirent hierarchies so
that it can also be used by other users.  Currently, inode number is
allocated using a global ida, sysfs_ino_ida; however, inos for
different hierarchies should be handled separately.

This patch makes ino allocation per kernfs_root.  sysfs_ino_ida is
replaced by kernfs_root->ino_ida and sysfs_new_dirent() is updated to
take @root and allocate ino from it.  ida_simple_get/remove() are used
instead of sysfs_ino_lock and sysfs_alloc/free_ino().

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/kernfs/dir.c
fs/kernfs/file.c
fs/kernfs/kernfs-internal.h
fs/kernfs/symlink.c
include/linux/kernfs.h