Index: usr.sbin/makefs/cd9660.h =================================================================== --- usr.sbin/makefs/cd9660.h +++ usr.sbin/makefs/cd9660.h @@ -314,8 +314,8 @@ void cd9660_731(uint32_t, unsigned char *); void cd9660_722(uint16_t, unsigned char *); void cd9660_732(uint32_t, unsigned char *); -void cd9660_bothendian_dword(uint32_t dw, unsigned char *); -void cd9660_bothendian_word(uint16_t dw, unsigned char *); +void cd9660_bothendian_dword(uint32_t dw, unsigned char *); +void cd9660_bothendian_word(uint16_t dw, unsigned char *); void cd9660_set_date(char *, time_t); void cd9660_time_8426(unsigned char *, time_t); void cd9660_time_915(unsigned char *, time_t); Index: usr.sbin/makefs/cd9660.c =================================================================== --- usr.sbin/makefs/cd9660.c +++ usr.sbin/makefs/cd9660.c @@ -882,7 +882,7 @@ * @param const char * The first file name * @param const char * The second file name * @returns : -1 if first is less than second, 0 if they are the same, 1 if - * the second is greater than the first + * the second is greater than the first */ static int cd9660_compare_filename(const char *first, const char *second) @@ -1015,7 +1015,7 @@ for (iter = TAILQ_FIRST(&colliding->cn_children); iter != NULL && (next = TAILQ_NEXT(iter, cn_next_child)) != NULL;) { if (strcmp(iter->isoDirRecord->name, - next->isoDirRecord->name) != 0) { + next->isoDirRecord->name) != 0) { iter = TAILQ_NEXT(iter, cn_next_child); continue; } @@ -1052,7 +1052,7 @@ int numbts, digit, digits, temp, powers, count; char *naming; int maxlength; - char *tmp; + char *tmp; if (diskStructure->verbose_level > 0) printf("Rename_filename called\n"); @@ -1199,7 +1199,7 @@ if ((next = TAILQ_NEXT(cn, cn_next_child)) == NULL) return; else if (strcmp(next->isoDirRecord->name, - cn->isoDirRecord->name) >= 0) + cn->isoDirRecord->name) >= 0) continue; TAILQ_REMOVE(&node->cn_children, next, cn_next_child); TAILQ_INSERT_BEFORE(cn, next, cn_next_child); @@ -1701,7 +1701,7 @@ *newname++ = *oldname; else if (diskStructure->allow_multidot && *oldname == '.') { - *newname++ = '.'; + *newname++ = '.'; } else { *newname++ = '_'; } @@ -1848,7 +1848,7 @@ cd9660_compute_record_size(diskStructure, child); if ((cd9660_compute_record_size(diskStructure, child) + current_sector_usage) >= - diskStructure->sectorSize) { + diskStructure->sectorSize) { current_sector_usage = 0; node->fileSectorsUsed++; } @@ -2078,8 +2078,8 @@ } else if (type == CD9660_TYPE_DOTDOT) { parent->dot_dot_record = temp; /* - * If the first child is the dot record, insert - * this second. Otherwise, insert it at the head. + * If the first child is the dot record, insert + * this second. Otherwise, insert it at the head. */ if ((first = TAILQ_FIRST(&parent->cn_children)) == NULL || (first->type & CD9660_TYPE_DOT) == 0) { Index: usr.sbin/makefs/cd9660/Makefile.inc =================================================================== --- usr.sbin/makefs/cd9660/Makefile.inc +++ usr.sbin/makefs/cd9660/Makefile.inc @@ -1,9 +1,10 @@ # $FreeBSD$ # -.PATH: ${SRCDIR}/cd9660 ${SRCTOP}/sys/fs/cd9660/ +.PATH: ${SRCDIR}/cd9660 ${SRCTOP}/sys/fs/cd9660/ -CFLAGS+=-I${SRCTOP}/sys/fs/cd9660/ +CFLAGS+= -I${SRCTOP}/sys/fs/cd9660/ -SRCS+= cd9660_strings.c cd9660_debug.c cd9660_eltorito.c \ - cd9660_write.c cd9660_conversion.c iso9660_rrip.c cd9660_archimedes.c +SRCS+= cd9660_strings.c cd9660_debug.c cd9660_eltorito.c \ + cd9660_write.c cd9660_conversion.c iso9660_rrip.c \ + cd9660_archimedes.c Index: usr.sbin/makefs/cd9660/cd9660_archimedes.h =================================================================== --- usr.sbin/makefs/cd9660/cd9660_archimedes.h +++ usr.sbin/makefs/cd9660/cd9660_archimedes.h @@ -14,7 +14,7 @@ * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. @@ -37,13 +37,13 @@ unsigned char loadaddr[4]; /* Load address, little-endian */ unsigned char execaddr[4]; /* Exec address, little-endian */ unsigned char ro_attr; /* RISC OS attributes */ -#define RO_ACCESS_UR 0x01 /* Owner read */ -#define RO_ACCESS_UW 0x02 /* Owner write */ -#define RO_ACCESS_L 0x04 /* Locked */ -#define RO_ACCESS_OR 0x10 /* Public read */ -#define RO_ACCESS_OW 0x20 /* Public write */ +#define RO_ACCESS_UR 0x01 /* Owner read */ +#define RO_ACCESS_UW 0x02 /* Owner write */ +#define RO_ACCESS_L 0x04 /* Locked */ +#define RO_ACCESS_OR 0x10 /* Public read */ +#define RO_ACCESS_OW 0x20 /* Public write */ unsigned char cdfs_attr; /* Extra attributes for CDFS */ -#define CDFS_PLING 0x01 /* Filename begins with '!' */ +#define CDFS_PLING 0x01 /* Filename begins with '!' */ char reserved[12]; }; Index: usr.sbin/makefs/cd9660/cd9660_archimedes.c =================================================================== --- usr.sbin/makefs/cd9660/cd9660_archimedes.c +++ usr.sbin/makefs/cd9660/cd9660_archimedes.c @@ -14,7 +14,7 @@ * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. Index: usr.sbin/makefs/cd9660/cd9660_eltorito.h =================================================================== --- usr.sbin/makefs/cd9660/cd9660_eltorito.h +++ usr.sbin/makefs/cd9660/cd9660_eltorito.h @@ -45,14 +45,14 @@ #define ET_BOOT_ENTRY_SIZE 0x20 -#define ET_BOOTABLE 0x88 +#define ET_BOOTABLE 0x88 #define ET_NOT_BOOTABLE 0 #define ET_MEDIA_NOEM 0 -#define ET_MEDIA_12FDD 1 -#define ET_MEDIA_144FDD 2 -#define ET_MEDIA_288FDD 3 -#define ET_MEDIA_HDD 4 +#define ET_MEDIA_12FDD 1 +#define ET_MEDIA_144FDD 2 +#define ET_MEDIA_288FDD 3 +#define ET_MEDIA_HDD 4 #define ET_INDICATOR_HEADERMORE 0x90 #define ET_INDICATOR_HEADERLAST 0x91 @@ -128,7 +128,7 @@ char entry_type; union { boot_catalog_validation_entry VE; - boot_catalog_initial_entry IE; + boot_catalog_initial_entry IE; boot_catalog_section_header SH; boot_catalog_section_entry SE; boot_catalog_section_entry_extension EX; @@ -139,14 +139,14 @@ /* Temporary structure */ struct cd9660_boot_image { - char *filename; - int size; - int sector; /* copied to LoadRBA */ - int num_sectors; - unsigned int loadSegment; - u_char targetMode; - u_char system; - u_char bootable; + char *filename; + int size; + int sector; /* copied to LoadRBA */ + int num_sectors; + unsigned int loadSegment; + u_char targetMode; + u_char system; + u_char bootable; /* * If the boot image exists in the filesystem * already, this is a pointer to that node. For the sake @@ -154,9 +154,9 @@ * to the node in the primary volume. This SHOULD be done * via a hashtable lookup. */ - struct _cd9660node *boot_image_node; + struct _cd9660node *boot_image_node; TAILQ_ENTRY(cd9660_boot_image) image_list; - int serialno; + int serialno; }; Index: usr.sbin/makefs/cd9660/cd9660_eltorito.c =================================================================== --- usr.sbin/makefs/cd9660/cd9660_eltorito.c +++ usr.sbin/makefs/cd9660/cd9660_eltorito.c @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #ifdef DEBUG -#define ELTORITO_DPRINTF(__x) printf __x +#define ELTORITO_DPRINTF(__x) printf __x #else #define ELTORITO_DPRINTF(__x) #endif @@ -100,7 +100,7 @@ else if (strcmp(sysname, "powerpc") == 0) new_image->system = ET_SYS_PPC; else if (strcmp(sysname, "macppc") == 0 || - strcmp(sysname, "mac68k") == 0) + strcmp(sysname, "mac68k") == 0) new_image->system = ET_SYS_MAC; else { warnx("boot disk system must be " @@ -245,7 +245,7 @@ checksum = -checksum; cd9660_721(checksum, ve->checksum); - ELTORITO_DPRINTF(("%s: header_id %d, platform_id %d, key[0] %d, key[1] %d, " + ELTORITO_DPRINTF(("%s: header_id %d, platform_id %d, key[0] %d, key[1] %d, " "checksum %04x\n", __func__, ve->header_id[0], ve->platform_id[0], ve->key[0], ve->key[1], checksum)); return entry; @@ -487,7 +487,7 @@ if (fseeko(fd, (off_t)(idx) * 16 + 0x1be, SEEK_SET) == -1) err(1, "fseeko"); - + val = 0x80; /* Bootable */ fwrite(&val, sizeof(val), 1, fd); @@ -556,13 +556,13 @@ apm32 = 0; /* pmLgDataStart */ - fwrite(&apm32, sizeof(apm32), 1, fd); - /* pmDataCnt */ + fwrite(&apm32, sizeof(apm32), 1, fd); + /* pmDataCnt */ apm32 = htobe32(nsectors); - fwrite(&apm32, sizeof(apm32), 1, fd); + fwrite(&apm32, sizeof(apm32), 1, fd); /* pmPartStatus */ apm32 = htobe32(part_status); - fwrite(&apm32, sizeof(apm32), 1, fd); + fwrite(&apm32, sizeof(apm32), 1, fd); return 0; } @@ -606,9 +606,9 @@ } cd9660_copy_file(diskStructure, fd, t->sector, t->filename); - if (t->system == ET_SYS_MAC) + if (t->system == ET_SYS_MAC) apm_partitions++; - if (t->system == ET_SYS_PPC) + if (t->system == ET_SYS_PPC) mbr_partitions++; } @@ -680,7 +680,7 @@ 512, "CD Boot", "Apple_Bootstrap"); } /* Write ISO9660 descriptor, enclosing the whole disk */ - cd9660_write_apm_partition_entry(fd, 2 + apm_partitions, + cd9660_write_apm_partition_entry(fd, 2 + apm_partitions, total_parts, 0, diskStructure->totalSectors * (diskStructure->sectorSize / 512), 512, "ISO9660", "CD_ROM_Mode_1"); Index: usr.sbin/makefs/cd9660/cd9660_write.c =================================================================== --- usr.sbin/makefs/cd9660/cd9660_write.c +++ usr.sbin/makefs/cd9660/cd9660_write.c @@ -188,7 +188,7 @@ /* round up */ len = temp_entry.length[0] + 8 + (temp_entry.length[0] & 0x01); - /* todo: function pointers instead */ + /* todo: function pointers instead */ if (mode == LITTLE_ENDIAN) { cd9660_731(ptcur->fileDataSector, temp_entry.first_sector); @@ -314,7 +314,7 @@ /* * Now loop over children, writing out their directory * records - beware of sector boundaries - */ + */ TAILQ_FOREACH(temp, &writenode->cn_children, cn_next_child) { /* * Copy the temporary record and adjust its size Index: usr.sbin/makefs/cd9660/iso9660_rrip.h =================================================================== --- usr.sbin/makefs/cd9660/iso9660_rrip.h +++ usr.sbin/makefs/cd9660/iso9660_rrip.h @@ -48,24 +48,24 @@ #include "cd9660.h" #include -#define PX_LENGTH 0x2C -#define PN_LENGTH 0x14 -#define TF_CREATION 0x00 -#define TF_MODIFY 0x01 -#define TF_ACCESS 0x02 -#define TF_ATTRIBUTES 0x04 -#define TF_BACKUP 0x08 -#define TF_EXPIRATION 0x10 -#define TF_EFFECTIVE 0x20 -#define TF_LONGFORM 0x40 -#define NM_CONTINUE 0x80 -#define NM_CURRENT 0x100 -#define NM_PARENT 0x200 - - -#define SUSP_LOC_ENTRY 0x01 -#define SUSP_LOC_DOT 0x02 -#define SUSP_LOC_DOTDOT 0x04 +#define PX_LENGTH 0x2C +#define PN_LENGTH 0x14 +#define TF_CREATION 0x00 +#define TF_MODIFY 0x01 +#define TF_ACCESS 0x02 +#define TF_ATTRIBUTES 0x04 +#define TF_BACKUP 0x08 +#define TF_EXPIRATION 0x10 +#define TF_EFFECTIVE 0x20 +#define TF_LONGFORM 0x40 +#define NM_CONTINUE 0x80 +#define NM_CURRENT 0x100 +#define NM_PARENT 0x200 + + +#define SUSP_LOC_ENTRY 0x01 +#define SUSP_LOC_DOT 0x02 +#define SUSP_LOC_DOTDOT 0x04 #define SUSP_TYPE_SUSP 1 #define SUSP_TYPE_RRIP 2 @@ -87,9 +87,9 @@ #define SUSP_ENTRY_RRIP_TF 8 #define SUSP_ENTRY_RRIP_SF 9 -#define SUSP_RRIP_ER_EXT_ID "IEEE_P1282" -#define SUSP_RRIP_ER_EXT_DES "THE IEEE P1282 PROTOCOL PROVIDES SUPPORT FOR POSIX FILE SYSTEM SEMANTICS." -#define SUSP_RRIP_ER_EXT_SRC "PLEASE CONTACT THE IEEE STANDARDS DEPARTMENT, PISCATAWAY, NJ, USA FOR THE P1282 SPECIFICATION." +#define SUSP_RRIP_ER_EXT_ID "IEEE_P1282" +#define SUSP_RRIP_ER_EXT_DES "THE IEEE P1282 PROTOCOL PROVIDES SUPPORT FOR POSIX FILE SYSTEM SEMANTICS." +#define SUSP_RRIP_ER_EXT_SRC "PLEASE CONTACT THE IEEE STANDARDS DEPARTMENT, PISCATAWAY, NJ, USA FOR THE P1282 SPECIFICATION." #define SL_FLAGS_NONE 0 #define SL_FLAGS_CONTINUE 1 @@ -98,118 +98,119 @@ #define SL_FLAGS_ROOT 8 typedef struct { - ISO_SUSP_HEADER h; - u_char mode [ISODCL(5,12)]; - u_char links [ISODCL(13,20)]; - u_char uid [ISODCL(21,28)]; - u_char gid [ISODCL(29,36)]; - u_char serial [ISODCL(37,44)]; + ISO_SUSP_HEADER h; + u_char mode [ISODCL(5,12)]; + u_char links [ISODCL(13,20)]; + u_char uid [ISODCL(21,28)]; + u_char gid [ISODCL(29,36)]; + u_char serial [ISODCL(37,44)]; } ISO_RRIP_PX; typedef struct { - ISO_SUSP_HEADER h; - u_char high [ISODCL(5,12)]; - u_char low [ISODCL(13,20)]; + ISO_SUSP_HEADER h; + u_char high [ISODCL(5,12)]; + u_char low [ISODCL(13,20)]; } ISO_RRIP_PN; typedef struct { - ISO_SUSP_HEADER h; - u_char flags [ISODCL ( 4, 4)]; - u_char component [ISODCL ( 4, 256)]; - u_int nBytes; + ISO_SUSP_HEADER h; + u_char flags [ISODCL(4,4)]; + u_char component [ISODCL(4,256)]; + u_int nBytes; } ISO_RRIP_SL; typedef struct { - ISO_SUSP_HEADER h; - u_char flags [ISODCL ( 4, 4)]; - u_char timestamp [ISODCL ( 5, 256)]; + ISO_SUSP_HEADER h; + u_char flags [ISODCL(4,4)]; + u_char timestamp [ISODCL(5,256)]; } ISO_RRIP_TF; -#define RRIP_NM_FLAGS_NONE 0x00 -#define RRIP_NM_FLAGS_CONTINUE 0x01 -#define RRIP_NM_FLAGS_CURRENT 0x02 -#define RRIP_NM_FLAGS_PARENT 0x04 +#define RRIP_NM_FLAGS_NONE 0x00 +#define RRIP_NM_FLAGS_CONTINUE 0x01 +#define RRIP_NM_FLAGS_CURRENT 0x02 +#define RRIP_NM_FLAGS_PARENT 0x04 typedef struct { - ISO_SUSP_HEADER h; - u_char flags [ISODCL ( 4, 4)]; - u_char altname [ISODCL ( 4, 256)]; + ISO_SUSP_HEADER h; + u_char flags [ISODCL(4,4)]; + u_char altname [ISODCL(4,256)]; } ISO_RRIP_NM; /* Note that this is the same structure as cd9660_rrip.h : ISO_RRIP_CONT */ typedef struct { - ISO_SUSP_HEADER h; - u_char ca_sector [ISODCL ( 5, 12)]; - u_char offset [ISODCL ( 13, 20)]; - u_char length [ISODCL ( 21, 28)]; + ISO_SUSP_HEADER h; + u_char ca_sector [ISODCL(5,12)]; + u_char offset [ISODCL(13,20)]; + u_char length [ISODCL(21,28)]; } ISO_SUSP_CE; typedef struct { ISO_SUSP_HEADER h; - u_char padding_area [ISODCL ( 4, 256)]; + u_char padding_area [ISODCL(4,256)]; } ISO_SUSP_PD; typedef struct { - ISO_SUSP_HEADER h; - u_char check [ISODCL ( 4, 5)]; - u_char len_skp [ISODCL ( 6, 6)]; + ISO_SUSP_HEADER h; + u_char check [ISODCL(4,5)]; + u_char len_skp [ISODCL(6,6)]; } ISO_SUSP_SP; typedef struct { - ISO_SUSP_HEADER h; + ISO_SUSP_HEADER h; } ISO_SUSP_ST; typedef struct { - ISO_SUSP_HEADER h; - u_char len_id [ISODCL ( 4, 4)]; - u_char len_des [ISODCL ( 5, 5)]; - u_char len_src [ISODCL ( 6, 6)]; - u_char ext_ver [ISODCL ( 7, 7)]; - u_char ext_data [ISODCL (8,256)]; -/* u_char ext_id [ISODCL ( 8, 256)]; - u_char ext_des [ISODCL ( 257, 513)]; - u_char ext_src [ISODCL ( 514, 770)];*/ + ISO_SUSP_HEADER h; + u_char len_id [ISODCL(4,4)]; + u_char len_des [ISODCL(5,5)]; + u_char len_src [ISODCL(6,6)]; + u_char ext_ver [ISODCL(7,7)]; + u_char ext_data [ISODCL(8,256)]; +/* u_char ext_id [ISODCL(8,256)]; + u_char ext_des [ISODCL(257,513)]; + u_char ext_src [ISODCL(514,770)];*/ } ISO_SUSP_ER; typedef struct { - ISO_SUSP_HEADER h; - u_char ext_seq [ISODCL ( 4, 4)]; + ISO_SUSP_HEADER h; + u_char ext_seq [ISODCL(4,4)]; } ISO_SUSP_ES; typedef union { - ISO_RRIP_PX PX; - ISO_RRIP_PN PN; - ISO_RRIP_SL SL; - ISO_RRIP_NM NM; - ISO_RRIP_CLINK CL; - ISO_RRIP_PLINK PL; - ISO_RRIP_RELDIR RE; - ISO_RRIP_TF TF; + ISO_RRIP_PX PX; + ISO_RRIP_PN PN; + ISO_RRIP_SL SL; + ISO_RRIP_NM NM; + ISO_RRIP_CLINK CL; + ISO_RRIP_PLINK PL; + ISO_RRIP_RELDIR RE; + ISO_RRIP_TF TF; } rrip_entry; typedef union { - ISO_SUSP_CE CE; - ISO_SUSP_PD PD; - ISO_SUSP_SP SP; - ISO_SUSP_ST ST; - ISO_SUSP_ER ER; - ISO_SUSP_ES ES; + ISO_SUSP_CE CE; + ISO_SUSP_PD PD; + ISO_SUSP_SP SP; + ISO_SUSP_ST ST; + ISO_SUSP_ER ER; + ISO_SUSP_ES ES; } susp_entry; typedef union { - susp_entry su_entry; - rrip_entry rr_entry; + susp_entry su_entry; + rrip_entry rr_entry; } SUSP_ENTRIES; struct ISO_SUSP_ATTRIBUTES { - SUSP_ENTRIES attr; - int type; - char type_of[2]; - char last_in_suf; /* last entry in the System Use Field? */ + SUSP_ENTRIES attr; + int type; + char type_of[2]; + char last_in_suf; /* last entry in the System Use Field? */ + /* Dan's addons - will merge later. This allows use of a switch */ - char susp_type; /* SUSP or RRIP */ - char entry_type; /* Record type */ - char write_location; + char susp_type; /* SUSP or RRIP */ + char entry_type; /* Record type */ + char write_location; TAILQ_ENTRY(ISO_SUSP_ATTRIBUTES) rr_ll; }; Index: usr.sbin/makefs/cd9660/iso9660_rrip.c =================================================================== --- usr.sbin/makefs/cd9660/iso9660_rrip.c +++ usr.sbin/makefs/cd9660/iso9660_rrip.c @@ -674,7 +674,7 @@ cd9660node_rrip_nm(struct ISO_SUSP_ATTRIBUTES *p, cd9660node *file_node) { int nm_length = strlen(file_node->isoDirRecord->name) + 5; - p->attr.rr_entry.NM.h.type[0] = 'N'; + p->attr.rr_entry.NM.h.type[0] = 'N'; p->attr.rr_entry.NM.h.type[1] = 'M'; sprintf(p->attr.rr_entry.NM.altname, "%s", file_node->isoDirRecord->name); p->attr.rr_entry.NM.h.length[0] = (unsigned char)nm_length; Index: usr.sbin/makefs/ffs.c =================================================================== --- usr.sbin/makefs/ffs.c +++ usr.sbin/makefs/ffs.c @@ -394,11 +394,11 @@ /* add space needed to store inodes, x3 for blockmaps, etc */ if (ffs_opts->version == 1) fsopts->size += ncg * DINODE1_SIZE * - roundup(fsopts->inodes / ncg, + roundup(fsopts->inodes / ncg, ffs_opts->bsize / DINODE1_SIZE); else fsopts->size += ncg * DINODE2_SIZE * - roundup(fsopts->inodes / ncg, + roundup(fsopts->inodes / ncg, ffs_opts->bsize / DINODE2_SIZE); /* add minfree */ @@ -871,7 +871,7 @@ static void ffs_write_file(union dinode *din, uint32_t ino, void *buf, fsinfo_t *fsopts) { - int isfile, ffd; + int isfile, ffd; char *fbuf, *p; off_t bufleft, chunk, offset; ssize_t nread; @@ -970,7 +970,7 @@ if (!isfile) p += chunk; } - + write_inode_and_leave: ffs_write_inode(&in.i_din, in.i_number, fsopts); @@ -1063,7 +1063,7 @@ static void ffs_write_inode(union dinode *dp, uint32_t ino, const fsinfo_t *fsopts) { - char *buf; + char *buf; struct ufs1_dinode *dp1; struct ufs2_dinode *dp2, *dip; struct cg *cgp; @@ -1113,7 +1113,7 @@ if (S_ISDIR(DIP(dp, mode))) { ufs_add32(cgp->cg_cs.cs_ndir, 1, fsopts->needswap); fs->fs_cstotal.cs_ndir++; - fs->fs_cs(fs, cg).cs_ndir++; + fs->fs_cs(fs, cg).cs_ndir++; } /* Index: usr.sbin/makefs/ffs/buf.h =================================================================== --- usr.sbin/makefs/ffs/buf.h +++ usr.sbin/makefs/ffs/buf.h @@ -46,30 +46,30 @@ struct ucred; struct vnode { - int fd; - void *fs; - void *v_data; - int offset; + int fd; + void *fs; + void *v_data; + int offset; }; struct buf { - void * b_data; - long b_bufsize; - long b_bcount; - daddr_t b_blkno; - daddr_t b_lblkno; - int b_fd; - void * b_fs; + void *b_data; + long b_bufsize; + long b_bcount; + daddr_t b_blkno; + daddr_t b_lblkno; + int b_fd; + void *b_fs; - TAILQ_ENTRY(buf) b_tailq; + TAILQ_ENTRY(buf) b_tailq; }; -void bcleanup(void); -int bread(struct vnode *, daddr_t, int, struct ucred *, +void bcleanup(void); +int bread(struct vnode *, daddr_t, int, struct ucred *, struct buf **); -void brelse(struct buf *, int); -int bwrite(struct buf *); -struct buf * getblk(struct vnode *, daddr_t, int, int, int, int); +void brelse(struct buf *, int); +int bwrite(struct buf *); +struct buf *getblk(struct vnode *, daddr_t, int, int, int, int); #define bdwrite(bp) bwrite(bp) #define clrbuf(bp) memset((bp)->b_data, 0, (u_int)(bp)->b_bcount) Index: usr.sbin/makefs/ffs/buf.c =================================================================== --- usr.sbin/makefs/ffs/buf.c +++ usr.sbin/makefs/ffs/buf.c @@ -52,7 +52,7 @@ #include "makefs.h" #include "buf.h" -extern int sectorsize; /* XXX: from ffs.c & mkfs.c */ +extern int sectorsize; /* XXX: from ffs.c & mkfs.c */ static TAILQ_HEAD(buftailhead,buf) buftail; Index: usr.sbin/makefs/ffs/ffs_alloc.c =================================================================== --- usr.sbin/makefs/ffs/ffs_alloc.c +++ usr.sbin/makefs/ffs/ffs_alloc.c @@ -70,7 +70,7 @@ /* * Allocate a block in the file system. - * + * * The size of the requested block is given, which must be some * multiple of fs_fsize and <= fs_bsize. * A preference may be optionally specified. If a preference is given @@ -94,7 +94,7 @@ struct fs *fs = ip->i_fs; daddr_t bno; int cg; - + *bnp = 0; if (size > fs->fs_bsize || fragoff(fs, size) != 0) { errx(1, "ffs_alloc: bad size: bsize %d size %d", @@ -125,7 +125,7 @@ * Select the desired position for the next block in a file. The file is * logically divided into sections. The first section is composed of the * direct blocks. Each additional section contains fs_maxbpg blocks. - * + * * If no blocks have been allocated in the first section, the policy is to * request a block in the same cylinder group as the inode that describes * the file. If no blocks have been allocated in any other section, the @@ -139,7 +139,7 @@ * indirect block, the information on the previous allocation is unavailable; * here a best guess is made based upon the logical block number being * allocated. - * + * * If a section is already partially allocated, the policy is to * contiguously allocate fs_maxcontig blocks. The end of one of these * contiguous blocks and the beginning of the next is physically separated @@ -329,7 +329,7 @@ break; if (allocsiz == fs->fs_frag) { /* - * no fragments were available, so a block will be + * no fragments were available, so a block will be * allocated, and hacked up */ if (cgp->cg_cs.cs_nbfree == 0) { @@ -421,7 +421,7 @@ * Free a block or fragment. * * The specified block or fragment is placed back in the - * free map. If a fragment is deallocated, a possible + * free map. If a fragment is deallocated, a possible * block reassembly is checked. */ void Index: usr.sbin/makefs/ffs/ffs_bswap.c =================================================================== --- usr.sbin/makefs/ffs/ffs_bswap.c +++ usr.sbin/makefs/ffs/ffs_bswap.c @@ -50,9 +50,9 @@ #define fs_old_rotbloff fs_spare5[1] #define fs_old_postbl_start fs_maxbsize #define fs_old_headswitch fs_id[0] -#define fs_old_trkseek fs_id[1] -#define fs_old_csmask fs_spare1[0] -#define fs_old_csshift fs_spare1[1] +#define fs_old_trkseek fs_id[1] +#define fs_old_csmask fs_spare1[0] +#define fs_old_csshift fs_spare1[1] #define FS_42POSTBLFMT -1 /* 4.2BSD rotational table format */ #define FS_DYNAMICPOSTBLFMT 1 /* dynamic rotational table format */ @@ -216,7 +216,7 @@ n->cg_irotor = bswap32(o->cg_irotor); for (i = 0; i < MAXFRAG; i++) n->cg_frsum[i] = bswap32(o->cg_frsum[i]); - + n->cg_old_btotoff = bswap32(o->cg_old_btotoff); n->cg_old_boff = bswap32(o->cg_old_boff); n->cg_iusedoff = bswap32(o->cg_iusedoff); @@ -248,7 +248,7 @@ for (i = 0; i < fs->fs_old_cpg; i++) n32[i] = bswap32(o32[i]); - + for (i = 0; i < fs->fs_old_cpg * fs->fs_old_nrpos; i++) n16[i] = bswap16(o16[i]); Index: usr.sbin/makefs/ffs/ffs_extern.h =================================================================== --- usr.sbin/makefs/ffs/ffs_extern.h +++ usr.sbin/makefs/ffs/ffs_extern.h @@ -50,28 +50,28 @@ _Noreturn void panic(const char *, ...) __printflike(1, 2); /* ffs_alloc.c */ -int ffs_alloc(struct inode *, daddr_t, daddr_t, int, daddr_t *); -daddr_t ffs_blkpref_ufs1(struct inode *, daddr_t, int, int32_t *); -daddr_t ffs_blkpref_ufs2(struct inode *, daddr_t, int, int64_t *); -void ffs_blkfree(struct inode *, daddr_t, long); -void ffs_clusteracct(struct fs *, struct cg *, int32_t, int); +int ffs_alloc(struct inode *, daddr_t, daddr_t, int, daddr_t *); +daddr_t ffs_blkpref_ufs1(struct inode *, daddr_t, int, int32_t *); +daddr_t ffs_blkpref_ufs2(struct inode *, daddr_t, int, int64_t *); +void ffs_blkfree(struct inode *, daddr_t, long); +void ffs_clusteracct(struct fs *, struct cg *, int32_t, int); /* ffs_balloc.c */ -int ffs_balloc(struct inode *, off_t, int, struct buf **); +int ffs_balloc(struct inode *, off_t, int, struct buf **); /* ffs_bswap.c */ -void ffs_sb_swap(struct fs*, struct fs *); -void ffs_dinode1_swap(struct ufs1_dinode *, struct ufs1_dinode *); -void ffs_dinode2_swap(struct ufs2_dinode *, struct ufs2_dinode *); -void ffs_csum_swap(struct csum *, struct csum *, int); -void ffs_cg_swap(struct cg *, struct cg *, struct fs *); +void ffs_sb_swap(struct fs*, struct fs *); +void ffs_dinode1_swap(struct ufs1_dinode *, struct ufs1_dinode *); +void ffs_dinode2_swap(struct ufs2_dinode *, struct ufs2_dinode *); +void ffs_csum_swap(struct csum *, struct csum *, int); +void ffs_cg_swap(struct cg *, struct cg *, struct fs *); /* ffs_subr.c */ -void ffs_fragacct(struct fs *, int, int32_t[], int, int); -int ffs_isblock(struct fs *, u_char *, int32_t); -int ffs_isfreeblock(struct fs *, u_char *, int32_t); -void ffs_clrblock(struct fs *, u_char *, int32_t); -void ffs_setblock(struct fs *, u_char *, int32_t); +void ffs_fragacct(struct fs *, int, int32_t[], int, int); +int ffs_isblock(struct fs *, u_char *, int32_t); +int ffs_isfreeblock(struct fs *, u_char *, int32_t); +void ffs_clrblock(struct fs *, u_char *, int32_t); +void ffs_setblock(struct fs *, u_char *, int32_t); /* ufs_bmap.c */ -int ufs_getlbns(struct inode *, daddr_t, struct indir *, int *); +int ufs_getlbns(struct inode *, daddr_t, struct indir *, int *); Index: usr.sbin/makefs/ffs/ffs_subr.c =================================================================== --- usr.sbin/makefs/ffs/ffs_subr.c +++ usr.sbin/makefs/ffs/ffs_subr.c @@ -43,7 +43,7 @@ #include "ffs/ufs_bswap.h" /* - * Update the frsum fields to reflect addition or deletion + * Update the frsum fields to reflect addition or deletion * of some frags. */ void Index: usr.sbin/makefs/ffs/mkfs.c =================================================================== --- usr.sbin/makefs/ffs/mkfs.c +++ usr.sbin/makefs/ffs/mkfs.c @@ -64,11 +64,11 @@ #include "ffs/newfs_extern.h" #ifndef BBSIZE -#define BBSIZE 8192 /* size of boot area, with label */ +#define BBSIZE 8192 /* size of boot area, with label */ #endif -static void initcg(uint32_t, time_t, const fsinfo_t *); -static int ilog2(int); +static void initcg(uint32_t, time_t, const fsinfo_t *); +static int ilog2(int); static int count_digits(int); @@ -82,35 +82,35 @@ struct fs fs; char pad[SBLOCKSIZE]; } fsun; -#define sblock fsun.fs +#define sblock fsun.fs static union { struct cg cg; char pad[FFS_MAXBSIZE]; } cgun; -#define acg cgun.cg +#define acg cgun.cg static char *iobuf; static int iobufsize; static char writebuf[FFS_MAXBSIZE]; -static int Oflag; /* format as an 4.3BSD file system */ -static int64_t fssize; /* file system size */ -static int sectorsize; /* bytes/sector */ -static int fsize; /* fragment size */ -static int bsize; /* block size */ -static int maxbsize; /* maximum clustering */ -static int maxblkspercg; -static int minfree; /* free space threshold */ -static int opt; /* optimization preference (space or time) */ -static int density; /* number of bytes per inode */ -static int maxcontig; /* max contiguous blocks to allocate */ -static int maxbpg; /* maximum blocks per file in a cyl group */ -static int bbsize; /* boot block size */ -static int sbsize; /* superblock size */ -static int avgfilesize; /* expected average file size */ -static int avgfpdir; /* expected number of files per directory */ +static int Oflag; /* format as an 4.3BSD file system */ +static int64_t fssize; /* file system size */ +static int sectorsize; /* bytes/sector */ +static int fsize; /* fragment size */ +static int bsize; /* block size */ +static int maxbsize; /* maximum clustering */ +static int maxblkspercg; +static int minfree; /* free space threshold */ +static int opt; /* optimization preference (space or time) */ +static int density; /* number of bytes per inode */ +static int maxcontig; /* max contiguous blocks to allocate */ +static int maxbpg; /* maximum blocks per file in a cyl group */ +static int bbsize; /* boot block size */ +static int sbsize; /* superblock size */ +static int avgfilesize; /* expected average file size */ +static int avgfpdir; /* expected number of files per directory */ struct fs * ffs_mkfs(const char *fsys, const fsinfo_t *fsopts, time_t tstamp) @@ -125,21 +125,21 @@ ffs_opt_t *ffs_opts = fsopts->fs_specific; Oflag = ffs_opts->version; - fssize = fsopts->size / fsopts->sectorsize; - sectorsize = fsopts->sectorsize; - fsize = ffs_opts->fsize; - bsize = ffs_opts->bsize; - maxbsize = ffs_opts->maxbsize; - maxblkspercg = ffs_opts->maxblkspercg; - minfree = ffs_opts->minfree; - opt = ffs_opts->optimization; - density = ffs_opts->density; - maxcontig = ffs_opts->maxcontig; - maxbpg = ffs_opts->maxbpg; - avgfilesize = ffs_opts->avgfilesize; - avgfpdir = ffs_opts->avgfpdir; - bbsize = BBSIZE; - sbsize = SBLOCKSIZE; + fssize = fsopts->size / fsopts->sectorsize; + sectorsize = fsopts->sectorsize; + fsize = ffs_opts->fsize; + bsize = ffs_opts->bsize; + maxbsize = ffs_opts->maxbsize; + maxblkspercg = ffs_opts->maxblkspercg; + minfree = ffs_opts->minfree; + opt = ffs_opts->optimization; + density = ffs_opts->density; + maxcontig = ffs_opts->maxcontig; + maxbpg = ffs_opts->maxbpg; + avgfilesize = ffs_opts->avgfilesize; + avgfpdir = ffs_opts->avgfpdir; + bbsize = BBSIZE; + sbsize = SBLOCKSIZE; strlcpy(sblock.fs_volname, ffs_opts->label, sizeof(sblock.fs_volname)); @@ -547,7 +547,7 @@ saveflag = fs->fs_flags & FS_INTERNAL; fs->fs_flags &= ~FS_INTERNAL; - memcpy(writebuf, &sblock, sbsize); + memcpy(writebuf, &sblock, sbsize); if (fsopts->needswap) ffs_sb_swap(fs, (struct fs*)writebuf); ffs_wtfs(fs->fs_sblockloc / sectorsize, sbsize, writebuf, fsopts); Index: usr.sbin/makefs/ffs/ufs_bmap.c =================================================================== --- usr.sbin/makefs/ffs/ufs_bmap.c +++ usr.sbin/makefs/ffs/ufs_bmap.c @@ -84,7 +84,7 @@ assert (bn >= UFS_NDADDR); - /* + /* * Determine the number of levels of indirection. After this loop * is done, blockcnt indicates the number of data blocks possible * at the given level of indirection, and UFS_NIADDR - i is the number @@ -109,7 +109,7 @@ else metalbn = -(-realbn - bn + UFS_NIADDR - i); - /* + /* * At each iteration, off is the offset into the bap array which is * an array of disk addresses at the current level of indirection. * The logical block number and the offset in that block are stored Index: usr.sbin/makefs/ffs/ufs_bswap.h =================================================================== --- usr.sbin/makefs/ffs/ufs_bswap.h +++ usr.sbin/makefs/ffs/ufs_bswap.h @@ -43,9 +43,9 @@ #define UFS_FSNEEDSWAP(fs) ((fs)->fs_flags & FS_SWAPPED) #define UFS_IPNEEDSWAP(ip) UFS_MPNEEDSWAP(ITOV(ip)->v_mount) #else -#define UFS_MPNEEDSWAP(mp) (0) -#define UFS_FSNEEDSWAP(fs) (0) -#define UFS_IPNEEDSWAP(ip) (0) +#define UFS_MPNEEDSWAP(mp) (0) +#define UFS_FSNEEDSWAP(fs) (0) +#define UFS_IPNEEDSWAP(ip) (0) #endif #if !defined(_KERNEL) || defined(FFS_EI) @@ -53,22 +53,22 @@ static __inline u_int16_t ufs_rw16(u_int16_t a, int ns) { - return ((ns) ? bswap16(a) : (a)); + return ((ns) ? bswap16(a) : (a)); } static __inline u_int32_t ufs_rw32(u_int32_t a, int ns) { - return ((ns) ? bswap32(a) : (a)); + return ((ns) ? bswap32(a) : (a)); } static __inline u_int64_t ufs_rw64(u_int64_t a, int ns) { - return ((ns) ? bswap64(a) : (a)); + return ((ns) ? bswap64(a) : (a)); } #else -#define ufs_rw16(a, ns) ((uint16_t)(a)) -#define ufs_rw32(a, ns) ((uint32_t)(a)) -#define ufs_rw64(a, ns) ((uint64_t)(a)) +#define ufs_rw16(a, ns) ((uint16_t)(a)) +#define ufs_rw32(a, ns) ((uint32_t)(a)) +#define ufs_rw64(a, ns) ((uint64_t)(a)) #endif #define ufs_add16(a, b, ns) \ Index: usr.sbin/makefs/ffs/ufs_inode.h =================================================================== --- usr.sbin/makefs/ffs/ufs_inode.h +++ usr.sbin/makefs/ffs/ufs_inode.h @@ -44,7 +44,7 @@ }; struct inode { - ino_t i_number; /* The identity of the inode. */ + ino_t i_number; /* The identity of the inode. */ struct fs *i_fs; /* File system */ union dinode i_din; int i_fd; /* File descriptor */ @@ -93,5 +93,5 @@ #undef DIP #define DIP(ip, field) \ - (((ip)->i_fs->fs_magic == FS_UFS1_MAGIC) ? \ - (ip)->i_ffs1_##field : (ip)->i_ffs2_##field) + (((ip)->i_fs->fs_magic == FS_UFS1_MAGIC) ? \ + (ip)->i_ffs1_##field : (ip)->i_ffs2_##field) Index: usr.sbin/makefs/makefs.h =================================================================== --- usr.sbin/makefs/makefs.h +++ usr.sbin/makefs/makefs.h @@ -48,7 +48,7 @@ * a component of the tree; contains a filename, a pointer to * fsinode, optional symlink name, and tree pointers * - * fsinode - + * fsinode - * equivalent to an inode, containing target file system inode number, * refcount (nlink), and stat buffer * @@ -56,7 +56,7 @@ * * name "." "bin" "netbsd" * type S_IFDIR S_IFDIR S_IFREG - * next > > NULL + * next > > NULL * parent NULL NULL NULL * child NULL v * @@ -79,10 +79,10 @@ }; typedef struct { - uint32_t ino; /* inode number used on target fs */ - uint32_t nlink; /* number of links to this entry */ - enum fi_flags flags; /* flags used by fs specific code */ - struct stat st; /* stat entry */ + uint32_t ino; /* inode number used on target fs */ + uint32_t nlink; /* number of links to this entry */ + enum fi_flags flags; /* flags used by fs specific code */ + struct stat st; /* stat entry */ } fsinode; typedef struct _fsnode { @@ -120,12 +120,12 @@ } opttype_t; typedef struct { - char letter; /* option letter NUL for none */ + char letter; /* option letter NUL for none */ const char *name; /* option name */ void *value; /* where to stuff the value */ - opttype_t type; /* type of entry */ - long long minimum; /* minimum for value */ - long long maximum; /* maximum for value */ + opttype_t type; /* type of entry */ + long long minimum; /* minimum for value */ + long long maximum; /* maximum for value */ const char *desc; /* option description */ } option_t; Index: usr.sbin/makefs/makefs.c =================================================================== --- usr.sbin/makefs/makefs.c +++ usr.sbin/makefs/makefs.c @@ -94,7 +94,7 @@ fstype_t *fstype; fsinfo_t fsoptions; fsnode *root; - int ch, i, len; + int ch, i, len; const char *subtree; const char *specfile; @@ -426,7 +426,7 @@ get_fstype(const char *type) { int i; - + for (i = 0; fstypes[i].type != NULL; i++) if (strcmp(fstypes[i].type, type) == 0) return (&fstypes[i]); Index: usr.sbin/makefs/mtree.c =================================================================== --- usr.sbin/makefs/mtree.c +++ usr.sbin/makefs/mtree.c @@ -59,9 +59,9 @@ struct mtree_fileinfo { SLIST_ENTRY(mtree_fileinfo) next; - FILE *fp; - const char *name; - u_int line; + FILE *fp; + const char *name; + u_int line; }; /* Global state used while parsing. */ @@ -159,7 +159,7 @@ break; rp[++depth] = pnode->name; } - + sb = sbuf_new_auto(); if (sb == NULL) { errno = ENOMEM; @@ -775,9 +775,9 @@ } /* - * Check for hardlinks. If the contents key is used, then the check - * will only trigger if the contents file is a link even if it is used - * by more than one file + * Check for hardlinks. If the contents key is used, then the check + * will only trigger if the contents file is a link even if it is used + * by more than one file */ if (sb.st_nlink > 1) { fsinode *curino; Index: usr.sbin/makefs/walk.c =================================================================== --- usr.sbin/makefs/walk.c +++ usr.sbin/makefs/walk.c @@ -625,7 +625,7 @@ * return pointer to fsinode matching `entry's st_ino & st_dev if it exists, * otherwise add `entry' to table and return NULL */ -/* This was borrowed from du.c and tweaked to keep an fsnode +/* This was borrowed from du.c and tweaked to keep an fsnode * pointer instead. -- dbj@netbsd.org */ fsinode * @@ -644,7 +644,7 @@ */ const uint64_t HTCONST = 11400714819323198485ULL; const int HTBITS = 64; - + /* Never store zero in hashtable */ assert(entry); @@ -679,7 +679,7 @@ tmp *= HTCONST; h = tmp >> (HTBITS - htshift); h2 = 1 | ( tmp >> (HTBITS - (htshift<<1) - 1)); /* must be odd */ - + /* open address hashtable search with double hash probing */ while (htable[h].data) { if ((htable[h].data->st.st_ino == entry->st.st_ino) &&