mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
sysfs, kernfs: implement kernfs_ns_enabled()
fs/sysfs/symlink.c::sysfs_delete_link() tests @sd->s_flags for
SYSFS_FLAG_NS. Let's add kernfs_ns_enabled() so that sysfs doesn't
have to test sysfs_dirent flag directly. This makes things tidier for
kernfs proper too.
This is purely cosmetic.
v2: To avoid possible NULL deref, use noop dummy implementation which
always returns false when !CONFIG_SYSFS.
Signed-off-by: Tejun Heo <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
cf9e5a73aa
commit
ac9bba0310
4 changed files with 21 additions and 7 deletions
|
|
@ -128,7 +128,7 @@ void sysfs_delete_link(struct kobject *kobj, struct kobject *targ,
|
|||
* sysfs_remove_dir() for details.
|
||||
*/
|
||||
spin_lock(&sysfs_symlink_target_lock);
|
||||
if (targ->sd && (kobj->sd->s_flags & SYSFS_FLAG_NS))
|
||||
if (targ->sd && kernfs_ns_enabled(kobj->sd))
|
||||
ns = targ->sd->s_ns;
|
||||
spin_unlock(&sysfs_symlink_target_lock);
|
||||
kernfs_remove_by_name_ns(kobj->sd, name, ns);
|
||||
|
|
|
|||
Loading…
Reference in a new issue