summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm.c
diff options
context:
space:
mode:
authorMike Anderson2006-03-27 11:17:54 +0200
committerLinus Torvalds2006-03-27 18:44:59 +0200
commit1134e5ae79bab61c05657ca35a6297cf87202e35 (patch)
tree16d5e9c722fbe17dc343c65b85628c8e6ee36199 /drivers/md/dm.c
parent[PATCH] dm: tidy mdptr (diff)
downloadkernel-qcow2-linux-1134e5ae79bab61c05657ca35a6297cf87202e35.tar.gz
kernel-qcow2-linux-1134e5ae79bab61c05657ca35a6297cf87202e35.tar.xz
kernel-qcow2-linux-1134e5ae79bab61c05657ca35a6297cf87202e35.zip
[PATCH] dm table: store md
Store an up-pointer to the owning struct mapped_device in every table when it is created. Access it with: struct mapped_device *dm_table_get_md(struct dm_table *t) Tables linked to md must be destroyed before the md itself. Signed-off-by: Mike Anderson <andmike@us.ibm.com> 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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 3d121cbc2fde..b99df48cffed 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1007,18 +1007,18 @@ void dm_get(struct mapped_device *md)
void dm_put(struct mapped_device *md)
{
- struct dm_table *map = dm_get_table(md);
+ struct dm_table *map;
if (atomic_dec_and_test(&md->holders)) {
+ map = dm_get_table(md);
if (!dm_suspended(md)) {
dm_table_presuspend_targets(map);
dm_table_postsuspend_targets(map);
}
__unbind(md);
+ dm_table_put(map);
free_dev(md);
}
-
- dm_table_put(map);
}
/*