OpenBSD CVS

CVS log for src/sbin/newfs/mkfs.c


[BACK] Up to [local] / src / sbin / newfs

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.102 / (download) - annotate - [select for diffs], Tue Jan 9 03:16:00 2024 UTC (4 months, 4 weeks ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, HEAD
Changes since 1.101: +6 -24 lines
Diff to previous 1.101 (colored)

Delete support for FFS filesystems before the in-inode symlink
optimization.  As observed by ali_farzanrad(at)riseup.net, support
for these was broken in the 5.5 release in early 2014 by the time_t
changes.  No one noticed before now, so clearly this isn't something
we need to continue to support; rejecting in ffs_validate() is an
improvement.

Also: simplify DIRSIZ(), drop OLDDIRFMT and NEWDIRFMT, tests of
fs_maxsymlinklen against zero, #ifdef tests of FS_44INODEFMT, and
remove support for newfs -O0, last used in 2016.

ok miod@

Revision 1.101 / (download) - annotate - [select for diffs], Sat Jun 20 07:49:04 2020 UTC (3 years, 11 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.100: +33 -24 lines
Diff to previous 1.100 (colored)

With filesystem having many cylinder groups and many inodes per cg the
ncg * ipg calcualtion can overflow if signed types are used.  Move
to uint32_t for the relevant values. Aligned with FreeBSD changes.
Also make sure newfs refuses to create an fs with more that 2^32-1
inodes.  ok millert@

Revision 1.100 / (download) - annotate - [select for diffs], Thu May 28 15:48:29 2020 UTC (4 years ago) by otto
Branch: MAIN
Changes since 1.99: +6 -6 lines
Diff to previous 1.99 (colored)

Make generation numbers unsigned and fill them using a random number
from the range [1..UINT_MAX] initially.  On inode re-use increment
and on wrap refill from the range [1..UINT_MAX-1] to avoid
assigning UINT_MAX (the original value). Zero still means uninitialized.
ok millert@

Revision 1.99 / (download) - annotate - [select for diffs], Tue May 19 12:48:54 2020 UTC (4 years ago) by sthen
Branch: MAIN
Changes since 1.98: +13 -7 lines
Diff to previous 1.98 (colored)

Copy ownership/permissions from the mountpoint to FFS2 MFS, as already done
for FFS1 MFS. Problem reported by Mark Patruck and Andreas Kusalananda Kahari.
ok otto@

Revision 1.98 / (download) - annotate - [select for diffs], Wed Jul 3 03:24:02 2019 UTC (4 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.97: +2 -2 lines
Diff to previous 1.97 (colored)

snprintf/vsnprintf return < 0 on error, rather than -1.

Revision 1.97 / (download) - annotate - [select for diffs], Thu Sep 1 09:27:06 2016 UTC (7 years, 9 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.96: +6 -2 lines
Diff to previous 1.96 (colored)

Start writing the size of the cylinder group into the (unused) cpg
field of the disklabel. To be used by fsck_ffs(8) to find alternate
superblocks. ok deraadt@ krw@

Revision 1.96 / (download) - annotate - [select for diffs], Thu Mar 17 05:27:10 2016 UTC (8 years, 2 months ago) by bentley
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.95: +7 -5 lines
Diff to previous 1.95 (colored)

Switch (non-curses, non-ksh) programs that use COLUMNS to a single idiom.

Previously behaviors were all over the map. This changes them to
use COLUMNS first, and either terminal width or a hardcoded value
(typically 80) as appropriate.

ok deraadt@; man bits ok jmc@

Revision 1.95 / (download) - annotate - [select for diffs], Thu Jan 28 17:26:10 2016 UTC (8 years, 4 months ago) by gsoares
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.94: +2 -2 lines
Diff to previous 1.94 (colored)

malloc(3) returns a pointer, so check against NULL, not 0. (No functional change)

OK millert@

Revision 1.94 / (download) - annotate - [select for diffs], Mon Nov 23 19:19:30 2015 UTC (8 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.93: +4 -10 lines
Diff to previous 1.93 (colored)

Use pledge "disklabel" as needed.  The theory here is these tools become more
resistant against memory correctup, if a corrupt filesystem is given to them.
ok krw

Revision 1.93 / (download) - annotate - [select for diffs], Sun Oct 11 00:20:29 2015 UTC (8 years, 8 months ago) by guenther
Branch: MAIN
Changes since 1.92: +2 -4 lines
Diff to previous 1.92 (colored)

Prefer dprintf() over snprintf()+write()

ok beck@ deraadt@

Revision 1.92 / (download) - annotate - [select for diffs], Thu Aug 20 22:02:21 2015 UTC (8 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.91: +2 -2 lines
Diff to previous 1.91 (colored)

<stdlib.h> is included, so do not need to cast result from
malloc, calloc, realloc*
ok krw millert

Revision 1.91 / (download) - annotate - [select for diffs], Sat Apr 18 18:28:37 2015 UTC (9 years, 1 month ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.90: +2 -2 lines
Diff to previous 1.90 (colored)

Convert many atoi() calls to strtonum(), adding range checks and failure
handling along the way.
Reviews by Brendan MacDonell, Jeremy Devenport, florian, doug, millert

Revision 1.90 / (download) - annotate - [select for diffs], Fri Feb 6 22:29:00 2015 UTC (9 years, 4 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.89: +4 -3 lines
Diff to previous 1.89 (colored)

Better size_t overflow check for mount_mfs.  OK miod@

Revision 1.89 / (download) - annotate - [select for diffs], Tue Jan 20 18:22:21 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.88: +2 -2 lines
Diff to previous 1.88 (colored)

Adjust <sys/param.h> comments regarding use of use of MAXFRAG, or
delete <sys/param.h> if now possible
ok guenther

Revision 1.88 / (download) - annotate - [select for diffs], Sun Jan 18 04:48:24 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.87: +1 -2 lines
Diff to previous 1.87 (colored)

do not require <a.out.h>

Revision 1.87 / (download) - annotate - [select for diffs], Fri Jan 16 06:40:00 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.86: +13 -8 lines
Diff to previous 1.86 (colored)

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible.  Annotate <sys/param.h> lines with their current reasons.  Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc.  Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution.  These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)

Revision 1.86 / (download) - annotate - [select for diffs], Mon Jun 30 19:19:17 2014 UTC (9 years, 11 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.85: +7 -3 lines
Diff to previous 1.85 (colored)

Use getrlimit(2) instead of assuming MAXDSIZ is available in userland.
ok deraadt@

Revision 1.85 / (download) - annotate - [select for diffs], Fri Jan 24 22:29:21 2014 UTC (10 years, 4 months ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.84: +1 -2 lines
Diff to previous 1.84 (colored)

Don't include <machine/vmparam.h> directly. Instead, get it with its necessary
dependencies via <sys/sysctl.h>. Unbreaks ppc userland build.

Revision 1.84 / (download) - annotate - [select for diffs], Tue Nov 12 04:59:02 2013 UTC (10 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.83: +2 -1 lines
Diff to previous 1.83 (colored)

add a variety of missing prototypes

Revision 1.83 / (download) - annotate - [select for diffs], Sun Nov 3 02:22:07 2013 UTC (10 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.82: +2 -2 lines
Diff to previous 1.82 (colored)

Add missing (long long) cast of variable, (long long) casts
for defines fragnum, fsbtodb, cgsblock, and cgdmin.

Revision 1.82 / (download) - annotate - [select for diffs], Fri Nov 1 17:36:19 2013 UTC (10 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.81: +7 -6 lines
Diff to previous 1.81 (colored)

Sprinkle (long long) casts where %lld is being used to print daddr_t
variables. Some random whitespace/knf repairs encountered on the way.

ok miod@ on inspection, feedback & more suggestions from millert@

Revision 1.81 / (download) - annotate - [select for diffs], Mon Oct 7 21:00:45 2013 UTC (10 years, 8 months ago) by krw
Branch: MAIN
Changes since 1.80: +3 -3 lines
Diff to previous 1.80 (colored)

Say 'fragments' where fragments are meant. Divide by DEV_BSIZE
to convert from bytes to DEV_SIZE.

ok otto@ zhuk@ (for his chunk)

Revision 1.80 / (download) - annotate - [select for diffs], Mon Oct 7 11:51:11 2013 UTC (10 years, 8 months ago) by krw
Branch: MAIN
Changes since 1.79: +3 -2 lines
Diff to previous 1.79 (colored)

Show number of sectors, not the number of 512-byte blocks, when
saying "n sectors of m bytes".

Issue pointed out by David Vasek on misc@. Thanks!

Revision 1.79 / (download) - annotate - [select for diffs], Sun Oct 6 21:50:23 2013 UTC (10 years, 8 months ago) by krw
Branch: MAIN
Changes since 1.78: +3 -3 lines
Diff to previous 1.78 (colored)

daddr_t comment tweak and whitespace fix.

Revision 1.78 / (download) - annotate - [select for diffs], Tue Jun 11 16:42:05 2013 UTC (10 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.77: +12 -12 lines
Diff to previous 1.77 (colored)

final removal of daddr64_t.  daddr_t has been 64 bit for a long enough
test period; i think 3 years ago the last bugs fell out.
ok otto beck others

Revision 1.77 / (download) - annotate - [select for diffs], Tue Apr 23 21:27:38 2013 UTC (11 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.76: +3 -2 lines
Diff to previous 1.76 (colored)

handle large ino_t; ok tedu

Revision 1.76 / (download) - annotate - [select for diffs], Sun Jun 5 15:20:37 2011 UTC (13 years ago) by chl
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.75: +3 -3 lines
Diff to previous 1.75 (colored)

fix format string

ok dcoppa@ otto@
also reviewed by Vadim Zhukov

Revision 1.75 / (download) - annotate - [select for diffs], Mon May 23 10:56:17 2011 UTC (13 years ago) by dcoppa
Branch: MAIN
Changes since 1.74: +4 -4 lines
Diff to previous 1.74 (colored)

Allow specifying k/m/g/... suffixes in newfs(8) -S and -s options.

Useful for mount_mfs, now you can just say:

# mount_mfs -s 50m swap /tmp

And it will do what you want, taking into account sector size.

Old behaviour of -s (specifying count of sectors) is, of course,
preserved.

All the work was done by Vadim Zhukov (persgray(at)gmail com).

OK myself, otto@, thib@

Revision 1.74 / (download) - annotate - [select for diffs], Sun Mar 21 09:13:30 2010 UTC (14 years, 2 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.73: +50 -1 lines
Diff to previous 1.73 (colored)

compute an estimate of how much memory is needed to fsck_ffs the fs
we're about to create and warn the user if this is larger than either
physmem or MAXDSIZ; ok deraadt@ krw@ thib@

Revision 1.73 / (download) - annotate - [select for diffs], Wed Dec 23 02:24:39 2009 UTC (14 years, 5 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.72: +2 -2 lines
Diff to previous 1.72 (colored)

partion -> partition. First one (mkfs.c) noted by Brad Tilley on tech@.

Revision 1.72 / (download) - annotate - [select for diffs], Fri Aug 8 23:49:53 2008 UTC (15 years, 10 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.71: +13 -13 lines
Diff to previous 1.71 (colored)

Admit b_blkno means block number; a block is DEV_BSIZE (a.k.a.
512) bytes; ffs is inextricably tied to using b_blkno and disklabel
always uses sectorsize units.

Thus use DEV_BSIZE units for all fields describing ffs filesystems
and convert to/from sectors where required. This enables the creation
and use of ffs filesystems on non-512 byte sectorsize devices.

This diff allows i386 and sgi (the two test platforms) to find
disklabels that are not on a sectorsize boundary. Same change to
further archs coming.

This is a no-op on 512-byte sectorsize devices.

This work triggered by jsing@'s need to create ffs filesystems on
sgi cdroms so we can create cdrom install media for sgi.

sgi testing by jsing@

ok jsing@ pedro@ "looks sane" beck@ weingart@

Revision 1.71 / (download) - annotate - [select for diffs], Sat Jan 5 19:51:55 2008 UTC (16 years, 5 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.70: +2 -2 lines
Diff to previous 1.70 (colored)

handle 64-bit blkno's in format string

Revision 1.70 / (download) - annotate - [select for diffs], Sat Jul 7 08:16:52 2007 UTC (16 years, 11 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.69: +3 -6 lines
Diff to previous 1.69 (colored)

Initialize the first 2 block's worth of inodes for ffs1 as well as ffs2.
This was not happening since acg.cg_initediblk gets cleared for the
ffs1 case.  OK otto@

Revision 1.69 / (download) - annotate - [select for diffs], Tue Jun 26 19:03:21 2007 UTC (16 years, 11 months ago) by otto
Branch: MAIN
Changes since 1.68: +7 -4 lines
Diff to previous 1.68 (colored)

Enable creation of larger than 1TB FFS2 filesystems. Note that this
won't work yet. There remains sys/ufs work.  ok deraadt@

Revision 1.68 / (download) - annotate - [select for diffs], Sun Jun 10 19:11:43 2007 UTC (17 years ago) by otto
Branch: MAIN
Changes since 1.67: +2 -2 lines
Diff to previous 1.67 (colored)

remove last instances of daddr_t; ok thib@

Revision 1.67 / (download) - annotate - [select for diffs], Fri Jun 1 23:42:35 2007 UTC (17 years ago) by pedro
Branch: MAIN
Changes since 1.66: +3 -3 lines
Diff to previous 1.66 (colored)

ufs1_daddr_t cleanup, okay otto@

Revision 1.66 / (download) - annotate - [select for diffs], Fri Jun 1 23:08:23 2007 UTC (17 years ago) by otto
Branch: MAIN
Changes since 1.65: +10 -10 lines
Diff to previous 1.65 (colored)

daddr64_t changes; not fssize is still an int; ok pedro@

Revision 1.65 / (download) - annotate - [select for diffs], Fri Jun 1 06:41:35 2007 UTC (17 years ago) by deraadt
Branch: MAIN
Changes since 1.64: +4 -4 lines
Diff to previous 1.64 (colored)

convert ufs2_daddr_t -> daddr64_t for greater clarity; ok pedro otto thib

Revision 1.64 / (download) - annotate - [select for diffs], Tue May 29 06:28:16 2007 UTC (17 years ago) by otto
Branch: MAIN
Changes since 1.63: +3 -3 lines
Diff to previous 1.63 (colored)

Updated disklabel format to support larger disks and partitions. We
free room in struct partition by packing fragment size and
fragments/block more tighlty and use the resulting space to make
offset and size 48 bits.  For the disk part we use spare fields in
struct disklabel.  Kernel converts in-mem copy of the on-disk
label if needed, disklabel(8) writes new version.
We are careful to only change fields not used by bootloaders.
Conception of basic scheme by deraadt.
ok deraadt@ krw@

Revision 1.63 / (download) - annotate - [select for diffs], Sat May 19 20:12:50 2007 UTC (17 years ago) by otto
Branch: MAIN
Changes since 1.62: +14 -18 lines
Diff to previous 1.62 (colored)

Now that the amd64 floppy and cd image -c setting have been fixed,
recommit the -c changes. For now, we warn only if we cannot honour -c.
ok millert@ deraadt@

Revision 1.62 / (download) - annotate - [select for diffs], Sat May 19 01:28:15 2007 UTC (17 years ago) by deraadt
Branch: MAIN
Changes since 1.61: +17 -13 lines
Diff to previous 1.61 (colored)

backout -c changes; they were not tested on all the media.  all newfs
changes obviously *MUST* be checked against whatever weird things the
floppies do to fit

Revision 1.61 / (download) - annotate - [select for diffs], Fri May 18 19:08:16 2007 UTC (17 years ago) by otto
Branch: MAIN
Changes since 1.60: +14 -18 lines
Diff to previous 1.60 (colored)

The unit of the -c options is fragments, so adjust man page and
variable name; correct the loop packing more inodes into the cg:
in some cases it could put more fragments into the cg than requested;
give an error if the -c option cannot be honoured. ok millert@ pedro@

Revision 1.60 / (download) - annotate - [select for diffs], Fri May 18 18:57:06 2007 UTC (17 years ago) by otto
Branch: MAIN
Changes since 1.59: +5 -1 lines
Diff to previous 1.59 (colored)

Do a bounds check to see if the inode table fits on the disk.
Prevents a core dump found by djm@ when doing mount_mfs -s 80
(yeah, that's a tiny file system); ok millert@ pedro@

Revision 1.59 / (download) - annotate - [select for diffs], Thu May 3 20:11:55 2007 UTC (17 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.58: +3 -7 lines
Diff to previous 1.58 (colored)

Update CGSIZE macro so that it is no longer based on fs_cpg.
This was part of the ffs2 changes but was not committed earlier in
order to make the userland and kernel changes independent.

NOTE: the change to newfs require an updated fs.h; building an
updated newfs with the old fs.h may result in a broken filesystem.
OK otto@

Revision 1.58 / (download) - annotate - [select for diffs], Mon Apr 23 10:18:30 2007 UTC (17 years, 1 month ago) by pedro
Branch: MAIN
Changes since 1.57: +2 -2 lines
Diff to previous 1.57 (colored)

Remove 'cg_space' from 'struct cg'. Due to the alignment on 64-bit
architectures, CGSIZE() was returning something sligthly over one block.
The 'new' fsck would round this value up to a fragment boundary, and end
up trying to access memory beyond allocated space. From mickey@, okay
pedro@, millert@ and otto@.

Revision 1.57 / (download) - annotate - [select for diffs], Wed Apr 18 14:13:31 2007 UTC (17 years, 1 month ago) by otto
Branch: MAIN
Changes since 1.56: +4 -3 lines
Diff to previous 1.56 (colored)

don't let fpg and spc get out of sync. solves a few cases where newfs
produces a bad cg when -c is used. ok pedro@ millert@

Revision 1.56 / (download) - annotate - [select for diffs], Tue Apr 17 14:24:14 2007 UTC (17 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.55: +2 -1 lines
Diff to previous 1.55 (colored)

Fix merge error; fs_inodefmt was not being set for the ffs2 case

Revision 1.55 / (download) - annotate - [select for diffs], Fri Apr 13 17:33:02 2007 UTC (17 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.54: +584 -555 lines
Diff to previous 1.54 (colored)

Add support for creating ffs2 filesystems.  Note that the concept
of a constant-sized track is obsolete in today's world of variable
blocks per track disks so the cylinder group packing algorithm has
been updated.  Based on the ufs2 changes in FreeBSD by Kirk McKusick.
From pedro@ with changes by me as well as a few from NetBSD.
OK pedro@ beck@ thib@ and tested by more...

Revision 1.54 / (download) - annotate - [select for diffs], Tue Apr 3 18:42:32 2007 UTC (17 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.53: +5 -9 lines
Diff to previous 1.53 (colored)

Remove obsolete options for superblock fields that are no longer used.
OK deraadt @, OK in principle tedu@

Revision 1.53 / (download) - annotate - [select for diffs], Tue Apr 3 17:08:30 2007 UTC (17 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.52: +2 -75 lines
Diff to previous 1.52 (colored)

Minor cleanup: remove rcsids, remove #ifdef'd out code, COMPAT is
the default, quiet gcc.  OK deraadt@

Revision 1.52 / (download) - annotate - [select for diffs], Mon Apr 2 20:20:39 2007 UTC (17 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.51: +3 -4 lines
Diff to previous 1.51 (colored)

Modern disks do bad sector replacement themselves.  There is no
need to reserve space for them in the filesystem itself.
OK deraadt@ pedro@

Revision 1.51 / (download) - annotate - [select for diffs], Mon Mar 19 13:27:47 2007 UTC (17 years, 2 months ago) by pedro
Branch: MAIN
Changes since 1.50: +29 -29 lines
Diff to previous 1.50 (colored)

Add FFS2 fields to the superblock, change file system tools to keep
accessing FFS1 fields, okay art@, quite some testing by ckuethe@, simon@
and thib@, thanks.

Revision 1.50 / (download) - annotate - [select for diffs], Thu Mar 9 13:35:02 2006 UTC (18 years, 3 months ago) by pedro
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.49: +20 -36 lines
Diff to previous 1.49 (colored)

Remove option -n from newfs as well as all references to fs_postbl()
Various testing for a while, okay krw@

Revision 1.49 / (download) - annotate - [select for diffs], Mon Dec 19 15:18:01 2005 UTC (18 years, 5 months ago) by pedro
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.48: +3 -3 lines
Diff to previous 1.48 (colored)

Add and use a few more constants and macros needed by UFS2
No functional change

Revision 1.48 / (download) - annotate - [select for diffs], Mon Aug 8 20:27:22 2005 UTC (18 years, 10 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.47: +3 -3 lines
Diff to previous 1.47 (colored)

More informative error message when trying to create a filesystem
larger than 1TB. ok deraadt@

Revision 1.47 / (download) - annotate - [select for diffs], Thu Apr 14 19:58:32 2005 UTC (19 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.46: +5 -3 lines
Diff to previous 1.46 (colored)

handle snprintf out of range conditions; otto ok

Revision 1.46 / (download) - annotate - [select for diffs], Thu Jan 6 08:57:30 2005 UTC (19 years, 5 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.45: +9 -4 lines
Diff to previous 1.45 (colored)

validate mfs size to avoid wrapping. ok miod@

Revision 1.45 / (download) - annotate - [select for diffs], Thu Oct 14 07:40:29 2004 UTC (19 years, 7 months ago) by otto
Branch: MAIN
Changes since 1.44: +16 -13 lines
Diff to previous 1.44 (colored)

Do not generate either a too large super block or a negative number
of inodes per cylinder group for large block or fragment sizes.
This allows for creation of filesystems with any legal block/fragment
size combination.

ok tedu@.

Revision 1.44 / (download) - annotate - [select for diffs], Fri Sep 10 19:49:15 2004 UTC (19 years, 9 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.43: +11 -7 lines
Diff to previous 1.43 (colored)

Bail out on errors when making very small filesystems. ok deraadt@

Revision 1.43 / (download) - annotate - [select for diffs], Thu Aug 12 07:53:50 2004 UTC (19 years, 10 months ago) by otto
Branch: MAIN
Changes since 1.42: +6 -2 lines
Diff to previous 1.42 (colored)

Prevent core dump on large block sizes by checking block size against
MAXBSIZE.  ok millert@

Revision 1.42 / (download) - annotate - [select for diffs], Tue Jul 6 07:31:59 2004 UTC (19 years, 11 months ago) by otto
Branch: MAIN
Changes since 1.41: +3 -5 lines
Diff to previous 1.41 (colored)

delint: offset arg to mmap is off_t and remove dead code

ok millert@

Revision 1.41 / (download) - annotate - [select for diffs], Sat Jun 26 18:21:35 2004 UTC (19 years, 11 months ago) by otto
Branch: MAIN
Changes since 1.40: +18 -10 lines
Diff to previous 1.40 (colored)

For all the mfs lovers:

- Make the root of an mfs file system inherit the permission and
  owner/group of the mountpoint. Work by david@.
- Add the ability to populate an mfs file system with the contents of a
  directory or a file system immediately after creation, controlled
  by the new -P mount option.

Discussed with and tested by many, ok djm@ david@

Revision 1.40 / (download) - annotate - [select for diffs], Tue Jun 22 01:58:59 2004 UTC (19 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.39: +3 -4 lines
Diff to previous 1.39 (colored)

acg.cg_nextfreeoff is already relative to &acg so don't subtract
&acg.cg_firstfield.  Fixes a bogus "panic: cylinder group too big" I
see sometimes when using mmap malloc.  OK tholo@

Revision 1.39 / (download) - annotate - [select for diffs], Thu May 13 22:36:39 2004 UTC (20 years, 1 month ago) by mickey
Branch: MAIN
Changes since 1.38: +27 -2 lines
Diff to previous 1.38 (colored)

provide a siginfo handler for -q run; idea from art's todo; millert@ ok

Revision 1.38 / (download) - annotate - [select for diffs], Tue Jan 13 01:42:08 2004 UTC (20 years, 5 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.37: +7 -5 lines
Diff to previous 1.37 (colored)

quiet warnings.  better diff suggested by tom@ ok deraadt@

Revision 1.37 / (download) - annotate - [select for diffs], Fri Dec 5 00:40:29 2003 UTC (20 years, 6 months ago) by mickey
Branch: MAIN
Changes since 1.36: +3 -2 lines
Diff to previous 1.36 (colored)

madvise() the mfs storage area as randomly accessed as mfs does it's own clustering; tedu@ ok

Revision 1.36 / (download) - annotate - [select for diffs], Thu Nov 6 08:53:58 2003 UTC (20 years, 7 months ago) by tedu
Branch: MAIN
Changes since 1.35: +7 -2 lines
Diff to previous 1.35 (colored)

don't write magic until the file system is really done.  prevents
fsck/mount unhappiness.  hint from freebsd-arch ml.  ok deraadt@

Revision 1.35 / (download) - annotate - [select for diffs], Mon Nov 3 05:40:09 2003 UTC (20 years, 7 months ago) by tedu
Branch: MAIN
Changes since 1.34: +7 -8 lines
Diff to previous 1.34 (colored)

NULL for NULL pointers, not 0

Revision 1.34 / (download) - annotate - [select for diffs], Mon Nov 3 05:36:27 2003 UTC (20 years, 7 months ago) by tedu
Branch: MAIN
Changes since 1.33: +38 -56 lines
Diff to previous 1.33 (colored)

combine ugly printf(), exit() combo statements into err() or errx().
mostly from tom cosgrove.

Revision 1.33 / (download) - annotate - [select for diffs], Mon Aug 25 23:28:15 2003 UTC (20 years, 9 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.32: +12 -12 lines
Diff to previous 1.32 (colored)

rename struct dinode to ufs1_dinode.  clears the namespace and makes
way for some future work.  no function changes yet.
help testing otto@ and markus@

Revision 1.32 / (download) - annotate - [select for diffs], Wed Jul 16 18:02:35 2003 UTC (20 years, 10 months ago) by tedu
Branch: MAIN
Changes since 1.31: +4 -6 lines
Diff to previous 1.31 (colored)

remove default limit of 16 cylinders per group.  it's now set to
as many as fit with the other parameters given.
change default frag size to 2048, bumping block size to 16k.
from freebsd.

ok deraadt@ and co.

Revision 1.31 / (download) - annotate - [select for diffs], Wed Jul 2 21:44:58 2003 UTC (20 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.30: +3 -4 lines
Diff to previous 1.30 (colored)

missing protos

Revision 1.30 / (download) - annotate - [select for diffs], Wed Jun 25 21:24:10 2003 UTC (20 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.29: +3 -4 lines
Diff to previous 1.29 (colored)

proto repairs

Revision 1.29 / (download) - annotate - [select for diffs], Wed Jun 11 06:22:14 2003 UTC (21 years ago) by deraadt
Branch: MAIN
Changes since 1.28: +14 -41 lines
Diff to previous 1.28 (colored)

ansification

Revision 1.28 / (download) - annotate - [select for diffs], Mon Jun 2 20:06:16 2003 UTC (21 years ago) by millert
Branch: MAIN
Changes since 1.27: +3 -7 lines
Diff to previous 1.27 (colored)

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999.  Proofed by myself and Theo.

Revision 1.27 / (download) - annotate - [select for diffs], Tue May 6 04:32:16 2003 UTC (21 years, 1 month ago) by tedu
Branch: MAIN
Changes since 1.26: +3 -8 lines
Diff to previous 1.26 (colored)

remove FSIRAND define and make it non-optional.  ok millert@

Revision 1.26 / (download) - annotate - [select for diffs], Tue May 6 00:10:40 2003 UTC (21 years, 1 month ago) by tedu
Branch: MAIN
Changes since 1.25: +5 -5 lines
Diff to previous 1.25 (colored)

after switch to mmap, we need to zero other malloc'd data.  use calloc.

Revision 1.25 / (download) - annotate - [select for diffs], Sat May 3 17:21:04 2003 UTC (21 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.24: +7 -89 lines
Diff to previous 1.24 (colored)

The 'memleft' calcuations assume that the data address starts at
0, which is no longer the case.  So instead of the hokey private
malloc() implementation, just use mmap.  From diffs I ran on
anoncvs.usa 4 years ago.

Revision 1.24 / (download) - annotate - [select for diffs], Wed Apr 16 10:33:16 2003 UTC (21 years, 1 month ago) by markus
Branch: MAIN
Changes since 1.23: +2 -39 lines
Diff to previous 1.23 (colored)

fix race between mount(2) and exit(2) for mount_mfs.
from netbsd (drochner, newfs.c 1.30, mkfs.c 1.29, no copyright changes)
ok tedu@

Revision 1.23 / (download) - annotate - [select for diffs], Wed Feb 19 00:57:14 2003 UTC (21 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3
Changes since 1.22: +8 -25 lines
Diff to previous 1.22 (colored)

Use pread/pwrite where sensible; also remove some bogus casts in
printf to long and long long for things that are int32_t.

Revision 1.22 / (download) - annotate - [select for diffs], Sun Jun 9 08:13:08 2002 UTC (22 years ago) by todd
Branch: MAIN
CVS Tags: OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.21: +6 -6 lines
Diff to previous 1.21 (colored)

rm trailing whitespace

Revision 1.21 / (download) - annotate - [select for diffs], Wed May 29 09:19:52 2002 UTC (22 years ago) by deraadt
Branch: MAIN
Changes since 1.20: +3 -3 lines
Diff to previous 1.20 (colored)

more snprintf

Revision 1.20 / (download) - annotate - [select for diffs], Mon Nov 5 07:39:17 2001 UTC (22 years, 7 months ago) by mpech
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.19: +6 -6 lines
Diff to previous 1.19 (colored)

kill more registers;

millert@ ok

Revision 1.19 / (download) - annotate - [select for diffs], Sat Jul 7 18:26:16 2001 UTC (22 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.18: +68 -43 lines
Diff to previous 1.18 (colored)

major -Wall cleanup, almost complete

Revision 1.18 / (download) - annotate - [select for diffs], Thu Apr 19 16:22:17 2001 UTC (23 years, 1 month ago) by gluk
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9
Changes since 1.17: +15 -2 lines
Diff to previous 1.17 (colored)

Cleanup dirpref and synhronize superblock with freebsd.
From FreeBSD with little changes.

art@ ok.

Revision 1.17 / (download) - annotate - [select for diffs], Fri Apr 13 02:39:06 2001 UTC (23 years, 2 months ago) by gluk
Branch: MAIN
Changes since 1.16: +8 -2 lines
Diff to previous 1.16 (colored)

Fix overflow in superblock. From FreeBSD.

FreeBSD's log:
> The ffs superblock includes a 128-byte region for use by temporary
> in-core pointers to summary information. An array in this region
> (fs_csp) could overflow on filesystems with a very large number of
> cylinder groups (~16000 on i386 with 8k blocks). When this happens,
> other fields in the superblock get corrupted, and fsck refuses to
> check the filesystem.
>
> Solve this problem by replacing the fs_csp array in 'struct fs'
> with a single pointer, and add padding to keep the length of the
> 128-byte region fixed. Update the kernel and userland utilities
> to use just this single pointer.
>
> With this change, the kernel no longer makes use of the superblock
> fields 'fs_csshift' and 'fs_csmask'. Add a comment to newfs/mkfs.c
> to indicate that these fields must be calculated for compatibility
> with older kernels.

art@ ok.

Revision 1.16 / (download) - annotate - [select for diffs], Wed Apr 4 22:06:38 2001 UTC (23 years, 2 months ago) by gluk
Branch: MAIN
Changes since 1.15: +2 -6 lines
Diff to previous 1.15 (colored)

bye bye -U (soft updates).

Revision 1.15 / (download) - annotate - [select for diffs], Tue Jan 16 03:05:44 2001 UTC (23 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (colored)

_exit() in signal handler

Revision 1.14 / (download) - annotate - [select for diffs], Fri Sep 22 19:21:30 2000 UTC (23 years, 8 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_8_BASE, OPENBSD_2_8
Changes since 1.13: +14 -2 lines
Diff to previous 1.13 (colored)

If a cylinder group won't fit inside of one block, adjust secpercyl
and ntracks until it does, if possible.  This allows one to newfs
disks with funky (usually BIOS-generated) geometries without cranking
the block size.  This is really just a hack and a better solution
would be to fake the geometries of zone-recorded disks since secpercyl
is never accurate in that case anyway...

Revision 1.13 / (download) - annotate - [select for diffs], Fri Dec 3 19:24:17 1999 UTC (24 years, 6 months ago) by art
Branch: MAIN
CVS Tags: OPENBSD_2_7_BASE, OPENBSD_2_7
Changes since 1.12: +6 -2 lines
Diff to previous 1.12 (colored)

Allow enabling soft updates (with -U) on a new filesystem.
Allow soft updates on mfs filesystems (even if it's stupid).

Revision 1.12 / (download) - annotate - [select for diffs], Sat Apr 10 04:09:23 1999 UTC (25 years, 2 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_6_BASE, OPENBSD_2_6, OPENBSD_2_5_BASE, OPENBSD_2_5
Changes since 1.11: +6 -5 lines
Diff to previous 1.11 (colored)

Add -q flag to newfs and use it in the install

Revision 1.11 / (download) - annotate - [select for diffs], Mon Nov 17 09:14:05 1997 UTC (26 years, 6 months ago) by niklas
Branch: MAIN
CVS Tags: OPENBSD_2_4_BASE, OPENBSD_2_4, OPENBSD_2_3_BASE, OPENBSD_2_3
Changes since 1.10: +5 -3 lines
Diff to previous 1.10 (colored)

Work around a stackframe bug in gcc alpha, who cannot deal with frames > 64k

Revision 1.10 / (download) - annotate - [select for diffs], Tue Jun 3 22:27:17 1997 UTC (27 years ago) by grr
Branch: MAIN
CVS Tags: OPENBSD_2_2_BASE, OPENBSD_2_2
Changes since 1.9: +23 -11 lines
Diff to previous 1.9 (colored)

Make mkfs.c malloc its large buffers, which saves about 200K of bss size
when newfs is used in instbin and is otherwise harmless.  Also add a little
pro-forma malloc fail parnoia, though it's not really needed when the local
malloc routine is used.

Revision 1.9 / (download) - annotate - [select for diffs], Tue Jun 3 11:00:09 1997 UTC (27 years ago) by grr
Branch: MAIN
Changes since 1.8: +4 -4 lines
Diff to previous 1.8 (colored)

number of unallocated sectors message was based on modified fssize, make it deal with reality

Revision 1.8 / (download) - annotate - [select for diffs], Thu May 29 20:22:43 1997 UTC (27 years ago) by deraadt
Branch: MAIN
Changes since 1.7: +8 -8 lines
Diff to previous 1.7 (colored)

mkfs() should not play with fssize; grr, PR#189

Revision 1.7 / (download) - annotate - [select for diffs], Thu Mar 27 17:15:27 1997 UTC (27 years, 2 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_1_BASE, OPENBSD_2_1
Changes since 1.6: +3 -3 lines
Diff to previous 1.6 (colored)

if lost+found generation code is enabled, create it with a nice mode

Revision 1.6 / (download) - annotate - [select for diffs], Sun Feb 23 03:51:23 1997 UTC (27 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.5: +14 -3 lines
Diff to previous 1.5 (colored)

Inline fsirand(8) (at no noticable cost in speed).

Revision 1.5 / (download) - annotate - [select for diffs], Fri Feb 21 22:55:19 1997 UTC (27 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.4: +12 -8 lines
Diff to previous 1.4 (colored)

Don't expose private copies of malloc(), calloc(), free().  Ewwww.

Revision 1.4 / (download) - annotate - [select for diffs], Tue Feb 11 07:01:37 1997 UTC (27 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.3: +4 -7 lines
Diff to previous 1.3 (colored)

Remove occurences of headswitch and trackseek, they no longer
exist in struct fs.

Revision 1.3 / (download) - annotate - [select for diffs], Fri Aug 2 11:00:50 1996 UTC (27 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_0_BASE, OPENBSD_2_0
Changes since 1.2: +38 -5 lines
Diff to previous 1.2 (colored)

proper column management for superblock backups; from freebsd, joerg/satoshi

Revision 1.2 / (download) - annotate - [select for diffs], Sun Jun 23 14:31:46 1996 UTC (27 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.1: +2 -1 lines
Diff to previous 1.1 (colored)

update rcsid

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Wed Oct 18 08:43:42 1995 UTC (28 years, 7 months ago) by deraadt
CVS Tags: netbsd_1_1
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

initial import of NetBSD tree

Revision 1.1 / (download) - annotate - [select for diffs], Wed Oct 18 08:43:42 1995 UTC (28 years, 7 months ago) by deraadt
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.