Commit Graph

54 Commits

Author SHA1 Message Date
drochner
628f1591c1 include <signal.h> where signal(3) is used 2007-02-08 21:36:58 +00:00
christos
3401a36160 Coverity CID 2074: Fix memory leak. 2006-03-20 01:30:34 +00:00
tron
1dbccd015b Use FFS_MAXNAMLEN instead of MAXNAMLEN. 2005-08-23 11:10:23 +00:00
christos
c4ee9f6d2e 64 bit inode changes 2005-08-19 02:07:18 +00:00
christos
c236bddb0f sprinkle const. 2005-06-27 01:25:35 +00:00
xtraeme
e3c8f73b9a whitespace (pointed out by wiz@) 2005-01-20 15:29:40 +00:00
xtraeme
52781d1897 Kill __P(), ANSIfy and WARNS=2 2005-01-19 17:33:58 +00:00
mycroft
b98bb8c608 Use pread()/pwrite(). 2004-06-12 01:35:46 +00:00
dbj
069e170f1c fix range error when swapping postbl for compatibility 2004-04-13 22:36:36 +00:00
dbj
d3ee830d65 terminate preen message from previous with \n 2004-01-15 14:52:04 +00:00
dbj
e23f416c6b if the user specifies both -b and -p, then just go ahead and update
the primary superblock.
2004-01-15 14:49:28 +00:00
dbj
753116e06f do not upgrade superblock or set FS_FLAGS_UPDATED unless -c 4 option
is provided.
add compatibility for filesystems before FFSv2 integration
these patches are from pr port-macppc/23925 and should also
fix problems discussed in pr kern/21404 and pr kern/21283
2004-01-09 19:12:31 +00:00
dbj
16c34ed5bc fix minor bug in buf cache statistic collecting 2003-12-29 11:42:09 +00:00
agc
bf07c8719a Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22308, verified by myself.
2003-08-07 10:04:11 +00:00
itojun
0e4dc5229d use bounded string op 2003-07-13 08:16:15 +00:00
fvdl
7b402ff9df If an alternate superblock is used, update the standard one correctly. 2003-04-14 18:50:52 +00:00
yamt
f5f20840e2 save and restore errno in signal handlers. 2003-04-13 10:22:40 +00:00
fvdl
750ed85d47 Write update some old fields when writing the superblock, similar to
ffs_oldfscompat_write() in the kernel. Use the old totals when
time < old_time (i.e. an old kernel or fsck wrote the filesystem last).
When setting the date back on a new kernel, that works out ok, since
new kernels always update both fields.
2003-04-06 17:23:25 +00:00
fvdl
42614ed3f3 Add support for UFS2. UFS2 is an enhanced FFS, adding support for
64 bit block pointers, extended attribute storage, and a few
other things.

This commit does not yet include the code to manipulate the extended
storage (for e.g. ACLs), this will be done later.

Originally written by Kirk McKusick and Network Associates Laboratories for
FreeBSD.
2003-04-02 10:39:19 +00:00
fvdl
a3ff3a3038 Bump daddr_t to 64 bits. Replace it with int32_t in all places where
it was used on-disk, so that on-disk formats remain the same.
Remove ufs_daddr_t and ufs_lbn_t for the time being.
2003-01-24 21:55:02 +00:00
dbj
43395bd5a8 Add support for the Apple UFS variation on ffs
This is the bulk of PR #17345

The general approach is to use a run time deteriminable value
for DIRBLKSIZ.  Additional allowances are included for using
MAXSYMLINKLEN with FS_42INODEFMT and a shift in the cylinder group
cluster summary count array.  Support is added for managing
the Apple UFS volume label.
2002-09-28 20:11:05 +00:00
lukem
bb82a84ded If SIGINFO is received, display summary information to stderr.
Based on changes in FreeBSD, via Chuck Cranor <chuck@research.att.com>
2002-05-06 03:17:43 +00:00
lukem
e3ba61f9f3 Incorporate fix by iedowse @ FreeBSD to allow disks with large numbers of
cylinder groups to work correctly, with minor modifications by me to work
with our FFS_EI code.  From the FreeBSD commit message:

	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.

	Reviewed by:    mckusick
2001-09-02 01:58:30 +00:00
lukem
84958ed05f - implement -F; treat provided filesystems as images in regular files
- replace "filesystem" with "file system" as appropriate
- grammar fixes
2001-08-15 03:54:53 +00:00
christos
566662ba06 remove redundant declarations 2001-02-04 21:25:54 +00:00
mycroft
a48409305d A minor tweak. 2001-01-09 09:25:32 +00:00
enami
6c06fd4f9f Don't swap cg_clustersum(cg)[0]. It doesn't actually exists and it's
actually tail of free block bitmap.

XXX swap_cg() should be shared with newfs.
2001-01-09 09:08:35 +00:00
is
9979da6cbb Format string cleanups by Bill Sommerfeld. 2000-10-10 20:24:49 +00:00
fvdl
a905c40444 Changes for softdep code. 1999-11-15 19:18:24 +00:00
mycroft
72a3da3933 copyback_cg() tried to copy too much if the cylinder group info was smaller
than 8k.  From PR 5404.
1998-05-06 02:45:09 +00:00
mrg
8578360272 use extern int over extern 1998-03-30 02:07:59 +00:00
bouyer
9aaa32d9a7 Add support for non-native byteorder FFS, and converting byteorder.
Also, be a bit more conservative with the clean flag: don't mark the FS
clean when we know there may still be errors (user anserwed 'n' to
a question, or fsck says "you must rerun fsck").
1998-03-18 17:01:23 +00:00
lukem
8b07f7ca3d for now, #ifdef out a couple of chunks that were added in the lite2 merge 1997-09-24 09:24:21 +00:00
lukem
af479c48b8 - don't indiscriminately include <stdlib.h> and <unistd.h> in "fsck.h"
- explicitly pull in <stdio.h>, <stdlib.h> and <unistd.h> in *.c as necessary
1997-09-20 06:16:23 +00:00
lukem
e111111128 resolve conflicts from lite-2 merge. 1997-09-16 16:44:43 +00:00
lukem
b1db038303 * cleanup for WARNS=1
* deprecate register
* cleanup manpage
* remove unused docheck() func
* prefix hex numbers with '0x'
* getopt returns -1 not EOF
1997-09-14 14:36:29 +00:00
christos
c5d8ca200f - util.h -> fsutil.h 1996-09-27 22:45:10 +00:00
christos
5528d37484 - fixed all printf formats [there were a lot of %l? <-> %? mistakes]
- added missing prototypes, and made local functions static
- removed parallel preening code; this is part of fsck(8)
- use printing utilities from fsck(8)
- Makefile does not make links to fsck and fsck.8
- removed -l maxparallel option. It has no meaning anymore.
1996-09-23 16:18:31 +00:00
cgd
fea3644f0b check in changes proposed in PR 2006 (approved by J.T.), to rename fsck
to fsck_ffs, so that in the future 'fsck' can be a wrapper than invokes
appropriate filesystem-specific checker programs.  For now, the only
user-visible change is that the names have changed in the manual page
and in error messages; fsck and fsck.8 are now links to fsck_ffs and
fsck_ffs.8, until the rest of the transition is complete.
1996-04-05 01:44:24 +00:00
cgd
555d4b510e slightly clean rcs ids, etc. 1995-04-23 10:33:03 +00:00
mycroft
7cb70c9889 Set the clean flag if necessary. If preening, don't check `clean' file
systems.
1995-04-12 21:24:07 +00:00
cgd
0114e805ce convert to new RCS Id conventions; reduce my headache 1995-03-18 14:54:19 +00:00
cgd
9235328d5a functions which are 'fake-varaargs' should be passed longs, not ints. 1995-02-10 23:26:14 +00:00
cgd
5eeab43e28 more cleanups from Jim Jegers, passed over by me. 1994-12-05 20:15:31 +00:00
mycroft
ea7b5d4ec6 Eliminate uses of some obsolete functions. 1994-09-23 14:26:58 +00:00
mycroft
ccfa3742b5 Update from 4.4-Lite, with local changes. 1994-06-08 18:57:30 +00:00
pk
77c9a3fa5b Prototype some things. 1994-05-02 10:18:21 +00:00
cgd
9a2c884999 need <sys/time.h> 1994-04-25 18:28:42 +00:00
deraadt
73c673cd94 if user does ie, "fsck /etc/group", then types ^C to the CONTINUE
prompt do not dump core. fix from <dean@fsa.ca> (who i will stop
hounding about bug fixes for an hour or two)
1994-04-09 08:53:37 +00:00
cgd
e4ef74f2a0 kill extern'd lseek() 1994-03-28 06:49:06 +00:00