diff options
author | Tejun Heo <tj@kernel.org> | 2013-12-11 22:02:55 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-12-17 17:59:15 +0100 |
commit | bb8b9d095c5c56cce99576cfef0cf9b989f7120d (patch) | |
tree | 9cc1ae8c8954de2d0dbb0b0f4c29a411d4716809 /fs/sysfs/dir.c | |
parent | kernfs: s/sysfs/kernfs/ in internal functions and whatever is left (diff) | |
download | linux-bb8b9d095c5c56cce99576cfef0cf9b989f7120d.tar.xz linux-bb8b9d095c5c56cce99576cfef0cf9b989f7120d.zip |
kernfs: add @mode to kernfs_create_dir[_ns]()
sysfs assumed 0755 for all newly created directories and kernfs
inherited it. This assumption is unnecessarily restrictive and
inconsistent with kernfs_create_file[_ns](). This patch adds @mode
parameter to kernfs_create_dir[_ns]() and update uses in sysfs
accordingly. Among others, this will be useful for implementations of
the planned ->mkdir() method.
This patch doesn't introduce any behavior differences.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/sysfs/dir.c')
-rw-r--r-- | fs/sysfs/dir.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c index aa007401bfc9..ee0d761c3179 100644 --- a/fs/sysfs/dir.c +++ b/fs/sysfs/dir.c @@ -73,7 +73,8 @@ int sysfs_create_dir_ns(struct kobject *kobj, const void *ns) if (!parent) return -ENOENT; - kn = kernfs_create_dir_ns(parent, kobject_name(kobj), kobj, ns); + kn = kernfs_create_dir_ns(parent, kobject_name(kobj), + S_IRWXU | S_IRUGO | S_IXUGO, kobj, ns); if (IS_ERR(kn)) { if (PTR_ERR(kn) == -EEXIST) sysfs_warn_dup(parent, kobject_name(kobj)); |