diff options
author | phk <phk@FreeBSD.org> | 1995-04-29 07:21:14 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1995-04-29 07:21:14 +0000 |
commit | 9684e60aa333602d99d67bf4386e5ea09dd26530 (patch) | |
tree | fa70e13b20375cea9c33bb00b43511f4b3042b5e /release/libdisk/rules.c | |
parent | 5cc2dacd0f6917d2ba5808d3171283232acad395 (diff) | |
download | FreeBSD-src-9684e60aa333602d99d67bf4386e5ea09dd26530.zip FreeBSD-src-9684e60aa333602d99d67bf4386e5ea09dd26530.tar.gz |
Names are assigned when chunks are created.
Rules for only one fat & one extended in MBR.
Diffstat (limited to 'release/libdisk/rules.c')
-rw-r--r-- | release/libdisk/rules.c | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/release/libdisk/rules.c b/release/libdisk/rules.c index 447c6de..9a53b4e 100644 --- a/release/libdisk/rules.c +++ b/release/libdisk/rules.c @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id: rules.c,v 1.1 1995/04/29 01:55:24 phk Exp $ + * $Id: rules.c,v 1.2 1995/04/29 04:00:56 phk Exp $ * */ @@ -97,11 +97,59 @@ Rule_001(struct disk *d, struct chunk *c, char *msg) } } +/* + * Rule#2: + * Max one 'fat' as child of 'whole' + */ +void +Rule_002(struct disk *d, struct chunk *c, char *msg) +{ + int i; + struct chunk *c1; + + if (c->type != whole) + return; + for (i=0, c1=c->part; c1; c1=c1->next) { + if (c1->type != fat) + continue; + i++; + } + if (i > 1) { + sprintf(msg+strlen(msg), + "Max one 'fat' allowed as child of 'whole'\n"); + } +} + +/* + * Rule#3: + * Max one extended as child of 'whole' + */ +void +Rule_003(struct disk *d, struct chunk *c, char *msg) +{ + int i; + struct chunk *c1; + + if (c->type != whole) + return; + for (i=0, c1=c->part; c1; c1=c1->next) { + if (c1->type != extended) + continue; + i++; + } + if (i > 1) { + sprintf(msg+strlen(msg), + "Max one 'extended' allowed as child of 'whole'\n"); + } +} + void Check_Chunk(struct disk *d, struct chunk *c, char *msg) { Rule_000(d,c,msg); Rule_001(d,c,msg); + Rule_002(d,c,msg); + Rule_003(d,c,msg); if (c->part) Check_Chunk(d,c->part,msg); if (c->next) |