mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 16:41:25 +00:00
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>
This commit is contained in:
parent
d0ae3d4347
commit
2063d608f5
5 changed files with 36 additions and 28 deletions
|
@ -105,7 +105,7 @@ int kernfs_add_one(struct kernfs_addrm_cxt *acxt, struct kernfs_node *kn,
|
|||
struct kernfs_node *parent);
|
||||
void kernfs_addrm_finish(struct kernfs_addrm_cxt *acxt);
|
||||
struct kernfs_node *kernfs_new_node(struct kernfs_root *root, const char *name,
|
||||
umode_t mode, int type);
|
||||
umode_t mode, unsigned flags);
|
||||
|
||||
/*
|
||||
* file.c
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue