aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm.c
diff options
context:
space:
mode:
authorMike Anderson <andmike@us.ibm.com>2006-03-27 04:17:54 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-27 11:44:59 -0500
commit1134e5ae79bab61c05657ca35a6297cf87202e35 (patch)
tree16d5e9c722fbe17dc343c65b85628c8e6ee36199 /drivers/md/dm.c
parent9ade92a9a5b0a3a10efa6551b8c67a9277bf0438 (diff)
[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)
1007 1007
1008void dm_put(struct mapped_device *md) 1008void dm_put(struct mapped_device *md)
1009{ 1009{
1010 struct dm_table *map = dm_get_table(md); 1010 struct dm_table *map;
1011 1011
1012 if (atomic_dec_and_test(&md->holders)) { 1012 if (atomic_dec_and_test(&md->holders)) {
1013 map = dm_get_table(md);
1013 if (!dm_suspended(md)) { 1014 if (!dm_suspended(md)) {
1014 dm_table_presuspend_targets(map); 1015 dm_table_presuspend_targets(map);
1015 dm_table_postsuspend_targets(map); 1016 dm_table_postsuspend_targets(map);
1016 } 1017 }
1017 __unbind(md); 1018 __unbind(md);
1019 dm_table_put(map);
1018 free_dev(md); 1020 free_dev(md);
1019 } 1021 }
1020
1021 dm_table_put(map);
1022} 1022}
1023 1023
1024/* 1024/*