diff -u sbin/growfs/growfs.c sbin/growfs.edit/growfs.c --- sbin/growfs/growfs.c Sun Jan 16 09:37:30 2005 +++ sbin/growfs.edit/growfs.c Fri May 25 07:25:32 2007 @@ -87,7 +87,7 @@ /* * Possible superblock locations ordered from most to least likely. */ -static int sblock_try[] = SBLOCKSEARCH; +static intmax_t sblock_try[] = SBLOCKSEARCH; static ufs2_daddr_t sblockloc; static union { @@ -156,7 +156,7 @@ static void updrefs(int, ino_t, struct gfs_bpp *, int, int, unsigned int); static void indirchk(ufs_lbn_t, ufs_lbn_t, ufs2_daddr_t, ufs_lbn_t, struct gfs_bpp *, int, int, unsigned int); -static void get_dev_size(int, int *); +static void get_dev_size(int, u_int64_t *); /* ************************************************************ growfs ***** */ /* @@ -1916,7 +1915,7 @@ * e.g. from vinum volumes. */ static void -get_dev_size(int fd, int *size) +get_dev_size(int fd, u_int64_t *size) { int sectorsize; off_t mediasize; @@ -1961,7 +1960,7 @@ DBG_FUNC("main") char *device, *special, *cp; int ch; - unsigned int size=0; + u_int64_t size=0; size_t len; unsigned int Nflag=0; int ExpertFlag=0; @@ -1969,7 +1968,7 @@ struct disklabel *lp; struct partition *pp; int i,fsi,fso; - u_int32_t p_size; + u_int64_t p_size; char reply[5]; #ifdef FSMAXSNAP int j; @@ -2120,7 +2119,7 @@ sblock.fs_size = dbtofsb(&osblock, p_size); if (size != 0) { if (size > p_size){ - errx(1, "there is not enough space (%d < %d)", + errx(1, "there is not enough space (%jX < %jX)", p_size, size); } sblock.fs_size = dbtofsb(&osblock, size); @@ -2208,7 +2207,7 @@ sblock.fs_old_ncyl = sblock.fs_ncg * sblock.fs_old_cpg; printf("Warning: %jd sector(s) cannot be allocated.\n", (intmax_t)fsbtodb(&sblock, sblock.fs_size % sblock.fs_fpg)); - sblock.fs_size = sblock.fs_ncg * sblock.fs_fpg; + sblock.fs_size = ((int64_t)sblock.fs_ncg) * sblock.fs_fpg; } /* @@ -2219,7 +2218,8 @@ fragroundup(&sblock, sblock.fs_ncg * sizeof(struct csum)); if(osblock.fs_size >= sblock.fs_size) { - errx(1, "not enough new space"); + errx(1, "not enough new space (II) (%jd->%jd)", + (intmax_t)osblock.fs_size, (intmax_t)sblock.fs_size); } DBG_PRINT0("sblock calculated\n");