diff options
Diffstat (limited to 'drivers/md/dm.h')
-rw-r--r-- | drivers/md/dm.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/md/dm.h b/drivers/md/dm.h index 1ab2028559ca..c4569f02f50f 100644 --- a/drivers/md/dm.h +++ b/drivers/md/dm.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/blkdev.h> | 16 | #include <linux/blkdev.h> |
17 | #include <linux/hdreg.h> | 17 | #include <linux/hdreg.h> |
18 | #include <linux/completion.h> | 18 | #include <linux/completion.h> |
19 | #include <linux/kobject.h> | ||
19 | 20 | ||
20 | #include "dm-stats.h" | 21 | #include "dm-stats.h" |
21 | 22 | ||
@@ -149,11 +150,25 @@ void dm_interface_exit(void); | |||
149 | /* | 150 | /* |
150 | * sysfs interface | 151 | * sysfs interface |
151 | */ | 152 | */ |
153 | struct dm_kobject_holder { | ||
154 | struct kobject kobj; | ||
155 | struct completion completion; | ||
156 | }; | ||
157 | |||
158 | static inline struct completion *dm_get_completion_from_kobject(struct kobject *kobj) | ||
159 | { | ||
160 | return &container_of(kobj, struct dm_kobject_holder, kobj)->completion; | ||
161 | } | ||
162 | |||
152 | int dm_sysfs_init(struct mapped_device *md); | 163 | int dm_sysfs_init(struct mapped_device *md); |
153 | void dm_sysfs_exit(struct mapped_device *md); | 164 | void dm_sysfs_exit(struct mapped_device *md); |
154 | struct kobject *dm_kobject(struct mapped_device *md); | 165 | struct kobject *dm_kobject(struct mapped_device *md); |
155 | struct mapped_device *dm_get_from_kobject(struct kobject *kobj); | 166 | struct mapped_device *dm_get_from_kobject(struct kobject *kobj); |
156 | struct completion *dm_get_completion_from_kobject(struct kobject *kobj); | 167 | |
168 | /* | ||
169 | * The kobject helper | ||
170 | */ | ||
171 | void dm_kobject_release(struct kobject *kobj); | ||
157 | 172 | ||
158 | /* | 173 | /* |
159 | * Targets for linear and striped mappings | 174 | * Targets for linear and striped mappings |