summaryrefslogtreecommitdiff
path: root/fs/kernfs/symlink.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-11-30 02:19:09 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-11-30 06:41:28 +0400
commitac9bba031001704a2339713cc12148857eccc5e5 (patch)
treec058217a47c51021d97454639ed0f7480c73fe6a /fs/kernfs/symlink.c
parentcf9e5a73aaff0204801dd19cb4bd91d32f32026a (diff)
downloadlinux-ac9bba031001704a2339713cc12148857eccc5e5.tar.xz
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/kernfs/symlink.c')
-rw-r--r--fs/kernfs/symlink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/kernfs/symlink.c b/fs/kernfs/symlink.c
index 004c16465594..12569a738837 100644
--- a/fs/kernfs/symlink.c
+++ b/fs/kernfs/symlink.c
@@ -35,7 +35,7 @@ struct sysfs_dirent *kernfs_create_link(struct sysfs_dirent *parent,
if (!sd)
return ERR_PTR(-ENOMEM);
- if (parent->s_flags & SYSFS_FLAG_NS)
+ if (kernfs_ns_enabled(parent))
sd->s_ns = target->s_ns;
sd->s_symlink.target_sd = target;
kernfs_get(target); /* ref owned by symlink */