summaryrefslogtreecommitdiffstats
path: root/super1.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2007-12-14 20:14:00 +1100
committerNeil Brown <neilb@suse.de>2007-12-14 20:14:00 +1100
commitdf37ffc0393b919ba5607bb48b2eaf2f9a1832d7 (patch)
treeda5119c602aa6e1c40248b5a9c8312aedceaeedb /super1.c
parent2faf1f5f635419a922cf0072c435a23a78b793a7 (diff)
downloadmdadm-df37ffc0393b919ba5607bb48b2eaf2f9a1832d7.tar.gz
mdadm-df37ffc0393b919ba5607bb48b2eaf2f9a1832d7.tar.xz
mdadm-df37ffc0393b919ba5607bb48b2eaf2f9a1832d7.zip
Allow metadata handlers to free their own superblock.
As the metadata handler allocates the superblock, it should free it too. DDF will have a more complex 'superblock' which needs more complex freeing.
Diffstat (limited to 'super1.c')
-rw-r--r--super1.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/super1.c b/super1.c
index 2b096d3..804a07e 100644
--- a/super1.c
+++ b/super1.c
@@ -1366,6 +1366,12 @@ static int write_bitmap1(struct supertype *st, int fd, void *sbv)
return rv;
}
+static void free_super1(void *super)
+{
+ if (super)
+ free(super);
+}
+
struct superswitch super1 = {
#ifndef MDASSEMBLE
.examine_super = examine_super1,
@@ -1389,6 +1395,7 @@ struct superswitch super1 = {
.add_internal_bitmap = add_internal_bitmap1,
.locate_bitmap = locate_bitmap1,
.write_bitmap = write_bitmap1,
+ .free_super = free_super1,
.major = 1,
#if __BYTE_ORDER == BIG_ENDIAN
.swapuuid = 0,