diff options
author | Tejun Heo <tj@kernel.org> | 2011-01-14 12:43:57 -0500 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2011-01-14 12:44:22 -0500 |
commit | 49731baa41df404c2c3f44555869ab387363af43 (patch) | |
tree | 5d3476368fa546aebb1c223e9cf1bab5ad80f698 /include/linux/fs.h | |
parent | c553f8e335c00a7cff3ab3f13e793b13d3f2207f (diff) |
block: restore multiple bd_link_disk_holder() support
Commit e09b457b (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 e09b457b 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>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 3984f2358d1f..fb2190349cdf 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -666,7 +666,7 @@ struct block_device { | |||
666 | int bd_holders; | 666 | int bd_holders; |
667 | bool bd_write_holder; | 667 | bool bd_write_holder; |
668 | #ifdef CONFIG_SYSFS | 668 | #ifdef CONFIG_SYSFS |
669 | struct gendisk * bd_holder_disk; /* for sysfs slave linkng */ | 669 | struct list_head bd_holder_disks; |
670 | #endif | 670 | #endif |
671 | struct block_device * bd_contains; | 671 | struct block_device * bd_contains; |
672 | unsigned bd_block_size; | 672 | unsigned bd_block_size; |
@@ -2058,12 +2058,18 @@ extern struct block_device *blkdev_get_by_dev(dev_t dev, fmode_t mode, | |||
2058 | extern int blkdev_put(struct block_device *bdev, fmode_t mode); | 2058 | extern int blkdev_put(struct block_device *bdev, fmode_t mode); |
2059 | #ifdef CONFIG_SYSFS | 2059 | #ifdef CONFIG_SYSFS |
2060 | extern int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk); | 2060 | extern int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk); |
2061 | extern void bd_unlink_disk_holder(struct block_device *bdev, | ||
2062 | struct gendisk *disk); | ||
2061 | #else | 2063 | #else |
2062 | static inline int bd_link_disk_holder(struct block_device *bdev, | 2064 | static inline int bd_link_disk_holder(struct block_device *bdev, |
2063 | struct gendisk *disk) | 2065 | struct gendisk *disk) |
2064 | { | 2066 | { |
2065 | return 0; | 2067 | return 0; |
2066 | } | 2068 | } |
2069 | static inline void bd_unlink_disk_holder(struct block_device *bdev, | ||
2070 | struct gendisk *disk) | ||
2071 | { | ||
2072 | } | ||
2067 | #endif | 2073 | #endif |
2068 | #endif | 2074 | #endif |
2069 | 2075 | ||