Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 140179
b: refs/heads/master
c: 53d5914
h: refs/heads/master
i:
  140177: f3bd039
  140175: 1602fcd
v: v3
  • Loading branch information
Mikulas Patocka authored and Alasdair G Kergon committed Apr 2, 2009
1 parent 2459e85 commit 04c36c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 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: 9a1fb46448cac50e93115322ad28f417936f7852
refs/heads/master: 53d5914f288b67ddc4d594d6a09568fe114bb909
24 changes: 7 additions & 17 deletions trunk/drivers/md/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,6 @@ union map_info *dm_get_mapinfo(struct bio *bio)
/*
* Work processed by per-device workqueue.
*/
struct dm_wq_req {
struct work_struct work;
struct mapped_device *md;
};

struct mapped_device {
struct rw_semaphore io_lock;
struct mutex suspend_lock;
Expand All @@ -125,6 +120,7 @@ struct mapped_device {
*/
atomic_t pending;
wait_queue_head_t wait;
struct work_struct work;
struct bio_list deferred;
struct bio_list pushback;

Expand Down Expand Up @@ -1070,6 +1066,8 @@ static int next_free_minor(int *minor)

static struct block_device_operations dm_blk_dops;

static void dm_wq_work(struct work_struct *work);

/*
* Allocate and initialise a blank device with a given minor.
*/
Expand Down Expand Up @@ -1136,6 +1134,7 @@ static struct mapped_device *alloc_dev(int minor)

atomic_set(&md->pending, 0);
init_waitqueue_head(&md->wait);
INIT_WORK(&md->work, dm_wq_work);
init_waitqueue_head(&md->eventq);

md->disk->major = _major;
Expand Down Expand Up @@ -1426,26 +1425,17 @@ static void __merge_pushback_list(struct mapped_device *md)

static void dm_wq_work(struct work_struct *work)
{
struct dm_wq_req *req = container_of(work, struct dm_wq_req, work);
struct mapped_device *md = req->md;
struct mapped_device *md = container_of(work, struct mapped_device,
work);

down_write(&md->io_lock);
__flush_deferred_io(md);
up_write(&md->io_lock);
}

static void dm_wq_queue(struct mapped_device *md, struct dm_wq_req *req)
{
req->md = md;
INIT_WORK(&req->work, dm_wq_work);
queue_work(md->wq, &req->work);
}

static void dm_queue_flush(struct mapped_device *md)
{
struct dm_wq_req req;

dm_wq_queue(md, &req);
queue_work(md->wq, &md->work);
flush_workqueue(md->wq);
}

Expand Down

0 comments on commit 04c36c2

Please sign in to comment.