Commit Graph

321 Commits

Author SHA1 Message Date
dholland 75571afd93 Stick ffs_ in front of the following macros:
fragstoblks()
   blkstofrags()
   fragnum()
   blknum()

to finish the job of distinguishing them from the lfs versions, which
Christos renamed the other day.

I believe this is the last of the overtly ambiguous exported symbols
from ffs... or at least, the last of the ones that conflicted with lfs.
ffs still pollutes the C namespace very broadly (as does ufs) and this
needs quite a bit more cleanup.

XXX: boo on macros with lowercase names. But I'm not tackling that just yet.
2013-06-23 22:03:34 +00:00
dholland e1610ba4cb Stick ffs_, ext2_, chfs_, filecore_, cd9660_, or mfs_ in front of
the following symbols so as to disambiguate fully. (Christos already
did the lfs ones.)

   lblkno
   lblktosize
   lfragtosize
   numfrags
   blkroundup
   fragroundup
2013-06-23 07:28:36 +00:00
dholland 2737439da3 fsbtodb() -> FFS_FSBTODB(), EXT2_FSBTODB(), or MFS_FSBTODB()
dbtofsb() -> FFS_DBTOFSB() or EXT2_DBTOFSB()

(Christos already did the lfs ones a few days back)
2013-06-23 02:06:04 +00:00
dholland de893df3a9 blkoff() -> ffs_blkoff() stragglers 2013-06-19 18:02:21 +00:00
dholland f1333577b5 Rename ambiguous macros:
MAXDIRSIZE -> UFS_MAXDIRSIZE or LFS_MAXDIRSIZE
   NINDIR -> FFS_NINDIR, EXT2_NINDIR, LFS_NINDIR, or MFS_NINDIR
   INOPB -> FFS_INOPB, LFS_INOPB
   INOPF -> FFS_INOPF, LFS_INOPF
   blksize -> ffs_blksize, ext2_blksize, or lfs_blksize
   sblksize -> ffs_blksize

These are not the only ambiguously defined filesystem macros, of
course, there's a pile more. I may not have found all the ambiguous
definitions of blksize(), too, as there are a lot of other things
called 'blksize' in the system.
2013-06-19 17:51:25 +00:00
dholland 5a420c1b9a Stick UFS_ in front of these symbols:
DIRBLKSIZ
   DIRECTSIZ
   DIRSIZ
   OLDDIRFMT
   NEWDIRFMT

Part of PR 47909.
2013-06-09 17:57:08 +00:00
dholland dcd34a91c5 Stuff UFS_ in front of a few of ufs's symbols to reduce namespace
pollution. Specifically:
   ROOTINO -> UFS_ROOTINO
   WINO -> UFS_WINO
   NXADDR -> UFS_NXADDR
   NDADDR -> UFS_NDADDR
   NIADDR -> UFS_NIADDR
   MAXSYMLINKLEN -> UFS_MAXSYMLINKLEN
   MAXSYMLINKLEN_UFS[12] -> UFS[12]_MAXSYMLINKLEN (for consistency)

Sort out ext2fs's misuse of NDADDR and NIADDR; fortunately, these have
the same values in ext2fs and ffs.

No functional change intended.
2013-01-22 09:39:11 +00:00
riastradh ac9a343544 Show pass1 SIGINFO output on stderr like other passes, not on stdout. 2013-01-06 22:06:00 +00:00
dholland 2d1cf01ec8 stdlib.h, not malloc.h 2012-08-26 09:33:18 +00:00
joerg e16a720f89 Don't depend on HAVE_GCC being always defined. 2012-08-10 12:20:10 +00:00
matt cf7ed4c9cc Convert to C89 function definitions 2012-03-20 18:50:30 +00:00
wiz f801d65453 Mention scan_ffs -b.
Based on a patch by Matthew Mondor <mm_lists@pulsar-zone.net> on
tech-userlevel.
Bump date.
2012-03-06 10:30:20 +00:00
nonaka 5295a64fde use FS_UFS[12]_MAGIC_SWAPPED instead of bswap32(FS_UFS[12]_MAGIC). 2012-01-29 00:58:13 +00:00
joerg baa8e84b6f Use __dead 2011-08-29 14:34:58 +00:00
christos 64aae439ac WARNS=4 2011-08-14 12:32:01 +00:00
mrg 75e42fa7da remove most of the remaining HAVE_GCC tests that are always true in
the modern world.
2011-06-20 07:43:56 +00:00
christos 23ffdf5bd3 share more code. 2011-06-09 19:57:50 +00:00
bouyer a3a7248ce7 Fix bad cut'n'paste in copyright. Pointed out by dyoung@ 2011-06-07 14:56:12 +00:00
dholland aae84c3a7c Improve documentation of FFS formats and format levels from PR 32100.
Prompted also by recent discussion on tech-kern. Bump date.
2011-05-14 19:46:10 +00:00
wiz 36fa577686 Re-add -q description that got lost when -x was added.
Sort descriptions.
Bump date.
2011-04-29 10:34:52 +00:00
bouyer 875bb8e6c3 initialise memory allocated for uquot_user_hash & uquot_group_hash.
Pointed out by Nicolas Joly.
2011-03-20 11:41:24 +00:00
bouyer 063f96f3c2 merge the bouyer-quota2 branch. This adds a new on-disk format
to store disk quota usage and limits, integrated with ffs
metadata. Usage is checked by fsck_ffs (no more quotacheck)
and is covered by the WAPBL journal. Enabled with kernel
option QUOTA2 (added where QUOTA was enabled in kernel config files),
turned on with tunefs(8) on a per-filesystem
basis. mount_mfs(8) can also turn quotas on.

See http://mail-index.netbsd.org/tech-kern/2011/02/19/msg010025.html
for details.
2011-03-06 17:08:10 +00:00
njoly 0913e1dac9 Do Skip device checks, which ends up parsing fstab, when working on a
filesystem image with -F option set.
2011-02-06 12:02:59 +00:00
drochner ebb3b30048 minimal ansification/constification 2010-09-12 16:03:39 +00:00
hannken 738a97ca87 Add -x option which allows to run `fsck_msdos -n' on a snapshot of
a live file system.

While here modify snap_open() to accept a character device as its
first arg and remove now unneeded get_snap_device().

Reviewed by: Manuel Bouyer <bouyer@netbsd.org>
2010-04-11 08:23:51 +00:00
mlelstv bc76b1d5b0 When clearing a log on failure, not only ask the kernel to ignore an
existing log but to remove it on next mount.
2010-03-06 11:31:40 +00:00
christos c68c36a514 Centralize time printing and deal with ctime possibly returning NULL. 2010-02-04 23:55:42 +00:00
mlelstv 0aef69272b Skip handling of APPLEUFS_LABEL if it is smaller than a device block.
In particular:

- newfs will not try to erase the label
- fsck_ffs will not try to validate the label

This lets newfs and fsck work on 2048-byte-per-sector media.

Does Apple UFS support such media and how?
2010-01-31 16:04:34 +00:00
christos 36cd9355e9 make this compile again. 2010-01-07 01:39:56 +00:00
christos 87e82597b6 PR/42568: Pedro F. Giffuni: Better signal handling from OpenBSD, but simplified. 2010-01-06 18:12:37 +00:00
bouyer 59e1504d12 Restore changes from 1.86 and 1.87 after commit of 1.88. 2009-09-27 17:13:37 +00:00
bouyer cab6cd67bc Do some basic checks of the WAPBL journal, to abort the boot before the
kernel refuse to mount a filesystem read-write (booting a system
multiuser with critical filesystems read-only is bad):
Add a check_wapbl() which will check some WAPBL values in the superblock,
and try to read the journal via wapbl_replay_start() if there is one.
pfatal() if one of these fail (abort boot if in preen mode,
as "CONTINUE" otherwise). In non-preen mode the bogus journal will
be cleared.
check_wapbl() is always called if the superblock supports WAPBL.
Even if FS_DOWAPBL is not there, there could be flags asking the
kernel to clear or create a log with bogus values which would cause the
kernel refuse to mount the filesystem.
Discussed in
http://mail-index.netbsd.org/tech-kern/2009/08/17/msg005896.html
and followups.
2009-09-13 14:25:28 +00:00
haad f5b48500f1 Add support for DIOCGDISKINFO to disk like device drivers. Change
partutil.c::getdiskinfo to use it to get disk geometry info.
Use DIOCGWEDGEINFO ioctl to get information about partition size, if disk
driver doesn't support it use old DIOCGDINFO. This patch adds support for
wedge like devices(lvm logical volumes, ZFS zvol partitions) to newfs and
other tools.

No objections on tech-userlevel@.
2009-06-05 21:52:31 +00:00
wiz 3932d28101 New sentence, new line. 2009-05-07 08:27:14 +00:00
lukem 51d7a18bc6 Use "FFSv2" instead of "UFS2".
Expand the description of -c.
Xref dumpfs.
2009-05-07 06:54:23 +00:00
lukem ef685eeea9 Enable WARNS=4 by default except for:
dump  dump_lfs  fsck_ffs  fsck_lfs  fsdb  mount_smbfs
	newfs_ext2fs  newfs_lfs  resize_lfs  setkey
2009-04-11 07:58:11 +00:00
lukem 8e2fe69844 fix sign-compare issues 2009-04-11 07:31:21 +00:00
mrg 5c9ab7f6c0 fix a logic error in the previous, as point out by frank kardel. 2009-04-07 05:50:11 +00:00
mrg 1c6ecba9bc don't ignore "fsck -f" when given with "-p" on a wapbl filesystem.
ie, "fsck -fp" actually forces the check in preen mode now.
2009-03-25 03:42:41 +00:00
christos 7b2f022cd6 don't copy the address of a pointer. Noticed by Anon Ymous 2009-02-25 13:52:18 +00:00
joerg 3fbdfc8af9 Reduce internals of WAPBL exposed to the rest of the system. 2008-11-10 20:12:13 +00:00
christos 85db23df23 reallocate the correct amount. From Anon Ymous 2008-10-12 23:26:12 +00:00
wiz af2c2b73f3 Don't use unicode in usage.
Noted by Anon Ymous.
2008-10-12 20:49:43 +00:00
wiz 89cc13767c Sync usage with man page. 2008-10-09 18:38:24 +00:00
christos 59334248e2 Disable userid to username lookups by default. Add a -U flag to perform them.
In single user mode lookups that involve the network might not work and they
slow down fsck.
2008-10-09 16:56:23 +00:00
christos c6070f6f5a Avoid allocating 2 x inospace and use realloc instead. This also saves a
large memcpy.
2008-10-09 15:50:46 +00:00
gdt 4a8ce74d3f Add an explanation of why one would want to use -x/-X, after
discussion with bouyer@.
2008-08-30 15:07:40 +00:00
dogcow fefef6828c Make it compile. (HI BOUYER!) 2008-08-30 14:07:32 +00:00
bouyer a8ac39af81 Add fss(4) snapshot support to fsck_ffs(8) (via -x or -X options, like
dump(8)). This allows fsck_ffs -n to work on a snapshot of a R/W mounted
filesystem, and avoid errors related to filesystem activity.
2008-08-30 10:46:16 +00:00
gmcgarry 3c9a95916d Wrap compiler-specific flags with HAVE_GCC and HAVE_PCC as necessary. Add a few flags for PCC. 2008-08-29 00:02:21 +00:00