sysfs: remove ktype->namespace() invocations in symlink code
authorTejun Heo <tj@kernel.org>
Thu, 12 Sep 2013 02:29:06 +0000 (22:29 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Sep 2013 22:30:22 +0000 (15:30 -0700)
commit4b30ee58ee64c64f59fd876e4afa6ed82caef3a4
tree52d26225aec86ae39ed559882a30bec10fdb2031
parente34ff4906199d2ebd248ae897ae34f52bea151c9
sysfs: remove ktype->namespace() invocations in symlink code

There's no reason for sysfs to be calling ktype->namespace().  It is
backwards, obfuscates what's going on and unnecessarily tangles two
separate layers.

There are two places where symlink code calls ktype->namespace().

* sysfs_do_create_link_sd() calls it to find out the namespace tag of
  the target directory.  Unless symlinking races with cross-namespace
  renaming, this equals @target_sd->s_ns.

* sysfs_rename_link() uses it to find out the new namespace to rename
  to and the new namespace can be different from the existing one.
  The function is renamed to sysfs_rename_link_ns() with an explicit
  @ns argument and the ktype->namespace() invocation is shifted to the
  device layer.

While this patch replaces ktype->namespace() invocation with the
recorded result in @target_sd, this shouldn't result in any behvior
difference.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Kay Sievers <kay@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/core.c
fs/sysfs/symlink.c
include/linux/sysfs.h
This page took 0.026577 seconds and 5 git commands to generate.