CVS commit: src/sbin/newfs_v7fs
Module Name:src Committed By: christos Date: Tue Jan 10 20:53:09 UTC 2017 Modified Files: src/sbin/newfs_v7fs: newfs_v7fs.c Log Message: need To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sbin/newfs_v7fs/newfs_v7fs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/newfs_v7fs/newfs_v7fs.c diff -u src/sbin/newfs_v7fs/newfs_v7fs.c:1.4 src/sbin/newfs_v7fs/newfs_v7fs.c:1.5 --- src/sbin/newfs_v7fs/newfs_v7fs.c:1.4 Tue Jun 16 19:18:55 2015 +++ src/sbin/newfs_v7fs/newfs_v7fs.c Tue Jan 10 15:53:09 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: newfs_v7fs.c,v 1.4 2015/06/16 23:18:55 christos Exp $ */ +/* $NetBSD: newfs_v7fs.c,v 1.5 2017/01/10 20:53:09 christos Exp $ */ /*- * Copyright (c) 2004, 2011 The NetBSD Foundation, Inc. @@ -31,19 +31,21 @@ #include #ifndef lint -__RCSID("$NetBSD: newfs_v7fs.c,v 1.4 2015/06/16 23:18:55 christos Exp $"); +__RCSID("$NetBSD: newfs_v7fs.c,v 1.5 2017/01/10 20:53:09 christos Exp $"); #endif /* not lint */ #include #include +#include +#include +#include + #include #include #include #include #include #include -#include -#include #include #include "v7fs_impl.h"
CVS commit: src/sbin/newfs_v7fs
Module Name:src Committed By: sevan Date: Mon Sep 12 05:16:04 UTC 2016 Modified Files: src/sbin/newfs_v7fs: newfs_v7fs.8 Log Message: Document newfs_v7fs appeared in NetBSD 6.0. Add AUTHORS secton. Bump date. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sbin/newfs_v7fs/newfs_v7fs.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/newfs_v7fs/newfs_v7fs.8 diff -u src/sbin/newfs_v7fs/newfs_v7fs.8:1.3 src/sbin/newfs_v7fs/newfs_v7fs.8:1.4 --- src/sbin/newfs_v7fs/newfs_v7fs.8:1.3 Wed Aug 10 11:31:49 2011 +++ src/sbin/newfs_v7fs/newfs_v7fs.8 Mon Sep 12 05:16:04 2016 @@ -1,4 +1,4 @@ -.\" $NetBSD: newfs_v7fs.8,v 1.3 2011/08/10 11:31:49 uch Exp $ +.\" $NetBSD: newfs_v7fs.8,v 1.4 2016/09/12 05:16:04 sevan Exp $ .\" .\" Copyright (c) 2011 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -56,7 +56,7 @@ .\" .\" @(#)newlfs.8 8.1 (Berkeley) 6/19/93 .\" -.Dd April 29, 2011 +.Dd September 12, 2016 .Dt NEWFS_V7FS 8 .Os .Sh NAME @@ -128,3 +128,12 @@ Fill file with zeroes instead of creatin .\" .Xr fs 5 , .Xr disklabel 8 , .Xr diskpart 8 +.Sh HISTORY +A +.Nm +utility appeared in +.Nx 6.0 . +.Sh AUTHORS +.Nm +was written by +.An UCHIYAMA Yasushi Aq Mt u...@netbsd.org .
CVS commit: src/sbin/newfs_v7fs
Module Name:src Committed By: riz Date: Wed Sep 5 23:01:42 UTC 2012 Modified Files: src/sbin/newfs_v7fs: Makefile Log Message: Remove -g from CPPFLAGS. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sbin/newfs_v7fs/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/newfs_v7fs/Makefile diff -u src/sbin/newfs_v7fs/Makefile:1.3 src/sbin/newfs_v7fs/Makefile:1.4 --- src/sbin/newfs_v7fs/Makefile:1.3 Fri Aug 10 12:20:11 2012 +++ src/sbin/newfs_v7fs/Makefile Wed Sep 5 23:01:42 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.3 2012/08/10 12:20:11 joerg Exp $ +# $NetBSD: Makefile,v 1.4 2012/09/05 23:01:42 riz Exp $ .include @@ -13,7 +13,7 @@ FSCK= ${NETBSDSRCDIR}/sbin/fsck DPADD+= ${LIBUTIL} LDADD+= -lutil -CPPFLAGS+=-DV7FS_EI -I${V7FS} -I${FSCK} -g +CPPFLAGS+=-DV7FS_EI -I${V7FS} -I${FSCK} .PATH: ${V7FS} ${FSCK} COPTS.newfs_v7fs.c+= -Wno-pointer-sign
CVS commit: src/sbin/newfs_v7fs
Module Name:src Committed By: wiz Date: Wed Aug 10 12:13:20 UTC 2011 Modified Files: src/sbin/newfs_v7fs: newfs_v7fs.c Log Message: Sync usage with man page. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sbin/newfs_v7fs/newfs_v7fs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/newfs_v7fs/newfs_v7fs.c diff -u src/sbin/newfs_v7fs/newfs_v7fs.c:1.2 src/sbin/newfs_v7fs/newfs_v7fs.c:1.3 --- src/sbin/newfs_v7fs/newfs_v7fs.c:1.2 Wed Aug 10 11:31:49 2011 +++ src/sbin/newfs_v7fs/newfs_v7fs.c Wed Aug 10 12:13:20 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: newfs_v7fs.c,v 1.2 2011/08/10 11:31:49 uch Exp $ */ +/* $NetBSD: newfs_v7fs.c,v 1.3 2011/08/10 12:13:20 wiz Exp $ */ /*- * Copyright (c) 2004, 2011 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: newfs_v7fs.c,v 1.2 2011/08/10 11:31:49 uch Exp $"); +__RCSID("$NetBSD: newfs_v7fs.c,v 1.3 2011/08/10 12:13:20 wiz Exp $"); #endif /* not lint */ #include @@ -233,10 +233,8 @@ usage(void) { - (void)fprintf(stderr, "usage: \n%s [-vP] [-n maxfile]" - " [-B endian] special\n", getprogname()); - (void)fprintf(stderr, "%s -F -s partsize [-vPZ] [-n maxfile]" - " [-B endian] file\n", getprogname()); + (void)fprintf(stderr, "usage: \n%s [-FZ] [-B byte-order]" + " [-n inodes] [-s sectors] [-V verbose] special\n", getprogname()); exit(EXIT_FAILURE); }
CVS commit: src/sbin/newfs_v7fs
Module Name:src Committed By: uch Date: Tue Aug 9 11:18:29 UTC 2011 Modified Files: src/sbin/newfs_v7fs: main.c Log Message: Fix warning message. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sbin/newfs_v7fs/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/newfs_v7fs/main.c diff -u src/sbin/newfs_v7fs/main.c:1.8 src/sbin/newfs_v7fs/main.c:1.9 --- src/sbin/newfs_v7fs/main.c:1.8 Tue Aug 9 09:12:07 2011 +++ src/sbin/newfs_v7fs/main.c Tue Aug 9 11:18:28 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.8 2011/08/09 09:12:07 uch Exp $ */ +/* $NetBSD: main.c,v 1.9 2011/08/09 11:18:28 uch Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.8 2011/08/09 09:12:07 uch Exp $"); +__RCSID("$NetBSD: main.c,v 1.9 2011/08/09 11:18:28 uch Exp $"); #endif /* not lint */ #include @@ -78,7 +78,10 @@ int error; if ((error = v7fs_superblock_load(fs))) { - warnx("Can't read superblock sector."); + if (error != EINVAL) { + /* Invalid superblock information is OK. */ + warnx("Can't read superblock sector."); + } } sb->modified = 1; if ((error = v7fs_superblock_writeback(fs))) {
CVS commit: src/sbin/newfs_v7fs
Module Name:src Committed By: uch Date: Tue Aug 9 09:12:07 UTC 2011 Modified Files: src/sbin/newfs_v7fs: main.c Log Message: Check whether superblock is writable sector. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sbin/newfs_v7fs/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/newfs_v7fs/main.c diff -u src/sbin/newfs_v7fs/main.c:1.7 src/sbin/newfs_v7fs/main.c:1.8 --- src/sbin/newfs_v7fs/main.c:1.7 Fri Jul 22 09:15:10 2011 +++ src/sbin/newfs_v7fs/main.c Tue Aug 9 09:12:07 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.7 2011/07/22 09:15:10 uch Exp $ */ +/* $NetBSD: main.c,v 1.8 2011/08/09 09:12:07 uch Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.7 2011/07/22 09:15:10 uch Exp $"); +__RCSID("$NetBSD: main.c,v 1.8 2011/08/09 09:12:07 uch Exp $"); #endif /* not lint */ #include @@ -72,6 +72,26 @@ } static int +partition_check(struct v7fs_self *fs) +{ + struct v7fs_superblock *sb = &fs->superblock; + int error; + + if ((error = v7fs_superblock_load(fs))) { + warnx("Can't read superblock sector."); + } + sb->modified = 1; + if ((error = v7fs_superblock_writeback(fs))) { + if (errno == EROFS) { + warnx("Overwriting disk label? "); + } + warnx("Can't write superblock sector."); + } + + return error; +} + +static int make_root(struct v7fs_self *fs) { struct v7fs_inode inode; @@ -126,7 +146,7 @@ v7fs_inode_writeback(fs, &inode); if ((error = v7fs_superblock_writeback(fs))) { errno = error; - warn("Can't write superblock."); + warnx("Can't write superblock."); } return error; @@ -272,6 +292,10 @@ fs->endian = mount->endian; v7fs_endian_init(fs); + if ((error = partition_check(fs))) { + return error; + } + /* Construct filesystem. */ if ((error = make_filesystem(fs, volume_size, ilist_size))) { return error;
CVS commit: src/sbin/newfs_v7fs
Module Name:src Committed By: uch Date: Fri Jul 22 09:15:10 UTC 2011 Modified Files: src/sbin/newfs_v7fs: main.c Log Message: Fixed the problem that partition size over 8GiB(v7fs filesystem limit) failed newfs. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sbin/newfs_v7fs/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/newfs_v7fs/main.c diff -u src/sbin/newfs_v7fs/main.c:1.6 src/sbin/newfs_v7fs/main.c:1.7 --- src/sbin/newfs_v7fs/main.c:1.6 Tue Jul 19 19:57:54 2011 +++ src/sbin/newfs_v7fs/main.c Fri Jul 22 09:15:10 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.6 2011/07/19 19:57:54 tron Exp $ */ +/* $NetBSD: main.c,v 1.7 2011/07/22 09:15:10 uch Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.6 2011/07/19 19:57:54 tron Exp $"); +__RCSID("$NetBSD: main.c,v 1.7 2011/07/22 09:15:10 uch Exp $"); #endif /* not lint */ #include @@ -252,8 +252,11 @@ v7fs_daddr_t volume_size = mount->sectors; /* Check and determine ilistblock, datablock size. */ - if (volume_size > V7FS_DADDR_MAX + 1) - return ENOSPC; + if (volume_size > V7FS_DADDR_MAX + 1) { + warnx("volume size %d over v7fs limit %d. truncated.", + volume_size, V7FS_DADDR_MAX + 1); + volume_size = V7FS_DADDR_MAX + 1; + } ilist_size = determine_ilist_size(volume_size, maxfile);
CVS commit: src/sbin/newfs_v7fs
Module Name:src Committed By: tron Date: Tue Jul 19 19:57:54 UTC 2011 Modified Files: src/sbin/newfs_v7fs: main.c Log Message: Use howmany() macro as it is used in a lot fo places in this tool anyway as suggested by Tsugutomo Enami. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sbin/newfs_v7fs/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/newfs_v7fs/main.c diff -u src/sbin/newfs_v7fs/main.c:1.5 src/sbin/newfs_v7fs/main.c:1.6 --- src/sbin/newfs_v7fs/main.c:1.5 Tue Jul 19 18:29:41 2011 +++ src/sbin/newfs_v7fs/main.c Tue Jul 19 19:57:54 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.5 2011/07/19 18:29:41 joerg Exp $ */ +/* $NetBSD: main.c,v 1.6 2011/07/19 19:57:54 tron Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.5 2011/07/19 18:29:41 joerg Exp $"); +__RCSID("$NetBSD: main.c,v 1.6 2011/07/19 19:57:54 tron Exp $"); #endif /* not lint */ #include @@ -62,8 +62,7 @@ v7fs_daddr_t ilist_size; if (files) - ilist_size = (files + V7FS_INODE_PER_BLOCK - 1) / - V7FS_INODE_PER_BLOCK; + ilist_size = howmany(files, V7FS_INODE_PER_BLOCK); else ilist_size = volume_size / 25; /* 4% */ if (ilist_size > (v7fs_daddr_t)V7FS_ILISTBLK_MAX)
CVS commit: src/sbin/newfs_v7fs
Module Name:src Committed By: tron Date: Mon Jul 18 22:50:28 UTC 2011 Modified Files: src/sbin/newfs_v7fs: main.c Log Message: Don't use roundup2(9) (which should have been howmany(9) anyway) to fix builds on platforms other than NetBSD. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sbin/newfs_v7fs/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/newfs_v7fs/main.c diff -u src/sbin/newfs_v7fs/main.c:1.3 src/sbin/newfs_v7fs/main.c:1.4 --- src/sbin/newfs_v7fs/main.c:1.3 Mon Jul 18 21:51:49 2011 +++ src/sbin/newfs_v7fs/main.c Mon Jul 18 22:50:28 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.3 2011/07/18 21:51:49 apb Exp $ */ +/* $NetBSD: main.c,v 1.4 2011/07/18 22:50:28 tron Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.3 2011/07/18 21:51:49 apb Exp $"); +__RCSID("$NetBSD: main.c,v 1.4 2011/07/18 22:50:28 tron Exp $"); #endif /* not lint */ #include @@ -62,7 +62,7 @@ v7fs_daddr_t ilist_size; if (files) - ilist_size = roundup2(files, V7FS_INODE_PER_BLOCK) / + ilist_size = (files + V7FS_INODE_PER_BLOCK - 1) / V7FS_INODE_PER_BLOCK; else ilist_size = volume_size / 25; /* 4% */
CVS commit: src/sbin/newfs_v7fs
Module Name:src Committed By: uch Date: Sun Jul 10 12:14:01 UTC 2011 Modified Files: src/sbin/newfs_v7fs: main.c Log Message: fix freeblock count bug. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sbin/newfs_v7fs/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/newfs_v7fs/main.c diff -u src/sbin/newfs_v7fs/main.c:1.1 src/sbin/newfs_v7fs/main.c:1.2 --- src/sbin/newfs_v7fs/main.c:1.1 Mon Jun 27 11:52:58 2011 +++ src/sbin/newfs_v7fs/main.c Sun Jul 10 12:14:01 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.1 2011/06/27 11:52:58 uch Exp $ */ +/* $NetBSD: main.c,v 1.2 2011/07/10 12:14:01 uch Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.1 2011/06/27 11:52:58 uch Exp $"); +__RCSID("$NetBSD: main.c,v 1.2 2011/07/10 12:14:01 uch Exp $"); #endif /* not lint */ #include @@ -146,11 +146,11 @@ { VPRINTF("\nlast freeblock #%d\n", (*val32)(fb->freeblock[i + 1])); - fb->nfreeblock = (*val16)(k); memmove(fb->freeblock + 1, fb->freeblock + i + 1, k * sizeof(v7fs_daddr_t)); fb->freeblock[0] = 0; /* Terminate link; */ + fb->nfreeblock = (*val16)(k + 1); VPRINTF("last freeblock contains #%d\n", (*val16)(fb->nfreeblock)); fs->io.write(fs->io.cookie, buf, listblk); @@ -211,7 +211,8 @@ for (i = V7FS_MAX_FREEBLOCK - 1, j = sb->datablock_start_sector; i >= 0; i--, j++) sb->freeblock[i] = j; - sb->total_freeblock = volume_size - sb->datablock_start_sector - 1; + + sb->total_freeblock = volume_size - sb->datablock_start_sector; /* Write superblock. */ sb->modified = 1;