diff options
author | Jonathan Brassow <jbrassow@redhat.com> | 2009-04-02 14:55:31 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2009-04-02 14:55:31 -0400 |
commit | 493df71c6420b211a68ae82b889c1e8a5fe701be (patch) | |
tree | 2738295190c1b3c5f72d85059aae3c96f162afa6 /drivers/md/dm-exception-store.h | |
parent | 7513c2a761d69d2a93f17146b3563527d3618ba0 (diff) |
dm exception store: introduce registry
Move exception stores into a registry.
Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-exception-store.h')
-rw-r--r-- | drivers/md/dm-exception-store.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/md/dm-exception-store.h b/drivers/md/dm-exception-store.h index aed1f1172f9e..31377150080e 100644 --- a/drivers/md/dm-exception-store.h +++ b/drivers/md/dm-exception-store.h | |||
@@ -39,6 +39,9 @@ struct dm_snap_exception { | |||
39 | */ | 39 | */ |
40 | struct dm_exception_store; | 40 | struct dm_exception_store; |
41 | struct dm_exception_store_type { | 41 | struct dm_exception_store_type { |
42 | const char *name; | ||
43 | struct module *module; | ||
44 | |||
42 | int (*ctr) (struct dm_exception_store *store, | 45 | int (*ctr) (struct dm_exception_store *store, |
43 | unsigned argc, char **argv); | 46 | unsigned argc, char **argv); |
44 | 47 | ||
@@ -85,10 +88,13 @@ struct dm_exception_store_type { | |||
85 | void (*fraction_full) (struct dm_exception_store *store, | 88 | void (*fraction_full) (struct dm_exception_store *store, |
86 | sector_t *numerator, | 89 | sector_t *numerator, |
87 | sector_t *denominator); | 90 | sector_t *denominator); |
91 | |||
92 | /* For internal device-mapper use only. */ | ||
93 | struct list_head list; | ||
88 | }; | 94 | }; |
89 | 95 | ||
90 | struct dm_exception_store { | 96 | struct dm_exception_store { |
91 | struct dm_exception_store_type type; | 97 | struct dm_exception_store_type *type; |
92 | 98 | ||
93 | struct dm_snapshot *snap; | 99 | struct dm_snapshot *snap; |
94 | 100 | ||
@@ -138,6 +144,13 @@ static inline void dm_consecutive_chunk_count_inc(struct dm_snap_exception *e) | |||
138 | 144 | ||
139 | # endif | 145 | # endif |
140 | 146 | ||
147 | int dm_exception_store_type_register(struct dm_exception_store_type *type); | ||
148 | int dm_exception_store_type_unregister(struct dm_exception_store_type *type); | ||
149 | |||
150 | int dm_exception_store_create(const char *type_name, | ||
151 | struct dm_exception_store **store); | ||
152 | void dm_exception_store_destroy(struct dm_exception_store *store); | ||
153 | |||
141 | int dm_exception_store_init(void); | 154 | int dm_exception_store_init(void); |
142 | void dm_exception_store_exit(void); | 155 | void dm_exception_store_exit(void); |
143 | 156 | ||
@@ -150,8 +163,4 @@ void dm_persistent_snapshot_exit(void); | |||
150 | int dm_transient_snapshot_init(void); | 163 | int dm_transient_snapshot_init(void); |
151 | void dm_transient_snapshot_exit(void); | 164 | void dm_transient_snapshot_exit(void); |
152 | 165 | ||
153 | int dm_create_persistent(struct dm_exception_store *store); | ||
154 | |||
155 | int dm_create_transient(struct dm_exception_store *store); | ||
156 | |||
157 | #endif /* _LINUX_DM_EXCEPTION_STORE */ | 166 | #endif /* _LINUX_DM_EXCEPTION_STORE */ |