]> git.baikalelectronics.ru Git - kernel.git/commit
block: restore multiple bd_link_disk_holder() support
authorTejun Heo <tj@kernel.org>
Fri, 14 Jan 2011 17:43:57 +0000 (18:43 +0100)
committerJens Axboe <jaxboe@fusionio.com>
Fri, 14 Jan 2011 17:44:22 +0000 (18:44 +0100)
commitb8e847ab92c3876a0a848b544aba3f5e10d517c3
tree5d3476368fa546aebb1c223e9cf1bab5ad80f698
parent68d0e7052c7aeca8a7d24566305359be008ee805
block: restore multiple bd_link_disk_holder() support

Commit a7445185 (block: simplify holder symlink handling) incorrectly
assumed that there is only one link at maximum.  dm may use multiple
links and expects block layer to track reference count for each link,
which is different from and unrelated to the exclusive device holder
identified by @holder when the device is opened.

Remove the single holder assumption and automatic removal of the link
and revive the per-link reference count tracking.  The code
essentially behaves the same as before commit a7445185 sans the
unnecessary kobject reference count dancing.

While at it, note that this facility should not be used by anyone else
than the current ones.  Sysfs symlinks shouldn't be abused like this
and the whole thing doesn't belong in the block layer at all.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Milan Broz <mbroz@redhat.com>
Cc: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Cc: Neil Brown <neilb@suse.de>
Cc: linux-raid@vger.kernel.org
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
drivers/md/dm-table.c
drivers/md/md.c
fs/block_dev.c
include/linux/fs.h