From 8515af8eea9ffb6998d2f4b8fd37b1f4e5a55a74 Mon Sep 17 00:00:00 2001 From: schweikh Date: Sat, 26 Apr 2003 15:22:29 +0000 Subject: Fix typos in comments; some style(9) fixes; no code changes. PR: misc/50979 Submitted by: Lukas Ertl --- sbin/growfs/growfs.c | 238 +++++++++++++++++++++++++-------------------------- 1 file changed, 117 insertions(+), 121 deletions(-) (limited to 'sbin/growfs') diff --git a/sbin/growfs/growfs.c b/sbin/growfs/growfs.c index 3deb47b..0374387 100644 --- a/sbin/growfs/growfs.c +++ b/sbin/growfs/growfs.c @@ -2,10 +2,10 @@ * Copyright (c) 2000 Christoph Herrmann, Thomas-Henning von Kamptz * Copyright (c) 1980, 1989, 1993 The Regents of the University of California. * All rights reserved. - * + * * This code is derived from software contributed to Berkeley by * Christoph Herrmann and Thomas-Henning von Kamptz, Munich and Frankfurt. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -22,7 +22,7 @@ * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -112,7 +112,7 @@ static char inobuf[MAXBSIZE]; /* inode block */ static int maxino; /* last valid inode */ /* - * An array of elements of type struct gfs_bpp describes all blocks to + * An array of elements of type struct gfs_bpp describes all blocks to * be relocated in order to free the space needed for the cylinder group * summary for all cylinder groups located in the first cylinder group. */ @@ -151,13 +151,13 @@ static void indirchk(ufs_lbn_t, ufs_lbn_t, ufs2_daddr_t, ufs_lbn_t, /* ************************************************************ growfs ***** */ /* - * Here we actually start growing the file system. We basically read the - * cylinder summary from the first cylinder group as we want to update - * this on the fly during our various operations. First we handle the + * Here we actually start growing the file system. We basically read the + * cylinder summary from the first cylinder group as we want to update + * this on the fly during our various operations. First we handle the * changes in the former last cylinder group. Afterwards we create all new - * cylinder groups. Now we handle the cylinder group containing the - * cylinder summary which might result in a relocation of the whole - * structure. In the end we write back the updated cylinder summary, the + * cylinder groups. Now we handle the cylinder group containing the + * cylinder summary which might result in a relocation of the whole + * structure. In the end we write back the updated cylinder summary, the * new superblock, and slightly patched versions of the super block * copies. */ @@ -317,7 +317,7 @@ growfs(int fsi, int fso, unsigned int Nflag) /* * XXX - * The following fields are currently distributed from the superblock + * The following fields are currently distributed from the superblock * to the copies: * fs_minfree * fs_rotdelay @@ -329,10 +329,10 @@ growfs(int fsi, int fso, unsigned int Nflag) * * We probably should rather change the summary for the cylinder group * statistics here to the value of what would be in there, if the file - * system were created initially with the new size. Therefor we still + * system were created initially with the new size. Therefor we still * need to find an easy way of calculating that. * Possibly we can try to read the first superblock copy and apply the - * "diffed" stats between the old and new superblock by still copying + * "diffed" stats between the old and new superblock by still copying * certain parameters onto that. */ @@ -353,9 +353,9 @@ growfs(int fsi, int fso, unsigned int Nflag) /* ************************************************************ initcg ***** */ /* - * This creates a new cylinder group structure, for more details please see - * the source of newfs(8), as this function is taken over almost unchanged. - * As this is never called for the first cylinder group, the special + * This creates a new cylinder group structure, for more details please see + * the source of newfs(8), as this function is taken over almost unchanged. + * As this is never called for the first cylinder group, the special * provisions for that case are removed here. */ static void @@ -535,9 +535,9 @@ initcg(int cylno, time_t utime, int fso, unsigned int Nflag) /* ******************************************************* frag_adjust ***** */ /* - * Here we add or subtract (sign +1/-1) the available fragments in a given + * Here we add or subtract (sign +1/-1) the available fragments in a given * block to or from the fragment statistics. By subtracting before and adding - * after an operation on the free frag map we can easy update the fragment + * after an operation on the free frag map we can easy update the fragment * statistic, which seems to be otherwise a rather complex operation. */ static void @@ -554,11 +554,11 @@ frag_adjust(ufs2_daddr_t frag, int sign) * Here frag only needs to point to any fragment in the block we want * to examine. */ - for(f=rounddown(frag, sblock.fs_frag); + for(f=rounddown(frag, sblock.fs_frag); f0||*/ cs->cs_nbfree < blocks) { /* - * There is not enough space in the old cylinder group to - * relocate all blocks as needed, so we relocate the whole - * cylinder group summary to a new group. We try to use the + * There is not enough space in the old cylinder group to + * relocate all blocks as needed, so we relocate the whole + * cylinder group summary to a new group. We try to use the * first complete new cylinder group just created. Within the - * cylinder group we allign the area immediately after the - * cylinder group information location in order to be as + * cylinder group we align the area immediately after the + * cylinder group information location in order to be as * close as possible to the original implementation of ffs. * - * First we have to make sure we'll find enough space in the - * new cylinder group. If not, then we currently give up. - * We start with freeing everything which was used by the + * First we have to make sure we'll find enough space in the + * new cylinder group. If not, then we currently give up. + * We start with freeing everything which was used by the * fragments of the old cylinder summary in the current group. - * Now we write back the group meta data, read in the needed + * Now we write back the group meta data, read in the needed * meta data from the new cylinder group, and start allocating - * within that group. Here we can assume, the group to be + * within that group. Here we can assume, the group to be * completely empty. Which makes the handling of fragments and * clusters a lot easier. */ @@ -1009,7 +1009,7 @@ updcsloc(time_t utime, int fsi, int fso, unsigned int Nflag) /* * Set up last cluster size ("lcs") already here. Calculate - * the size for the trailing cluster just behind where "d" + * the size for the trailing cluster just behind where "d" * points to. */ if(sblock.fs_contigsumsize > 0) { @@ -1044,16 +1044,15 @@ updcsloc(time_t utime, int fsi, int fso, unsigned int Nflag) sblock.fs_cstotal.cs_nffree++; } /* - * Point "d" to the last fragment of the last - * (incomplete) block of the clinder summary. + * Point "d" to the last fragment of the last + * (incomplete) block of the cylinder summary. */ d++; frag_adjust(d%sblock.fs_fpg, 1); if(isblock(&sblock, cg_blksfree(&acg), (d%sblock.fs_fpg)/sblock.fs_frag)) { - DBG_PRINT1("d=%d\n", - d); + DBG_PRINT1("d=%d\n", d); acg.cg_cs.cs_nffree-=sblock.fs_frag; acg.cg_cs.cs_nbfree++; sblock.fs_cstotal.cs_nffree-=sblock.fs_frag; @@ -1078,13 +1077,11 @@ updcsloc(time_t utime, int fsi, int fso, unsigned int Nflag) d--; } - DBG_PRINT1("d=%d\n", - d); + DBG_PRINT1("d=%d\n", d); for(d=rounddown(d, sblock.fs_frag); d >= osblock.fs_csaddr; d-=sblock.fs_frag) { DBG_TRC; - DBG_PRINT1("d=%d\n", - d); + DBG_PRINT1("d=%d\n", d); setblock(&sblock, cg_blksfree(&acg), (d%sblock.fs_fpg)/sblock.fs_frag); acg.cg_cs.cs_nbfree++; @@ -1191,7 +1188,7 @@ updcsloc(time_t utime, int fsi, int fso, unsigned int Nflag) frag_adjust(d%sblock.fs_fpg, +1); } /* - * XXX Handle the cluster statistics here in the case this + * XXX Handle the cluster statistics here in the case this * cylinder group is now almost full, and the remaining * space is less then the maximum cluster size. This is * probably not needed, as you would hardly find a file @@ -1221,7 +1218,7 @@ updcsloc(time_t utime, int fsi, int fso, unsigned int Nflag) } /* * We have got enough of space in the current cylinder group, so we - * can relocate just a few blocks, and let the summary information + * can relocate just a few blocks, and let the summary information * grow in place where it is right now. */ DBG_TRC; @@ -1246,11 +1243,11 @@ updcsloc(time_t utime, int fsi, int fso, unsigned int Nflag) sizeof(struct gfs_bpp)); /* - * Lock all new frags needed for the cylinder group summary. This is - * done per fragment in the first and last block of the new required + * Lock all new frags needed for the cylinder group summary. This is + * done per fragment in the first and last block of the new required * area, and per block for all other blocks. * - * Handle the first new block here (but only if some fragments where + * Handle the first new block here (but only if some fragments where * already used for the cylinder summary). */ ind=0; @@ -1274,7 +1271,7 @@ updcsloc(time_t utime, int fsi, int fso, unsigned int Nflag) } /* * No cluster handling is needed here, as there was at least - * one fragment in use by the cylinder summary in the old + * one fragment in use by the cylinder summary in the old * file system. * No block-free counter handling here as this block was not * a free block. @@ -1380,7 +1377,7 @@ updcsloc(time_t utime, int fsi, int fso, unsigned int Nflag) if(!bp[i].old) { /* no more blocks listed */ /* * XXX A relative blocknumber should not be - * zero, which is not explicitly + * zero, which is not explicitly * guaranteed by our code. */ break; @@ -1407,11 +1404,11 @@ updcsloc(time_t utime, int fsi, int fso, unsigned int Nflag) } /* - * Special handling is required if this was the first + * Special handling is required if this was the first * block. We have to consider the fragments which were - * used by the cylinder summary in the original block - * which re to be free in the copy of our block. We - * have to be careful if this first block happens to + * used by the cylinder summary in the original block + * which re to be free in the copy of our block. We + * have to be careful if this first block happens to * be also the last block to be relocated. */ if(bp[i].flags & GFS_FL_FIRST) { @@ -1426,7 +1423,6 @@ updcsloc(time_t utime, int fsi, int fso, unsigned int Nflag) if(!(bp[i].flags & GFS_FL_LAST)) { frag_adjust(bp[i].new*sblock.fs_frag,1); } - } /* @@ -1449,7 +1445,7 @@ updcsloc(time_t utime, int fsi, int fso, unsigned int Nflag) } /* - * !!! Attach the cylindergroup offset here. + * !!! Attach the cylindergroup offset here. */ bp[i].old+=cbase/sblock.fs_frag; bp[i].new+=cbase/sblock.fs_frag; @@ -1476,8 +1472,8 @@ updcsloc(time_t utime, int fsi, int fso, unsigned int Nflag) /* * Now we have to update all references to any fragment which - * belongs to any block relocated. We iterate now over all - * cylinder groups, within those over all non zero length + * belongs to any block relocated. We iterate now over all + * cylinder groups, within those over all non zero length * inodes. */ for(cylno=0; cylnop_size < 1) { errx(1, "partition is unavailable"); @@ -2073,7 +2069,7 @@ main(int argc, char **argv) errx(1, "There is not enough space (%d < %d)", pp->p_size, size); } - sblock.fs_size = dbtofsb(&osblock, size); + sblock.fs_size = dbtofsb(&osblock, size); } /* @@ -2111,7 +2107,7 @@ main(int argc, char **argv) if (strcmp(reply, "Yes\n")){ printf("\n Nothing done \n"); exit (0); - } + } } printf("new file systemsize is: %d frags\n", sblock.fs_size); @@ -2167,7 +2163,7 @@ main(int argc, char **argv) */ sblock.fs_cssize = fragroundup(&sblock, sblock.fs_ncg * sizeof(struct csum)); - + if(osblock.fs_size >= sblock.fs_size) { errx(1, "not enough new space"); } @@ -2269,7 +2265,7 @@ get_disklabel(int fd) */ static void usage(void) -{ +{ DBG_FUNC("usage") DBG_ENTER; @@ -2282,12 +2278,12 @@ usage(void) /* *********************************************************** updclst ***** */ /* - * This updates most paramters and the bitmap related to cluster. We have to - * assume, that sblock, osblock, acg are set up. + * This updates most parameters and the bitmap related to cluster. We have to + * assume that sblock, osblock, acg are set up. */ static void updclst(int block) -{ +{ DBG_FUNC("updclst") static int lcs=0; @@ -2313,7 +2309,7 @@ updclst(int block) break; } } - } + } if(lcs < sblock.fs_contigsumsize) { if(lcs) { cg_clustersum(&acg)[lcs]--; @@ -2335,7 +2331,7 @@ updclst(int block) static void updrefs(int cg, ino_t in, struct gfs_bpp *bp, int fsi, int fso, unsigned int Nflag) -{ +{ DBG_FUNC("updrefs") ufs_lbn_t len, lbn, numblks; ufs2_daddr_t iptr, blksperindir; -- cgit v1.1