diff options
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm-snap.c | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c index 53cf79d8bcbc..0f47698beafa 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c | |||
@@ -19,7 +19,6 @@ | |||
19 | #include <linux/vmalloc.h> | 19 | #include <linux/vmalloc.h> |
20 | #include <linux/log2.h> | 20 | #include <linux/log2.h> |
21 | #include <linux/dm-kcopyd.h> | 21 | #include <linux/dm-kcopyd.h> |
22 | #include <linux/workqueue.h> | ||
23 | 22 | ||
24 | #include "dm-exception-store.h" | 23 | #include "dm-exception-store.h" |
25 | 24 | ||
@@ -106,10 +105,6 @@ struct dm_snapshot { | |||
106 | 105 | ||
107 | struct dm_kcopyd_client *kcopyd_client; | 106 | struct dm_kcopyd_client *kcopyd_client; |
108 | 107 | ||
109 | /* Queue of snapshot writes for ksnapd to flush */ | ||
110 | struct bio_list queued_bios; | ||
111 | struct work_struct queued_bios_work; | ||
112 | |||
113 | /* Wait for events based on state_bits */ | 108 | /* Wait for events based on state_bits */ |
114 | unsigned long state_bits; | 109 | unsigned long state_bits; |
115 | 110 | ||
@@ -160,9 +155,6 @@ struct dm_dev *dm_snap_cow(struct dm_snapshot *s) | |||
160 | } | 155 | } |
161 | EXPORT_SYMBOL(dm_snap_cow); | 156 | EXPORT_SYMBOL(dm_snap_cow); |
162 | 157 | ||
163 | static struct workqueue_struct *ksnapd; | ||
164 | static void flush_queued_bios(struct work_struct *work); | ||
165 | |||
166 | static sector_t chunk_to_sector(struct dm_exception_store *store, | 158 | static sector_t chunk_to_sector(struct dm_exception_store *store, |
167 | chunk_t chunk) | 159 | chunk_t chunk) |
168 | { | 160 | { |
@@ -1153,9 +1145,6 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv) | |||
1153 | 1145 | ||
1154 | spin_lock_init(&s->tracked_chunk_lock); | 1146 | spin_lock_init(&s->tracked_chunk_lock); |
1155 | 1147 | ||
1156 | bio_list_init(&s->queued_bios); | ||
1157 | INIT_WORK(&s->queued_bios_work, flush_queued_bios); | ||
1158 | |||
1159 | ti->private = s; | 1148 | ti->private = s; |
1160 | ti->num_flush_requests = num_flush_requests; | 1149 | ti->num_flush_requests = num_flush_requests; |
1161 | 1150 | ||
@@ -1279,8 +1268,6 @@ static void snapshot_dtr(struct dm_target *ti) | |||
1279 | struct dm_snapshot *s = ti->private; | 1268 | struct dm_snapshot *s = ti->private; |
1280 | struct dm_snapshot *snap_src = NULL, *snap_dest = NULL; | 1269 | struct dm_snapshot *snap_src = NULL, *snap_dest = NULL; |
1281 | 1270 | ||
1282 | flush_workqueue(ksnapd); | ||
1283 | |||
1284 | down_read(&_origins_lock); | 1271 | down_read(&_origins_lock); |
1285 | /* Check whether exception handover must be cancelled */ | 1272 | /* Check whether exception handover must be cancelled */ |
1286 | (void) __find_snapshots_sharing_cow(s, &snap_src, &snap_dest, NULL); | 1273 | (void) __find_snapshots_sharing_cow(s, &snap_src, &snap_dest, NULL); |
@@ -1342,20 +1329,6 @@ static void flush_bios(struct bio *bio) | |||
1342 | } | 1329 | } |
1343 | } | 1330 | } |
1344 | 1331 | ||
1345 | static void flush_queued_bios(struct work_struct *work) | ||
1346 | { | ||
1347 | struct dm_snapshot *s = | ||
1348 | container_of(work, struct dm_snapshot, queued_bios_work); | ||
1349 | struct bio *queued_bios; | ||
1350 | unsigned long flags; | ||
1351 | |||
1352 | spin_lock_irqsave(&s->pe_lock, flags); | ||
1353 | queued_bios = bio_list_get(&s->queued_bios); | ||
1354 | spin_unlock_irqrestore(&s->pe_lock, flags); | ||
1355 | |||
1356 | flush_bios(queued_bios); | ||
1357 | } | ||
1358 | |||
1359 | static int do_origin(struct dm_dev *origin, struct bio *bio); | 1332 | static int do_origin(struct dm_dev *origin, struct bio *bio); |
1360 | 1333 | ||
1361 | /* | 1334 | /* |
@@ -2291,17 +2264,8 @@ static int __init dm_snapshot_init(void) | |||
2291 | goto bad_tracked_chunk_cache; | 2264 | goto bad_tracked_chunk_cache; |
2292 | } | 2265 | } |
2293 | 2266 | ||
2294 | ksnapd = create_singlethread_workqueue("ksnapd"); | ||
2295 | if (!ksnapd) { | ||
2296 | DMERR("Failed to create ksnapd workqueue."); | ||
2297 | r = -ENOMEM; | ||
2298 | goto bad_pending_pool; | ||
2299 | } | ||
2300 | |||
2301 | return 0; | 2267 | return 0; |
2302 | 2268 | ||
2303 | bad_pending_pool: | ||
2304 | kmem_cache_destroy(tracked_chunk_cache); | ||
2305 | bad_tracked_chunk_cache: | 2269 | bad_tracked_chunk_cache: |
2306 | kmem_cache_destroy(pending_cache); | 2270 | kmem_cache_destroy(pending_cache); |
2307 | bad_pending_cache: | 2271 | bad_pending_cache: |
@@ -2322,8 +2286,6 @@ bad_register_snapshot_target: | |||
2322 | 2286 | ||
2323 | static void __exit dm_snapshot_exit(void) | 2287 | static void __exit dm_snapshot_exit(void) |
2324 | { | 2288 | { |
2325 | destroy_workqueue(ksnapd); | ||
2326 | |||
2327 | dm_unregister_target(&snapshot_target); | 2289 | dm_unregister_target(&snapshot_target); |
2328 | dm_unregister_target(&origin_target); | 2290 | dm_unregister_target(&origin_target); |
2329 | dm_unregister_target(&merge_target); | 2291 | dm_unregister_target(&merge_target); |