]> git.baikalelectronics.ru Git - kernel.git/commit
SYSFS: Allow boot time switching between deprecated and modern sysfs layout
authorAndi Kleen <ak@linux.intel.com>
Wed, 8 Sep 2010 14:54:17 +0000 (16:54 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 22 Oct 2010 17:16:43 +0000 (10:16 -0700)
commitbd24fe0560979b2acd1e6d2c220728bcb17c8733
tree7b327e0b9283c578fb10922edcf6e10b3b8fd943
parentf9e404dfb6e3e5cad72b96e81704e1ba3566e62a
SYSFS: Allow boot time switching between deprecated and modern sysfs layout

I have some systems which need legacy sysfs due to old tools that are
making assumptions that a directory can never be a symlink to another
directory, and it's a big hazzle to compile separate kernels for them.

This patch turns CONFIG_SYSFS_DEPRECATED into a run time option
that can be switched on/off the kernel command line. This way
the same binary can be used in both cases with just a option
on the command line.

The old CONFIG_SYSFS_DEPRECATED_V2 option is still there to set
the default. I kept the weird name to not break existing
config files.

Also the compat code can be still completely disabled by undefining
CONFIG_SYSFS_DEPRECATED_SWITCH -- just the optimizer takes
care of this now instead of lots of ifdefs. This makes the code
look nicer.

v2: This is an updated version on top of Kay's patch to only
handle the block devices. I tested it on my old systems
and that seems to work.

Cc: axboe@kernel.dk
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Documentation/kernel-parameters.txt
block/genhd.c
drivers/base/class.c
drivers/base/core.c
fs/partitions/check.c
include/linux/device.h
init/Kconfig