mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
dm thin: Remove unnecessary locking from pool_map()
pool_map() takes pool->lock only while setting the bio's data device. The pool target's data_dev is initialized when the target is constructed and is not changed afterwards. The device-mapper target remains alive while its map callback is running, so pool->lock is not needed to protect data_dev. Remove the unnecessary locking. This also avoids holding pool->lock across bio_set_dev(), which may perform a blkcg lookup and acquire the request queue's queue_lock. Signed-off-by: Hao Zhang <zhanghao1@kylinos.cn> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
This commit is contained in:
parent
bec2fa7bdf
commit
99909b74fb
|
|
@ -3438,14 +3438,11 @@ static int pool_ctr(struct dm_target *ti, unsigned int argc, char **argv)
|
|||
static int pool_map(struct dm_target *ti, struct bio *bio)
|
||||
{
|
||||
struct pool_c *pt = ti->private;
|
||||
struct pool *pool = pt->pool;
|
||||
|
||||
/*
|
||||
* As this is a singleton target, ti->begin is always zero.
|
||||
*/
|
||||
spin_lock_irq(&pool->lock);
|
||||
bio_set_dev(bio, pt->data_dev->bdev);
|
||||
spin_unlock_irq(&pool->lock);
|
||||
|
||||
return DM_MAPIO_REMAPPED;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user