aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-11-13 05:55:17 -0500
committerTejun Heo <tj@kernel.org>2010-11-13 05:55:17 -0500
commite09b457bdb7e8d23fc54dcef0930ac697d8de895 (patch)
tree41035bf61a8acb08292d01c0f66e5450502688af /include/linux/fs.h
parent37004c42f7240035bc2726c340c4efa726b4818e (diff)
block: simplify holder symlink handling
Code to manage symlinks in /sys/block/*/{holders|slaves} are overly complex with multiple holder considerations, redundant extra references to all involved kobjects, unused generic kobject holder support and unnecessary mixup with bd_claim/release functionalities. Strip it down to what's necessary (single gendisk holder) and make it use a separate interface. This is a step for cleaning up bd_claim/release. This patch makes dm-table slightly more complex but it will be simplified again with further changes. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Neil Brown <neilb@suse.de> Acked-by: Mike Snitzer <snitzer@redhat.com> Cc: dm-devel@redhat.com
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 334d68a17108..66b7f2c5d7e9 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -663,7 +663,7 @@ struct block_device {
663 void * bd_holder; 663 void * bd_holder;
664 int bd_holders; 664 int bd_holders;
665#ifdef CONFIG_SYSFS 665#ifdef CONFIG_SYSFS
666 struct list_head bd_holder_list; 666 struct gendisk * bd_holder_disk; /* for sysfs slave linkng */
667#endif 667#endif
668 struct block_device * bd_contains; 668 struct block_device * bd_contains;
669 unsigned bd_block_size; 669 unsigned bd_block_size;
@@ -2042,11 +2042,17 @@ extern int blkdev_put(struct block_device *, fmode_t);
2042extern int bd_claim(struct block_device *, void *); 2042extern int bd_claim(struct block_device *, void *);
2043extern void bd_release(struct block_device *); 2043extern void bd_release(struct block_device *);
2044#ifdef CONFIG_SYSFS 2044#ifdef CONFIG_SYSFS
2045extern int bd_claim_by_disk(struct block_device *, void *, struct gendisk *); 2045extern int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk);
2046extern void bd_release_from_disk(struct block_device *, struct gendisk *); 2046extern void bd_unlink_disk_holder(struct block_device *bdev);
2047#else 2047#else
2048#define bd_claim_by_disk(bdev, holder, disk) bd_claim(bdev, holder) 2048static inline int bd_link_disk_holder(struct block_device *bdev,
2049#define bd_release_from_disk(bdev, disk) bd_release(bdev) 2049 struct gendisk *disk)
2050{
2051 return 0;
2052}
2053static inline void bd_unlink_disk_holder(struct block_device *bdev)
2054{
2055}
2050#endif 2056#endif
2051#endif 2057#endif
2052 2058