1
linux/fs/sysfs
Tejun Heo 4b30ee58ee 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>
2013-09-26 15:30:22 -07:00
..
bin.c sysfs: fix up uaccess.h coding style warnings 2013-08-21 16:34:59 -07:00
dir.c sysfs: remove ktype->namespace() invocations in directory code 2013-09-26 15:30:22 -07:00
file.c sysfs: make attr namespace interface less convoluted 2013-09-26 14:50:01 -07:00
group.c sysfs: make attr namespace interface less convoluted 2013-09-26 14:50:01 -07:00
inode.c sysfs: fix up 80 column coding style issues 2013-08-21 16:33:34 -07:00
Kconfig
Makefile
mount.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2013-09-07 14:35:32 -07:00
symlink.c sysfs: remove ktype->namespace() invocations in symlink code 2013-09-26 15:30:22 -07:00
sysfs.h sysfs: make attr namespace interface less convoluted 2013-09-26 14:50:01 -07:00