From df37ffc0393b919ba5607bb48b2eaf2f9a1832d7 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Fri, 14 Dec 2007 20:14:00 +1100 Subject: 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. --- Incremental.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Incremental.c') diff --git a/Incremental.c b/Incremental.c index 705c402..94ef47d 100644 --- a/Incremental.c +++ b/Incremental.c @@ -502,7 +502,7 @@ static void find_reject(int mdfd, struct supertype *st, struct sysarray *sra, continue; } st->ss->getinfo_super(&info, super); - free(super); + st->ss->free_super(super); close(dfd); if (info.disk.number != number || @@ -574,24 +574,24 @@ static int count_active(struct supertype *st, int mdfd, char **availp, if (avail[i]) avail[i]--; avail[info.disk.raid_disk] = 2; - free(best_super); + st->ss->free_super(best_super); best_super = super; super = NULL; } else { /* info.events much bigger */ cnt = 1; cnt1 = 0; memset(avail, 0, info.disk.raid_disk); max_events = info.events; - free(best_super); + st->ss->free_super(best_super); best_super = super; super = NULL; } } if (super) - free(super); + st->ss->free_super(super); } if (best_super) { st->ss->getinfo_super(bestinfo,best_super); - free(best_super); + st->ss->free_super(best_super); } return cnt + cnt1; } @@ -636,7 +636,7 @@ void RebuildMap(void) map_add(&map, md->devnum, st->ss->major, st->minor_version, info.uuid, path ? : "/unknown"); - free(super); + st->ss->free_super(super); break; } } -- cgit