Rename md->lock to md->io_lock. --- diff/drivers/md/dm.c 2005-07-06 19:04:29.000000000 +0100 +++ source/drivers/md/dm.c 2005-07-06 19:04:26.000000000 +0100 @@ -58,7 +58,7 @@ #define DMF_FS_LOCKED 2 struct mapped_device { - struct rw_semaphore lock; + struct rw_semaphore io_lock; rwlock_t map_lock; atomic_t holders; @@ -248,16 +248,16 @@ */ static int queue_io(struct mapped_device *md, struct bio *bio) { - down_write(&md->lock); + down_write(&md->io_lock); if (!test_bit(DMF_BLOCK_IO, &md->flags)) { - up_write(&md->lock); + up_write(&md->io_lock); return 1; } bio_list_add(&md->deferred, bio); - up_write(&md->lock); + up_write(&md->io_lock); return 0; /* deferred successfully */ } @@ -568,14 +568,14 @@ int r; struct mapped_device *md = q->queuedata; - down_read(&md->lock); + down_read(&md->io_lock); /* * If we're suspended we have to queue * this io for later. */ while (test_bit(DMF_BLOCK_IO, &md->flags)) { - up_read(&md->lock); + up_read(&md->io_lock); if (bio_rw(bio) == READA) { bio_io_error(bio, bio->bi_size); @@ -594,11 +594,11 @@ * We're in a while loop, because someone could suspend * before we get to the following read lock. */ - down_read(&md->lock); + down_read(&md->io_lock); } __split_bio(md, bio); - up_read(&md->lock); + up_read(&md->io_lock); return 0; } @@ -747,7 +747,7 @@ goto bad1; memset(md, 0, sizeof(*md)); - init_rwsem(&md->lock); + init_rwsem(&md->io_lock); rwlock_init(&md->map_lock); atomic_set(&md->holders, 1); atomic_set(&md->event_nr, 0); @@ -964,7 +964,7 @@ { int r = -EINVAL; - down_write(&md->lock); + down_write(&md->io_lock); /* device must be suspended */ if (!dm_suspended(md)) @@ -974,7 +974,7 @@ r = __bind(md, table); out: - up_write(&md->lock); + up_write(&md->io_lock); return r; } @@ -1044,7 +1044,7 @@ int r = -EINVAL; /* Flush I/O to the device. */ - down_read(&md->lock); + down_read(&md->io_lock); if (test_bit(DMF_BLOCK_IO, &md->flags)) goto out_read_unlock; @@ -1058,7 +1058,7 @@ goto out_read_unlock; } - up_read(&md->lock); + up_read(&md->io_lock); /* * First we set the BLOCK_IO flag so no more ios will be mapped. @@ -1067,7 +1067,7 @@ * suspend as well, so we leave the fs locked for this thread. */ r = -EINVAL; - down_write(&md->lock); + down_write(&md->io_lock); if (test_and_set_bit(DMF_BLOCK_IO, &md->flags)) { if (map) dm_table_put(map); @@ -1075,7 +1075,7 @@ } add_wait_queue(&md->wait, &wait); - up_write(&md->lock); + up_write(&md->io_lock); /* unplug */ if (map) { @@ -1097,7 +1097,7 @@ } set_current_state(TASK_RUNNING); - down_write(&md->lock); + down_write(&md->io_lock); remove_wait_queue(&md->wait, &wait); /* were we interrupted ? */ @@ -1110,7 +1110,7 @@ map = dm_get_table(md); dm_table_postsuspend_targets(map); dm_table_put(map); - up_write(&md->lock); + up_write(&md->io_lock); return 0; @@ -1118,11 +1118,11 @@ __unlock_fs(md); clear_bit(DMF_BLOCK_IO, &md->flags); out_write_unlock: - up_write(&md->lock); + up_write(&md->io_lock); return r; out_read_unlock: - up_read(&md->lock); + up_read(&md->io_lock); return r; } @@ -1131,11 +1131,11 @@ struct bio *def; struct dm_table *map = dm_get_table(md); - down_write(&md->lock); + down_write(&md->io_lock); if (!map || !dm_suspended(md) || !dm_table_get_size(map)) { - up_write(&md->lock); + up_write(&md->io_lock); dm_table_put(map); return -EINVAL; } @@ -1146,7 +1146,7 @@ def = bio_list_get(&md->deferred); __flush_deferred_io(md, def); - up_write(&md->lock); + up_write(&md->io_lock); __unlock_fs(md); dm_table_unplug_all(map); dm_table_put(map);