summaryrefslogtreecommitdiff
path: root/fs/sysfs/symlink.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-11-29 17:19:09 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-11-29 18:41:28 -0800
commitac9bba031001704a2339713cc12148857eccc5e5 (patch)
treec058217a47c51021d97454639ed0f7480c73fe6a /fs/sysfs/symlink.c
parentcf9e5a73aaff0204801dd19cb4bd91d32f32026a (diff)
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 <tj@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/sysfs/symlink.c')
-rw-r--r--fs/sysfs/symlink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c
index 62f0e014ec48..1b8c9ed8511a 100644
--- a/fs/sysfs/symlink.c
+++ b/fs/sysfs/symlink.c
@@ -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);