aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/dm.h')
-rw-r--r--drivers/md/dm.h17
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 */
153struct dm_kobject_holder {
154 struct kobject kobj;
155 struct completion completion;
156};
157
158static 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
152int dm_sysfs_init(struct mapped_device *md); 163int dm_sysfs_init(struct mapped_device *md);
153void dm_sysfs_exit(struct mapped_device *md); 164void dm_sysfs_exit(struct mapped_device *md);
154struct kobject *dm_kobject(struct mapped_device *md); 165struct kobject *dm_kobject(struct mapped_device *md);
155struct mapped_device *dm_get_from_kobject(struct kobject *kobj); 166struct mapped_device *dm_get_from_kobject(struct kobject *kobj);
156struct completion *dm_get_completion_from_kobject(struct kobject *kobj); 167
168/*
169 * The kobject helper
170 */
171void dm_kobject_release(struct kobject *kobj);
157 172
158/* 173/*
159 * Targets for linear and striped mappings 174 * Targets for linear and striped mappings