kernfs: mark static names with KERNFS_STATIC_NAME
authorTejun Heo <tj@kernel.org>
Wed, 11 Dec 2013 21:02:57 +0000 (16:02 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Dec 2013 16:59:15 +0000 (08:59 -0800)
commit2063d608f5110d120db60e896ec2c70c95bb7978
tree45b02932c241cf2fe6a54ee4013a94221b2c2b8d
parentd0ae3d4347ee025cf23b850d484fe8593f7dd0f2
kernfs: mark static names with KERNFS_STATIC_NAME

Because sysfs used struct attribute which are supposed to stay
constant, sysfs didn't copy names when creating regular files.  The
specified string for name was supposed to stay constant.  Such
distinction isn't inherent for kernfs.  kernfs_create_file[_ns]()
should be able to take the same @name as kernfs_create_dir[_ns]()

As there can be huge number of sysfs attributes, we still want to be
able to use static names for sysfs attributes.  This patch renames
kernfs_create_file_ns_key() to __kernfs_create_file() and adds
@name_is_static parameter so that the caller can explicitly indicate
that @name can be used without copying.  kernfs is updated to use
KERNFS_STATIC_NAME to distinguish static and copied names.

This patch doesn't introduce any behavior changes.

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/sysfs/file.c
include/linux/kernfs.h