Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 230679
b: refs/heads/master
c: fecec20
h: refs/heads/master
i:
  230677: d665d01
  230675: 16a8d0d
  230671: 314a783
v: v3
  • Loading branch information
Tejun Heo authored and Alasdair G Kergon committed Jan 13, 2011
1 parent 16f9b2c commit 037cf60
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 39 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 810b492375f4aed5ce222982054adc0394a4bd33
refs/heads/master: fecec20e55ec117a09857ac1a455e2e6e2f17df4
38 changes: 0 additions & 38 deletions trunk/drivers/md/dm-snap.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <linux/vmalloc.h>
#include <linux/log2.h>
#include <linux/dm-kcopyd.h>
#include <linux/workqueue.h>

#include "dm-exception-store.h"

Expand Down Expand Up @@ -106,10 +105,6 @@ struct dm_snapshot {

struct dm_kcopyd_client *kcopyd_client;

/* Queue of snapshot writes for ksnapd to flush */
struct bio_list queued_bios;
struct work_struct queued_bios_work;

/* Wait for events based on state_bits */
unsigned long state_bits;

Expand Down Expand Up @@ -160,9 +155,6 @@ struct dm_dev *dm_snap_cow(struct dm_snapshot *s)
}
EXPORT_SYMBOL(dm_snap_cow);

static struct workqueue_struct *ksnapd;
static void flush_queued_bios(struct work_struct *work);

static sector_t chunk_to_sector(struct dm_exception_store *store,
chunk_t chunk)
{
Expand Down Expand Up @@ -1153,9 +1145,6 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv)

spin_lock_init(&s->tracked_chunk_lock);

bio_list_init(&s->queued_bios);
INIT_WORK(&s->queued_bios_work, flush_queued_bios);

ti->private = s;
ti->num_flush_requests = num_flush_requests;

Expand Down Expand Up @@ -1279,8 +1268,6 @@ static void snapshot_dtr(struct dm_target *ti)
struct dm_snapshot *s = ti->private;
struct dm_snapshot *snap_src = NULL, *snap_dest = NULL;

flush_workqueue(ksnapd);

down_read(&_origins_lock);
/* Check whether exception handover must be cancelled */
(void) __find_snapshots_sharing_cow(s, &snap_src, &snap_dest, NULL);
Expand Down Expand Up @@ -1342,20 +1329,6 @@ static void flush_bios(struct bio *bio)
}
}

static void flush_queued_bios(struct work_struct *work)
{
struct dm_snapshot *s =
container_of(work, struct dm_snapshot, queued_bios_work);
struct bio *queued_bios;
unsigned long flags;

spin_lock_irqsave(&s->pe_lock, flags);
queued_bios = bio_list_get(&s->queued_bios);
spin_unlock_irqrestore(&s->pe_lock, flags);

flush_bios(queued_bios);
}

static int do_origin(struct dm_dev *origin, struct bio *bio);

/*
Expand Down Expand Up @@ -2291,17 +2264,8 @@ static int __init dm_snapshot_init(void)
goto bad_tracked_chunk_cache;
}

ksnapd = create_singlethread_workqueue("ksnapd");
if (!ksnapd) {
DMERR("Failed to create ksnapd workqueue.");
r = -ENOMEM;
goto bad_pending_pool;
}

return 0;

bad_pending_pool:
kmem_cache_destroy(tracked_chunk_cache);
bad_tracked_chunk_cache:
kmem_cache_destroy(pending_cache);
bad_pending_cache:
Expand All @@ -2322,8 +2286,6 @@ static int __init dm_snapshot_init(void)

static void __exit dm_snapshot_exit(void)
{
destroy_workqueue(ksnapd);

dm_unregister_target(&snapshot_target);
dm_unregister_target(&origin_target);
dm_unregister_target(&merge_target);
Expand Down

0 comments on commit 037cf60

Please sign in to comment.