diff options
author | David Teigland <teigland@redhat.com> | 2006-01-06 09:20:01 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-06 17:34:00 +0100 |
commit | d229a9589ff3b988d3f999cdcfa350f97a372673 (patch) | |
tree | ea6da350027f02736de7c1b7f350bc915abae39c /drivers/md/dm.c | |
parent | [PATCH] device-mapper: add dm_find_md (diff) | |
download | linux-d229a9589ff3b988d3f999cdcfa350f97a372673.tar.xz linux-d229a9589ff3b988d3f999cdcfa350f97a372673.zip |
[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>
Diffstat (limited to 'drivers/md/dm.c')
-rw-r--r-- | drivers/md/dm.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 27cd234cf682..9e8c1edd89dd 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -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; |