]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
dm: fix sparse "unexpected unlock" warnings in ioctl code
authorMike Snitzer <snitzer@redhat.com>
Thu, 18 Feb 2016 21:13:51 +0000 (16:13 -0500)
committerMike Snitzer <snitzer@redhat.com>
Mon, 22 Feb 2016 01:27:51 +0000 (20:27 -0500)
commit956a4025808df4abfe2fe25a11feb4c8f33fc336
tree986069505785621f1dc0925ba363e5fc13e19c19
parent664820265d70a759dceca87b6eb200cd2b93cda8
dm: fix sparse "unexpected unlock" warnings in ioctl code

Rename dm_get_live_table_for_ioctl to dm_grab_bdev_for_ioctl and have it
do the dm_{get,put}_live_table() rather than split those operations.

The dm_grab_bdev_for_ioctl() callers only care about the block_device
associated with a singleton DM device so there isn't any need to retain
a reference to the live DM table.  It is sufficient to:
1) dm_get_live_table()
2) bdgrab() the bdev associated with the singleton table's target
3) dm_put_live_table()
4) bdput() the bdev

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm.c