[PATCH] device-mapper: add dm_get_md

Add dm_get_dev() to get a mapped device given its dev_t.

Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
David Teigland
2006-01-06 00:20:01 -08:00
committed by Linus Torvalds
parent 637842cfdb
commit d229a9589f
2 changed files with 11 additions and 0 deletions

View File

@@ -921,6 +921,16 @@ static struct mapped_device *dm_find_md(dev_t dev)
return md;
}
struct mapped_device *dm_get_md(dev_t dev)
{
struct mapped_device *md = dm_find_md(dev);
if (md)
dm_get(md);
return md;
}
void *dm_get_mdptr(dev_t dev)
{
struct mapped_device *md;