diff options
author | Tejun Heo <tj@kernel.org> | 2013-11-28 14:54:41 -0500 |
---|---|---|
committer | Pawel Osmialowski <p.osmialowsk@mcdsrvbld02.digital.local> | 2015-03-27 14:37:32 +0100 |
commit | 68d5511bcc7eeed8a95fe82728ec062065d901fc (patch) | |
tree | 4d29c48f73f169e1239083379621805f53677ec4 /include | |
parent | d3ed458cca348189d127e669b0d07f219ac47cca (diff) | |
download | linux-3.10-68d5511bcc7eeed8a95fe82728ec062065d901fc.tar.gz linux-3.10-68d5511bcc7eeed8a95fe82728ec062065d901fc.tar.bz2 linux-3.10-68d5511bcc7eeed8a95fe82728ec062065d901fc.zip |
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/kernfs.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h index f75548b8ed7..fad8b986800 100644 --- a/include/linux/kernfs.h +++ b/include/linux/kernfs.h @@ -11,6 +11,7 @@ #include <linux/err.h> #include <linux/list.h> #include <linux/mutex.h> +#include <linux/idr.h> #include <linux/lockdep.h> struct file; @@ -23,6 +24,9 @@ struct sysfs_dirent; struct kernfs_root { /* published fields */ struct sysfs_dirent *sd; + + /* private fields, do not use outside kernfs proper */ + struct ida ino_ida; }; struct sysfs_open_file { |