diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2002-12-02 21:42:29 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2002-12-02 21:42:29 +0000 |
| commit | ba0b471d641446aef522d28938f104d7a31f219e (patch) | |
| tree | 4ec6b557080c4694c383e311c7de89b826c71b99 /lib/libdisk/chunk.c | |
| parent | 9242a5ab3aaa62086b3647d4c65a8377f07bb12a (diff) | |
Notes
Diffstat (limited to 'lib/libdisk/chunk.c')
| -rw-r--r-- | lib/libdisk/chunk.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/lib/libdisk/chunk.c b/lib/libdisk/chunk.c index 49df0e56e96d..ee15a496e35a 100644 --- a/lib/libdisk/chunk.c +++ b/lib/libdisk/chunk.c @@ -416,25 +416,27 @@ Delete_Chunk(struct disk *d, struct chunk *c) int Delete_Chunk2(struct disk *d, struct chunk *c, int rflags) { - struct chunk *c1 = 0, *c2, *c3; - chunk_e type = c->type; + struct chunk *c1, *c2, *c3; u_long offset = c->offset; - if(type == whole) + switch (c->type) { + case whole: + case unused: return 1; -#ifndef PC98 - if (!c1 && (type == freebsd || type == fat || type == unknown)) - c1 = Find_Mother_Chunk(d->chunks, c->offset, c->end, extended); -#endif - if (!c1 && (type == freebsd || type == fat || type == unknown)) - c1 = Find_Mother_Chunk(d->chunks, c->offset, c->end, whole); -#ifndef PC98 - if (!c1 && type == extended) + case extended: c1 = Find_Mother_Chunk(d->chunks, c->offset, c->end, whole); -#endif - if (!c1 && type == part) + break; + case part: c1 = Find_Mother_Chunk(d->chunks, c->offset, c->end, freebsd); - if (!c1) + break; + default: + c1 = Find_Mother_Chunk(d->chunks, c->offset, c->end, extended); + if (c1 == NULL) + c1 = Find_Mother_Chunk(d->chunks, c->offset, c->end, + whole); + break; + } + if (c1 == NULL) return 1; for (c2 = c1->part; c2; c2 = c2->next) { if (c2 == c) { |
