diff options
| author | Poul-Henning Kamp <phk@FreeBSD.org> | 1995-04-29 07:21:14 +0000 |
|---|---|---|
| committer | Poul-Henning Kamp <phk@FreeBSD.org> | 1995-04-29 07:21:14 +0000 |
| commit | a29b6fccc0d480a9f4fed41056a2f357aaf1101b (patch) | |
| tree | fa70e13b20375cea9c33bb00b43511f4b3042b5e /lib/libdisk/rules.c | |
| parent | 65b36cbb7d3d450ecf2b93a137bf4d42d65effa6 (diff) | |
Notes
Diffstat (limited to 'lib/libdisk/rules.c')
| -rw-r--r-- | lib/libdisk/rules.c | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/lib/libdisk/rules.c b/lib/libdisk/rules.c index 447c6de4f58e..9a53b4ef3bd2 100644 --- a/lib/libdisk/rules.c +++ b/lib/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) |
