lkml.org 
[lkml]   [2004]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] backing dev unplugging
Jens,

Small locking changes to the dm bits. I've just seen that you've
posted an updated version of your patch to lkml, so I'll post another
version of this patch to that thread too.

- Joe


Fix md->map protection in the global unplug removal patch.
--- diff/drivers/md/dm.c 2004-03-11 08:41:27.000000000 +0000
+++ source/drivers/md/dm.c 2004-03-11 08:57:14.000000000 +0000
@@ -578,8 +578,12 @@ static int dm_request(request_queue_t *q
static void dm_unplug_all(request_queue_t *q)
{
struct mapped_device *md = q->queuedata;
+ struct dm_table *map = dm_get_table(md);

- dm_table_unplug_all(md->map);
+ if (map) {
+ dm_table_unplug_all(map);
+ dm_table_put(map);
+ }
}

static int dm_any_congested(void *congested_data, int bdi_bits)
@@ -904,11 +908,17 @@ int dm_suspend(struct mapped_device *md)
add_wait_queue(&md->wait, &wait);
up_write(&md->lock);

+ /* unplug */
+ map = dm_get_table(md);
+ if (map) {
+ dm_table_unplug_all(map);
+ dm_table_put(map);
+ }
+
/*
* Then we wait for the already mapped ios to
* complete.
*/
- dm_table_unplug_all(md->map);
while (1) {
set_current_state(TASK_INTERRUPTIBLE);

@@ -953,10 +963,9 @@ int dm_resume(struct mapped_device *md)
def = bio_list_get(&md->deferred);
__flush_deferred_io(md, def);
up_write(&md->lock);
+ dm_table_unplug_all(map);
dm_table_put(map);

- dm_table_unplug_all(md->map);
-
return 0;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 14:01    [W:0.118 / U:0.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site