summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorrgrimes <rgrimes@FreeBSD.org>1995-05-30 08:29:07 +0000
committerrgrimes <rgrimes@FreeBSD.org>1995-05-30 08:29:07 +0000
commitbb2ad2880bc60129e56a6ddbd15fe918cff834d2 (patch)
treedf4d58dbb04d4c3caaef0cd6a8c16a453481faf5 /lib
parentc86f0c7a71e7ade3e38b325c186a9cf374e0411e (diff)
downloadFreeBSD-src-bb2ad2880bc60129e56a6ddbd15fe918cff834d2.zip
FreeBSD-src-bb2ad2880bc60129e56a6ddbd15fe918cff834d2.tar.gz
Remove trailing whitespace.
Diffstat (limited to 'lib')
-rw-r--r--lib/libdisk/change.c4
-rw-r--r--lib/libdisk/chunk.c28
-rw-r--r--lib/libdisk/create_chunk.c16
-rw-r--r--lib/libdisk/disk.c18
-rw-r--r--lib/libdisk/libdisk.h36
-rw-r--r--lib/libdisk/rules.c10
-rw-r--r--lib/libdisk/tst01.c28
-rw-r--r--lib/libdisk/write_disk.c18
8 files changed, 79 insertions, 79 deletions
diff --git a/lib/libdisk/change.c b/lib/libdisk/change.c
index 0f39179..ab5a46c 100644
--- a/lib/libdisk/change.c
+++ b/lib/libdisk/change.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: change.c,v 1.6 1995/05/24 08:59:36 jkh Exp $
+ * $Id: change.c,v 1.7 1995/05/25 06:14:45 phk Exp $
*
*/
@@ -48,7 +48,7 @@ All_FreeBSD(struct disk *d)
{
struct chunk *c;
- again:
+ again:
for (c=d->chunks->part;c;c=c->next)
if (c->type != unused) {
Delete_Chunk(d,c);
diff --git a/lib/libdisk/chunk.c b/lib/libdisk/chunk.c
index fbf4b0e..a7d7c85 100644
--- a/lib/libdisk/chunk.c
+++ b/lib/libdisk/chunk.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: chunk.c,v 1.12 1995/05/11 05:22:49 phk Exp $
+ * $Id: chunk.c,v 1.13 1995/05/25 06:14:47 phk Exp $
*
*/
@@ -74,7 +74,7 @@ Find_Mother_Chunk(struct chunk *chunks, u_long offset, u_long end, chunk_e type)
void
Free_Chunk(struct chunk *c1)
{
- if(!c1) return;
+ if(!c1) return;
if(c1->private && c1->private_free)
(*c1->private_free)(c1->private);
if(c1->part)
@@ -202,7 +202,7 @@ Add_Chunk(struct disk *d, long offset, u_long size, char *name, chunk_e type,
c2->type = unused;
c1->flags = flags;
c1->subtype = subtype;
- return 0;
+ return 0;
}
if (type == freebsd)
subtype = 0xa5;
@@ -221,12 +221,12 @@ Add_Chunk(struct disk *d, long offset, u_long size, char *name, chunk_e type,
if (c2->type != unused)
continue;
if(Chunk_Inside(c2,&ct)) {
- if (type != freebsd)
+ if (type != freebsd)
goto doit;
- if (!(flags & CHUNK_ALIGN))
+ if (!(flags & CHUNK_ALIGN))
goto doit;
- if (offset == d->chunks->offset
- && end == d->chunks->end)
+ if (offset == d->chunks->offset
+ && end == d->chunks->end)
goto doit;
/* Round down to prev cylinder */
@@ -239,7 +239,7 @@ Add_Chunk(struct disk *d, long offset, u_long size, char *name, chunk_e type,
/* Keep one track clear in front of parent */
if (offset == c1->offset)
offset = Next_Track_Aligned(d,offset+1);
-
+
/* Work on the (end+1) */
size += offset;
/* Round up to cylinder */
@@ -249,7 +249,7 @@ Add_Chunk(struct disk *d, long offset, u_long size, char *name, chunk_e type,
size = c2->end+1;
/* Round down to cylinder */
size = Prev_Cyl_Aligned(d,size);
-
+
/* Convert back to size */
size -= offset;
@@ -271,7 +271,7 @@ Print_Chunk(struct chunk *c1,int offset)
putchar('>');
for(;i<10;i++) putchar(' ');
printf("%p %8ld %8lu %8lu %-8s %-8s 0x%02x ",
- c1, c1->offset, c1->size, c1->end, c1->name,
+ c1, c1->offset, c1->size, c1->end, c1->name,
chunk_n[c1->type],c1->subtype);
if (c1->flags & CHUNK_ALIGN) putchar('=');
if (c1->flags & CHUNK_PAST_1024) putchar('>');
@@ -309,7 +309,7 @@ Delete_Chunk(struct disk *d, struct chunk *c)
struct chunk *c1=0,*c2,*c3;
chunk_e type = c->type;
- if(type == whole)
+ if(type == whole)
return 1;
if(!c1 && (type == freebsd || type == fat || type == unknown))
c1 = Find_Mother_Chunk(d->chunks,c->offset,c->end,extended);
@@ -334,7 +334,7 @@ Delete_Chunk(struct disk *d, struct chunk *c)
}
}
return 1;
- scan:
+ scan:
for(c2=c1->part;c2;c2=c2->next) {
if (c2->type != unused)
continue;
@@ -370,7 +370,7 @@ Collapse_Chunk(struct disk *d, struct chunk *c1)
c3->next = 0;
Free_Chunk(c3);
return 1;
- }
+ }
c3 = c1->part;
if(!c3)
return 0;
@@ -386,7 +386,7 @@ Collapse_Chunk(struct disk *d, struct chunk *c1)
}
if(c3->type == unused) {
c2 = new_chunk();
- if (!c2) err(1,"malloc failed");
+ if (!c2) err(1,"malloc failed");
*c2 = *c1;
c1->next = c2;
c1->disk = d;
diff --git a/lib/libdisk/create_chunk.c b/lib/libdisk/create_chunk.c
index f7bca32..e019752 100644
--- a/lib/libdisk/create_chunk.c
+++ b/lib/libdisk/create_chunk.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: create_chunk.c,v 1.18 1995/05/20 19:11:44 phk Exp $
+ * $Id: create_chunk.c,v 1.19 1995/05/24 08:59:38 jkh Exp $
*
*/
@@ -40,7 +40,7 @@ Fixup_FreeBSD_Names(struct disk *d, struct chunk *c)
}
/* Allocate the first swap-partition we find */
- for (c1 = c->part; c1 ; c1 = c1->next) {
+ for (c1 = c->part; c1 ; c1 = c1->next) {
if (c1->type == unused) continue;
if (c1->subtype != FS_SWAP) continue;
sprintf(c1->name,"%s%c",c->name,SWAP_PART+'a');
@@ -48,7 +48,7 @@ Fixup_FreeBSD_Names(struct disk *d, struct chunk *c)
}
/* Allocate the first root-partition we find */
- for (c1 = c->part; c1 ; c1 = c1->next) {
+ for (c1 = c->part; c1 ; c1 = c1->next) {
if (c1->type == unused) continue;
if (!(c1->flags & CHUNK_IS_ROOT)) continue;
sprintf(c1->name,"%s%c",c->name,0+'a');
@@ -58,7 +58,7 @@ Fixup_FreeBSD_Names(struct disk *d, struct chunk *c)
/* Try to give them the same as they had before */
for (c1 = c->part; c1 ; c1 = c1->next) {
if (strcmp(c1->name,"X")) continue;
- for(c3 = c->part; c3 ; c3 = c3->next)
+ for(c3 = c->part; c3 ; c3 = c3->next)
if (c1 != c3 && !strcmp(c3->name, c1->oname)) {
goto newname;
}
@@ -75,7 +75,7 @@ Fixup_FreeBSD_Names(struct disk *d, struct chunk *c)
for(j=0;j<strlen(order);j++) {
sprintf(c1->name,"%s%c",c->name,order[j]);
- for(c3 = c->part; c3 ; c3 = c3->next)
+ for(c3 = c->part; c3 ; c3 = c3->next)
if (c1 != c3 && !strcmp(c3->name, c1->name))
goto match;
break;
@@ -124,7 +124,7 @@ Fixup_Names(struct disk *d)
if(!c2->oname) err(1,"malloc failed");
for(j=1;j<=NDOSPART;j++) {
sprintf(c2->oname,"%ss%d",c1->name,j);
- for(c3 = c1->part; c3 ; c3 = c3->next)
+ for(c3 = c1->part; c3 ; c3 = c3->next)
if (c3 != c2 && !strcmp(c3->name, c2->oname))
goto match;
free(c2->name);
@@ -204,7 +204,7 @@ Create_Chunk_DWIM(struct disk *d, struct chunk *parent , u_long size, chunk_e ty
}
Fixup_Names(d);
for (c1=parent->part; c1 ; c1 = c1->next)
- if (c1->offset == offset)
+ if (c1->offset == offset)
return c1;
err(1,"Serious internal trouble");
}
@@ -215,7 +215,7 @@ MakeDev(struct chunk *c1, char *path)
char *p = c1->name;
u_long cmaj,bmaj,min,unit,part,slice;
char buf[BUFSIZ],buf2[BUFSIZ];
-
+
*buf2 = '\0';
if(!strcmp(p,"X"))
diff --git a/lib/libdisk/disk.c b/lib/libdisk/disk.c
index f38a99f..e3899c7 100644
--- a/lib/libdisk/disk.c
+++ b/lib/libdisk/disk.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: disk.c,v 1.17 1995/05/06 03:28:29 phk Exp $
+ * $Id: disk.c,v 1.18 1995/05/08 02:08:28 phk Exp $
*
*/
@@ -24,7 +24,7 @@
#include "libdisk.h"
#define DOSPTYP_EXTENDED 5
-#define DOSPTYP_ONTRACK 84
+#define DOSPTYP_ONTRACK 84
char *chunk_n[] = {
"whole",
@@ -99,7 +99,7 @@ Int_Open_Disk(char *name, u_long size)
d->flags |= DISK_ON_TRACK;
offset = 63;
}
-
+
}
free(p);
@@ -140,7 +140,7 @@ Int_Open_Disk(char *name, u_long size)
default:
ce = unknown;
break;
- }
+ }
if (Add_Chunk(d,ds.dss_slices[i].ds_offset,
ds.dss_slices[i].ds_size, sname,ce,subtype,flags))
warn("failed to add chunk for slice %d",i - 1);
@@ -166,7 +166,7 @@ Int_Open_Disk(char *name, u_long size)
continue;
}
close(j);
-
+
for(j=0; j <= dl.d_npartitions; j++) {
if (j == RAW_PART)
continue;
@@ -273,7 +273,7 @@ Disk_Names()
disks = malloc(sizeof *disks * (1 + MAX_NO_DISKS));
memset(disks,0,sizeof *disks * (1 + MAX_NO_DISKS));
- k = 0;
+ k = 0;
for (j = 0; device_list[j]; j++) {
for (i = 0; i < 10; i++) {
sprintf(diskname, "%s%d", device_list[j], i);
@@ -298,7 +298,7 @@ void
Set_Boot_Mgr(struct disk *d, u_char *b)
{
if (d->bootmgr)
- free(d->bootmgr);
+ free(d->bootmgr);
if (!b) {
d->bootmgr = 0;
} else {
@@ -311,11 +311,11 @@ Set_Boot_Mgr(struct disk *d, u_char *b)
void
Set_Boot_Blocks(struct disk *d, u_char *b1, u_char *b2)
{
- if (d->boot1) free(d->boot1);
+ if (d->boot1) free(d->boot1);
d->boot1 = malloc(512);
if(!d->boot1) err(1,"malloc failed");
memcpy(d->boot1,b1,512);
- if (d->boot2) free(d->boot2);
+ if (d->boot2) free(d->boot2);
d->boot2 = malloc(15*512);
if(!d->boot2) err(1,"malloc failed");
memcpy(d->boot2,b2,15*512);
diff --git a/lib/libdisk/libdisk.h b/lib/libdisk/libdisk.h
index ebc4d83..6ba7bbb 100644
--- a/lib/libdisk/libdisk.h
+++ b/lib/libdisk/libdisk.h
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: libdisk.h,v 1.16 1995/05/12 18:49:58 phk Exp $
+ * $Id: libdisk.h,v 1.17 1995/05/25 06:14:49 phk Exp $
*
*/
@@ -57,13 +57,13 @@ struct chunk {
int subtype;
u_long flags;
# define CHUNK_PAST_1024 1
- /* this chunk cannot be booted from because it
+ /* this chunk cannot be booted from because it
* extends past cylinder 1024
*/
# define CHUNK_BSD_COMPAT 2
- /* this chunk is in the BSD-compatibility, and has a
+ /* this chunk is in the BSD-compatibility, and has a
* short name too, ie wd0s4f -> wd0f
- */
+ */
# define CHUNK_BAD144 4
/* this chunk has bad144 mapping */
# define CHUNK_ALIGN 8
@@ -86,14 +86,14 @@ struct chunk {
struct disk *
Open_Disk(char *devname);
/* Will open the named disk, and return populated tree.
- */
+ */
struct disk *
Clone_Disk(struct disk *disk);
/* Clone a copy of a tree. Useful for "Undo" functionality
*/
-void
+void
Free_Disk(struct disk *disk);
/* Free a tree made with Open_Disk() or Clone_Disk()
*/
@@ -109,14 +109,14 @@ Set_Phys_Geom(struct disk *disk, u_long cyl, u_long heads, u_long sects);
* The tree returned is read from the disk, using this geometry.
*/
-void
+void
Set_Bios_Geom(struct disk *disk, u_long cyl, u_long heads, u_long sects);
/* Set the geometry the bios uses.
*/
-int
+int
Delete_Chunk(struct disk *disk, struct chunk *);
- /* Free a chunk of disk_space
+ /* Free a chunk of disk_space
*/
void
@@ -128,7 +128,7 @@ Collapse_Chunk(struct disk *disk, struct chunk *chunk);
/* Experimental, do not use.
*/
-int
+int
Create_Chunk(struct disk *disk, u_long offset, u_long size, chunk_e type, int subtype, u_long flags);
/* Create a chunk with the specified paramters
*/
@@ -138,7 +138,7 @@ All_FreeBSD(struct disk *d);
/* Make one FreeBSD chunk covering the entire disk
*/
-char *
+char *
CheckRules(struct disk *);
/* Return char* to warnings about broken design rules in this disklayout
*/
@@ -211,7 +211,7 @@ void
MakeDevDisk(struct disk *d,char *path);
/* Make device nodes for all chunks on this disk */
-/*
+/*
* Implementation details >>> DO NOT USE <<<
*/
@@ -233,13 +233,13 @@ void Fixup_Names(struct disk *);
/* TODO
*
* Need a error string mechanism from the functions instead of warn()
- *
+ *
* Make sure only FreeBSD start at offset==0
- *
+ *
* Collapse must align.
- *
+ *
* Make Write_Disk(struct disk*)
- *
+ *
* Consider booting from OnTrack'ed disks.
*
* Get Bios-geom, ST506 & OnTrack from driver (or otherwise)
@@ -247,7 +247,7 @@ void Fixup_Names(struct disk *);
* Make Create_DWIM().
*
* Make Is_Unchanged(struct disk *d1, struct chunk *c1)
- *
+ *
* don't rename slices unless we have to
*
*Sample output from tst01:
@@ -294,7 +294,7 @@ void Fixup_Names(struct disk *);
* | <wd0s5>
* |
* v
- * <wd0s3>
+ * <wd0s3>
* |
* v
* <wd0s4> --> <wd0s4a>
diff --git a/lib/libdisk/rules.c b/lib/libdisk/rules.c
index 2c21eb4..73a321c 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.8 1995/05/06 03:28:31 phk Exp $
+ * $Id: rules.c,v 1.9 1995/05/08 01:34:31 phk Exp $
*
*/
@@ -100,7 +100,7 @@ Rule_000(struct disk *d, struct chunk *c, char *msg)
"Too many active children of 'whole'");
}
-/*
+/*
* Rule#1:
* All children of 'whole' and 'extended' must be track-aligned.
* Exception: the end can be unaligned if it matches the end of 'whole'
@@ -130,7 +130,7 @@ Rule_001(struct disk *d, struct chunk *c, char *msg)
}
}
-/*
+/*
* Rule#2:
* Max one 'fat' as child of 'whole'
*/
@@ -153,7 +153,7 @@ Rule_002(struct disk *d, struct chunk *c, char *msg)
}
}
-/*
+/*
* Rule#3:
* Max one extended as child of 'whole'
*/
@@ -176,7 +176,7 @@ Rule_003(struct disk *d, struct chunk *c, char *msg)
}
}
-/*
+/*
* Rule#4:
* Max seven 'part' as children of 'freebsd'
* Max one FS_SWAP child per 'freebsd'
diff --git a/lib/libdisk/tst01.c b/lib/libdisk/tst01.c
index 1c0c43e..506e3b9 100644
--- a/lib/libdisk/tst01.c
+++ b/lib/libdisk/tst01.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: tst01.c,v 1.12 1995/05/11 05:22:54 phk Exp $
+ * $Id: tst01.c,v 1.13 1995/05/12 18:50:00 phk Exp $
*
*/
@@ -112,9 +112,9 @@ Scan_Disk(struct disk *d)
printf(".%lu\nG: %lu.",l-1,l);
fflush(stdout);
}
- i = j;
+ i = j;
}
- }
+ }
close(fd);
}
@@ -135,7 +135,7 @@ main(int argc, char **argv)
exit(1);
}
d = Open_Disk(argv[1]);
- if (!d)
+ if (!d)
err(1,"Couldn't open disk %s",argv[1]);
sprintf(myprompt,"%s %s> ",argv[0],argv[1]);
@@ -192,41 +192,41 @@ main(int argc, char **argv)
All_FreeBSD(d);
continue;
}
- if (!strcasecmp(*cmds,"bios") && ncmd == 4) {
+ if (!strcasecmp(*cmds,"bios") && ncmd == 4) {
Set_Bios_Geom(d,
strtol(cmds[1],0,0),
strtol(cmds[2],0,0),
strtol(cmds[3],0,0));
continue;
}
- if (!strcasecmp(*cmds,"phys") && ncmd == 4) {
+ if (!strcasecmp(*cmds,"phys") && ncmd == 4) {
d = Set_Phys_Geom(d,
strtol(cmds[1],0,0),
strtol(cmds[2],0,0),
strtol(cmds[3],0,0));
continue;
}
- if (!strcasecmp(*cmds,"collapse")) {
+ if (!strcasecmp(*cmds,"collapse")) {
if (cmds[1])
while (Collapse_Chunk(d,
(struct chunk *)strtol(cmds[1],0,0)))
;
- else
+ else
Collapse_Disk(d);
continue;
- }
- if (!strcasecmp(*cmds,"list")) {
+ }
+ if (!strcasecmp(*cmds,"list")) {
cp = Disk_Names();
printf("Disks:");
for(i=0;cp[i];i++) {
printf(" %s",cp[i]);
free(cp[i]);
- }
+ }
free(cp);
continue;
}
- if (!strcasecmp(*cmds,"create") && ncmd == 6) {
-
+ if (!strcasecmp(*cmds,"create") && ncmd == 6) {
+
printf("Create=%d\n",
Create_Chunk(d,
strtol(cmds[1],0,0),
@@ -294,7 +294,7 @@ main(int argc, char **argv)
for(i=0;chunk_n[i];i++)
printf("%d = %s%s",i,chunk_n[i],i == 4 ? "\n\t" : " ");
printf("\n");
-
+
}
exit (0);
}
diff --git a/lib/libdisk/write_disk.c b/lib/libdisk/write_disk.c
index 3b9a163..e2c0674 100644
--- a/lib/libdisk/write_disk.c
+++ b/lib/libdisk/write_disk.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: write_disk.c,v 1.11 1995/05/21 07:47:24 phk Exp $
+ * $Id: write_disk.c,v 1.12 1995/05/24 08:59:40 jkh Exp $
*
*/
@@ -24,7 +24,7 @@
#include "libdisk.h"
#define DOSPTYP_EXTENDED 5
-#define BBSIZE 8192
+#define BBSIZE 8192
#define WHERE(offset,disk) (disk->flags & DISK_ON_TRACK ? offset + 63 : offset)
int
@@ -91,7 +91,7 @@ Write_FreeBSD(int fd, struct disk *new, struct disk *old, struct chunk *c1)
for(i=0;i<BBSIZE/512;i++) {
write_block(fd,WHERE(i + c1->offset,new),buf+512*i);
}
-
+
return 0;
}
@@ -151,7 +151,7 @@ Write_Disk(struct disk *d1)
} else {
dp[j].dp_ssect = i % d1->bios_sect;
i -= dp[j].dp_ssect++;
- i /= d1->bios_sect;
+ i /= d1->bios_sect;
dp[j].dp_shd = i % d1->bios_hd;
i -= dp[j].dp_shd;
i /= d1->bios_hd;
@@ -161,14 +161,14 @@ Write_Disk(struct disk *d1)
}
#ifdef DEBUG
- printf("S:%lu = (%x/%x/%x)",
+ printf("S:%lu = (%x/%x/%x)",
c1->offset,dp[j].dp_scyl,dp[j].dp_shd,dp[j].dp_ssect);
#endif
i = c1->end;
dp[j].dp_esect = i % d1->bios_sect;
i -= dp[j].dp_esect++;
- i /= d1->bios_sect;
+ i /= d1->bios_sect;
dp[j].dp_ehd = i % d1->bios_hd;
i -= dp[j].dp_ehd;
i /= d1->bios_hd;
@@ -178,7 +178,7 @@ Write_Disk(struct disk *d1)
dp[j].dp_esect |= i >> 2;
#ifdef DEBUG
- printf(" E:%lu = (%x/%x/%x)\n",
+ printf(" E:%lu = (%x/%x/%x)\n",
c1->end,dp[j].dp_ecyl,dp[j].dp_ehd,dp[j].dp_esect);
#endif
@@ -199,10 +199,10 @@ Write_Disk(struct disk *d1)
for(i=0;i<NDOSPART;i++)
if (dp[i].dp_typ == 0xa5)
dp[i].dp_flag = 0x80;
-
+
mbr = read_block(fd,WHERE(0,d1));
if (d1->bootmgr)
- memcpy(mbr,d1->bootmgr,DOSPARTOFF);
+ memcpy(mbr,d1->bootmgr,DOSPARTOFF);
memcpy(mbr+DOSPARTOFF,dp,sizeof *dp * NDOSPART);
mbr[512-2] = 0x55;
mbr[512-1] = 0xaa;
OpenPOWER on IntegriCloud