Commit graph

139 commits

Author SHA1 Message Date
Kirk McKusick 25bcd53216 Fix the build after addition of cylinder group cacheing (r248625)
Reported by:   Glen Barber (gjb@)
Pointy hat to: Kirk McKusick (mckusick@)
2013-03-23 07:57:30 +00:00
Simon J. Gerraty 7cf3a1c6b2 Updated dependencies 2013-03-11 17:21:52 +00:00
Sergey Kandaurov 3dfcb0da4b Catch up with internal API changes for initbarea() and getdatablk()
of fsck_ffs introduced with r247212.

Submitted by:	David Wolfskill <david@catwhisker.org>
2013-02-24 19:32:43 +00:00
Simon J. Gerraty f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
Sergey Kandaurov fa358104b1 Remove write only assignments and thus fix the build after struct bufarea
TAILQ conversion (r246812).
2013-02-15 09:10:01 +00:00
Simon J. Gerraty 23090366f7 Sync from head 2012-11-04 02:52:03 +00:00
Matthew D Fleming e25a029eb2 Fix sbin/ build with a 64-bit ino_t.
Original code by:	Gleb Kurtsou
2012-09-27 23:31:06 +00:00
Marcel Moolenaar 7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
Dimitry Andric 24c8f29cf4 Partially undo r228693, by removing NO_WFORMAT.clang in fsdb's Makefile,
and fixing the format string in sbin/fsdb/fsdbutil.c instead.

Note the remark "Work around a problem with format string warnings and
ntohs macros" was actually incorrect.  The DIP(dp, di_nlink) macro
invocation actually returned an int, due to its ternary expression, even
though the di_nlink members of struct ufs1_dinode and struct ufs2_dinode
are both defined as int16_t.

MFC after:	2 weeks
2012-03-09 21:02:39 +00:00
Dimitry Andric 07b202a847 Define several extra macros in bsd.sys.mk and sys/conf/kern.pre.mk, to
get rid of testing explicitly for clang (using ${CC:T:Mclang}) in
individual Makefiles.

Instead, use the following extra macros, for use with clang:
- NO_WERROR.clang       (disables -Werror)
- NO_WCAST_ALIGN.clang  (disables -Wcast-align)
- NO_WFORMAT.clang	(disables -Wformat and friends)
- CLANG_NO_IAS		(disables integrated assembler)
- CLANG_OPT_SMALL	(adds flags for extra small size optimizations)

As a side effect, this enables setting CC/CXX/CPP in src.conf instead of
make.conf!  For clang, use the following:

CC=clang
CXX=clang++
CPP=clang-cpp

MFC after:	2 weeks
2012-02-28 18:30:18 +00:00
Don Lewis ec1a0f73d0 Improve sparse file handling when printing the block list for an inode by
not bailing out early when a hole is encountered in the direct block list.
Print NULL block pointers in the direct block list.  Simplify the
code that prints the fragment count.

Match the style of the existing code.

Reviewed by:	mckusick
MFC after:	1 week
2012-02-06 21:50:11 +00:00
Dimitry Andric cf2cbe3458 Revert r228603, and add the workaround to sbin/fsdb/Makefile instead.
MFC after:	1 week
2011-12-18 17:42:26 +00:00
Dimitry Andric 9733a9e463 In sbin/fsdb/fsdbutil.c, work around a clang false positive with printf
format warnings and conditional operators.  (See LLVM PR 11313 for more
information.)

MFC after:	1 week
2011-12-16 23:09:31 +00:00
Ed Schouten 9f365aa1d6 Get rid of major/minor number distinction.
As of FreeBSD 6, devices can only be opened through devfs. These device
nodes don't have major and minor numbers anymore. The st_rdev field in
struct stat is simply based a copy of st_ino.

Simply display device numbers as hexadecimal, using "%#jx". This is
allowed by POSIX, since it explicitly states things like the following
(example taken from ls(1)):

	"If the file is a character special or block special file, the
	size of the file may be replaced with implementation-defined
	information associated with the device in question."

This makes the output of these commands more compact. For example, ls(1)
now uses approximately four columns less. While there, simplify the
column length calculation from ls(1) by calling snprintf() with a NULL
buffer.

Don't be afraid; if needed one can still obtain individual major/minor
numbers using stat(1).
2011-09-28 18:53:36 +00:00
Kirk McKusick 7649cb0043 The dump, fsck_ffs, fsdb, fsirand, newfs, makefs, and quot utilities
include sys/time.h instead of time.h. This include is incorrect as
per the manpages for the APIs and the POSIX definitions. This commit
replaces sys/time.h where necessary with time.h.

The commit also includes some minor style(9) header fixup in newfs.

This commit is part of a larger effort by Garrett Cooper started in
//depot/user/gcooper/posix-conformance-work/ -- to make FreeBSD more
POSIX compliant.

Submitted by:  Garrett Cooper   yanegomi at gmail dot com
2011-01-24 06:17:05 +00:00
Jeff Roberson 113db2dddb - Merge soft-updates journaling from projects/suj/head into head. This
brings in support for an optional intent log which eliminates the need
   for background fsck on unclean shutdown.

Sponsored by:   iXsystems, Yahoo!, and Juniper.
With help from: McKusick and Peter Holm
2010-04-24 07:05:35 +00:00
Pawel Jakub Dawidek fffbc2a500 Update after function renames.
Sponsored by:	home.pl
2006-10-31 22:07:29 +00:00
Ruslan Ermilov 8266d47670 Markup fixes. 2006-09-18 11:55:10 +00:00
Ceri Davies c4c6a6c2b5 Add a note that the btime command only works on UFS2.
Suggested by: maxim (who had also done the btime patch independently).
2006-08-24 09:14:02 +00:00
Ceri Davies 96dd636028 Allow fsdb to manipulate the birthtime entries on UFS2.
Approved by:	jhb
MFC after:	1 month
2006-08-23 22:44:00 +00:00
Maxim Konovalov 82d9b14e16 o Implement findblk command: find the inode(s) owning the specified
disk block(s) number(s).

Obtained from:	NetBSD
MFC after:	2 months
2006-06-02 12:55:26 +00:00
Maxim Konovalov 1bc508492a o Do recrack(arguments) for commands which actually take NAME as
arguments so we do not coredump at "help foo", "back bar" and such.

o Be consistent and print argc - 1 as a command arguments number in
all cases.

PR:		bin/37096
Submitted by:	Joshua Goodall
MFC after:	1 month
2006-04-21 20:33:16 +00:00
Stefan Farfeleder 2110d9c31a Use the new name H_SETSIZE instead of the old H_EVENT to set the history
size.

PR:	86355
2005-10-19 15:37:43 +00:00
Stefan Farfeleder 515faf2fbe The libedit update made a const cast necessary. 2005-08-07 20:53:33 +00:00
Tom Rhodes ca45b7e81f Reword a sentence to conform with our mdoc(7) style.
Modify wording in a sentence to avoid a run on within ().
Remove a contraction.

Submitted by:	Joel Dahl <joel@automatvapen.se> (original version)
2005-02-12 23:23:53 +00:00
Ruslan Ermilov 6087df9e8b Sort sections. 2005-01-18 10:09:38 +00:00
Lukas Ertl c9eaf2265c Make fsck WARNS=2 clean. 2004-10-09 15:56:34 +00:00
Alexander Kabaev a03f8f81b7 Downgrade WARNS level until GCC 3.4.2 warning are fixed. 2004-07-28 06:00:09 +00:00
Ruslan Ermilov 9806e23132 Mechanically kill hard sentence breaks. 2004-07-02 21:45:06 +00:00
Ruslan Ermilov 47d7e8a96f Fixed style of DPADD and LDADD assignments as per style.Makefile(5). 2004-02-05 22:44:25 +00:00
Johan Karlsson 8b5e064d28 Make this WARNS=2 clean by
- #include <timeconv.h> for _time_to_time32 et al
	- use (uintmax_t) and %j
	- remove unused variable 'j' (from PR 39866)

PR:		39866
Submitted by:	Dan Lukes <dan@obluda.cz>
Tested by:	make universe
2003-11-13 19:08:43 +00:00
Christian Brueffer 8f75df5506 Backout Rev. 1.24
English lessons provided by:	jhb
2003-08-30 07:49:42 +00:00
Christian Brueffer 9980a8d86a Grammar fix 2003-08-29 20:12:21 +00:00
Poul-Henning Kamp 6c7e64b65c I forgot fsdb was still sharing files with fsck. 2002-09-16 14:18:43 +00:00
Tom Rhodes ce66ddb763 s/filesystem/file system/g as discussed on -developers 2002-08-21 18:11:48 +00:00
Poul-Henning Kamp 599304a42f Warning cleanup.
Format changes by peter
2002-07-30 13:01:25 +00:00
Philippe Charnier e1205e80e5 The .Nm utility 2002-07-06 19:34:18 +00:00
Kirk McKusick 1c85e6a35d This commit adds basic support for the UFS2 filesystem. The UFS2
filesystem expands the inode to 256 bytes to make space for 64-bit
block pointers. It also adds a file-creation time field, an ability
to use jumbo blocks per inode to allow extent like pointer density,
and space for extended attributes (up to twice the filesystem block
size worth of attributes, e.g., on a 16K filesystem, there is space
for 32K of attributes). UFS2 fully supports and runs existing UFS1
filesystems. New filesystems built using newfs can be built in either
UFS1 or UFS2 format using the -O option. In this commit UFS1 is
the default format, so if you want to build UFS2 format filesystems,
you must specify -O 2. This default will be changed to UFS2 when
UFS2 proves itself to be stable. In this commit the boot code for
reading UFS2 filesystems is not compiled (see /sys/boot/common/ufsread.c)
as there is insufficient space in the boot block. Once the size of the
boot block is increased, this code can be defined.

Things to note: the definition of SBSIZE has changed to SBLOCKSIZE.
The header file <ufs/ufs/dinode.h> must be included before
<ufs/ffs/fs.h> so as to get the definitions of ufs2_daddr_t and
ufs_lbn_t.

Still TODO:
Verify that the first level bootstraps work for all the architectures.
Convert the utility ffsinfo to understand UFS2 and test growfs.
Add support for the extended attribute storage. Update soft updates
to ensure integrity of extended attribute storage. Switch the
current extended attribute interfaces to use the extended attribute
storage. Add the extent like functionality (framework is there,
but is currently never used).

Sponsored by: DARPA & NAI Labs.
Reviewed by:	Poul-Henning Kamp <phk@freebsd.org>
2002-06-21 06:18:05 +00:00
Tom Rhodes 3468b317cb more file system > filesystem 2002-05-16 04:10:46 +00:00
Poul-Henning Kamp 3f2bb38c5c Match prototypes to functions over in fsck_ffs. 2002-05-14 09:40:33 +00:00
Warner Losh 0638cc1a39 o __P removal.
o ansi function definitions.
o main prototype removal
o unifdef __STDC__
2002-03-21 13:10:52 +00:00
David E. O'Brien 3d438ad61f Remove 'register' keyword.
It does not help modern compilers, and some may take some hit from it.
(I also found several functions that listed *every* of its 10 local vars with
 "register" -- just how many free registers do people think machines have?)
2002-03-20 17:55:10 +00:00
Ruslan Ermilov f303d23186 This sounds better. 2002-03-15 18:12:13 +00:00
Joerg Wunsch 280a49ec4b Something i always wanted to see: add a function to print the list of
blocks allocated by some inode.  Indirect blocks are printed
recursively, so beware :), the list could become lengthy...
(We should probably add some output pager to fsdb.)

MFC after:	1 month
2002-01-26 15:53:23 +00:00
Joerg Wunsch b81ba372c5 Avoid pointless initialization of global variables to 0. This only
bloats the resulting binary file by forcing them out of .bss into
.data, while the C standard already guarantees them to become
initialized to 0 at program startup.

MFC after:	1 week
2002-01-26 15:47:24 +00:00
Joerg Wunsch aaadf6882c Don't exit with -1 if the user typed "quit".
MFC after:	1 week
2002-01-26 11:21:19 +00:00
Brian Feldman bfb55e2f97 Remove a not-very-useful printf(3). 2002-01-25 18:33:40 +00:00
Brian Feldman 8660ce229c Allow fsdb the ability to work with entries named with whitespace embedded.
This works by retokenizing a line with a split limit so that if the
argument count for a command is greater than the number of arguments
formed by splitting apart the line of user input, the last argument
is instead all of the remainder of the input line.

Yes, I needed this capability at one point to fix a filesystem manually,
which happened to break with a problematic space-containing directory
entry.
2002-01-25 18:31:57 +00:00
David E. O'Brien 2d68bf45bf Default to WARNS=2.
Binary builds that cannot handle this must explicitly set WARNS=0.

Reviewed by:	mike
2001-12-04 02:19:58 +00:00
Ian Dowse 75249b648a Check that the mode argument to fsdb's `chmod' command contains no
inode type bits set. Previously it would let you set IFMT bits (but
not clear them). The `chtype' command should be be used instead
for changing the inode type; having chmod half-work only causes
confusion.
2001-11-11 10:44:02 +00:00
David E. O'Brien 757eeda04b *** empty log message *** 2001-10-01 08:43:58 +00:00
Dima Dorfman 7ebcc426ef Remove whitespace at EOL. 2001-07-15 07:53:42 +00:00
Ruslan Ermilov 9fe48c6e8d mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 11:04:34 +00:00
Ian Dowse d164d805c7 In fsdb, call sblock_init() which is now necessary to initialise
the global variable dev_bsize. Add a prototype for sblock_init()
to fsck.h, and set the return type correctly.
2001-04-23 21:39:14 +00:00
Ruslan Ermilov 0a5779d45b - Backout botched attempt to introduce MANSECT feature.
- MAN[1-9] -> MAN.
2001-03-26 14:33:27 +00:00
Ollivier Robert ed873335b7 Respect style(9), one must not include both <sys/types.h> and
<sys/param.h> (the latter includes the former).

Submitted by:	bde
2001-03-22 13:19:32 +00:00
Alfred Perlstein 9eb8ec95f4 Include headers to unbreak world.
Submitted by: Ollivier Robert <roberto@eurocontrol.fr>
2001-03-21 20:30:35 +00:00
Ruslan Ermilov fe655281c5 Set the default manual section for sbin/ to 8. 2001-03-20 18:13:31 +00:00
Ruslan Ermilov d0353b836e mdoc(7) police: split punctuation characters + misc fixes. 2001-02-01 16:38:02 +00:00
Ruslan Ermilov 896eb7d10c Prepare for mdoc(7)NG. 2001-01-16 09:15:57 +00:00
Ruslan Ermilov 7c7fb079b9 mdoc(7) police: use the new features of the Nm macro. 2000-11-20 16:52:27 +00:00
Ruslan Ermilov 726b61ab5f Avoid use of direct troff requests in mdoc(7) manual pages. 2000-11-10 17:46:15 +00:00
Adrian Chadd da7e7114d1 Reviewed by: rwatson, bp
Approved by:	rwatson
Obtained from:	NetBSD source tree

Second part of the fsck wrappers commit. This commit enables the new fsck
code (removing the fsck/* code and replacing it with the netbsd fsck
wrapper code), and enabling some FFS-based utilities to compile.

Details:

* quotacheck, fsdb required modification to use the fsck_ffs/ code rather
  than fsck/ . This might change later since quotacheck requires preen.c
  which should exist in fsck/ rather than fsck_ffs/

* src/Makefile has fsck_ffs added to it so it it built as part of the tree
  now

* share/doc/smm/03.fsck/ uses the SMM.doc/ stuff from fsck_ffs, not fsck.

I've tested this, and it shouldn't require any changes on your machine.
The fsck wrapper reads /etc/fsck and is command-line-compatible enough
to not require rc changes (well, most changes unless you want to do
anything nifty by specifying the fs types explicityly, read the man page
if you want further details on what it can do.)

This now allows us to support multiple filesystem types during bootup.
2000-10-09 10:23:31 +00:00
Jeroen Ruigrok van der Werven 2ec1f77190 Remove unused includes. 2000-05-01 20:01:16 +00:00
Mike Pritchard f050f700ad Fix various man pages to stop abusing the .Bx macro to generate
the strings "FreeBSD" and "NetBSD".  Use the .Fx or .Nx macro
instead.
2000-01-23 01:30:05 +00:00
Bill Fumerola cf1cb03897 'clri' takes an argument.
Reviewed by:	phk
1999-12-20 07:47:57 +00:00
Peter Wemm 7f3dea244c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
Warner Losh ebe70c8f68 More egcs warning fixes:
o main returns int not void
	o use braces to avoid potentially ambiguous else

Note: The fix to natd is potentially functional in nature since I used
the indentation as the right thing rather than the struct semantics.
Someone more familiar with the code should double check me on this one.

Reviewed by: obrien and chuckr
1999-04-25 22:33:30 +00:00
Guy Helmer b6adffbf1b Correctly ref editline(3).
PR:		docs/10973
1999-04-13 02:42:53 +00:00
Don Lewis 508e55f5a4 Fix some calculations that use sizeof to attempt to find the end of an
array that were doing sizeof on an unrelated variable.  This just happened
to work right on the i386, but would not on the alpha.

PR: bin/8427
1998-11-09 03:43:55 +00:00
Bruce Evans 7abda51bbc Fixed printf format errors. 1998-06-28 19:36:49 +00:00
Philippe Charnier 0227048a1f Correct use of .Nm. Use .Bl/.El for enumerating options. Use .An. Correct
formatting of rcsid. Remove unused #includes. Do not use memory after
freeing it.
1998-06-15 07:12:20 +00:00
John Hay 3142ca45f1 opt_diagnostic.h isn't needed anymore. 1998-02-06 22:31:14 +00:00
John Hay 1420147475 fsdb and fsck use the ffs code which needs opt_diagnostic.h. 1998-02-05 14:31:05 +00:00
Philippe Charnier 617f1bc8c6 Remove __progname. Make -f a no-op flag as stated in the man page. Remove
unused variables.
1997-06-11 07:13:30 +00:00
Joerg Wunsch 36b8baa315 Implement a -r option to fsdb(8), ``read/only''. 1997-04-15 09:02:48 +00:00
Bruce Evans 962cf4d335 Fixed bogus casts from (int32_t *) to (time_t *). 1997-03-13 17:56:25 +00:00
Peter Wemm fd24d57d05 Missing $Id$ 1997-03-13 12:44:53 +00:00
Peter Wemm 76863c5104 Make this compile. Mostly use the new names for the ctime/atime/mtime
stamps in the inodes and call one of fsck's utility funcs with a new arg.
1997-03-13 12:42:22 +00:00
Peter Wemm c0ec1f37ef Revert $FreeBSD$ to $Id$ 1997-02-22 14:40:44 +00:00
Jordan K. Hubbard 1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
Wolfram Schneider af20215665 Sort cross references. 1997-01-13 00:25:51 +00:00
Guido van Rooij fe3a5bd458 Get rid of useless -f flag (though left for historical reasons). 1996-09-30 20:04:24 +00:00
Guido van Rooij a9bb2677f6 Add chlen command so you can set the size of an inode. This was handy
in order to create sparse directory files that caused a panic of a
filesystem where fsck would not find anything. A fix for fsck is in the
make but still has to be reviewed by Kirk McKusick.
1996-09-26 19:40:04 +00:00
Nate Williams b70db4c5d5 ts_sec -> tv_sec
ts_nsec -> tv_nsec
1996-09-20 04:33:57 +00:00
Peter Wemm 2ea2367052 Add ${DPADD}, $Id$ 1996-09-02 23:40:08 +00:00
Peter Wemm e10719ee6a Adjust relative paths in Makefile to ../sbin/fsck and ../../sys/ufs/ffs 1995-11-24 23:12:00 +00:00
Peter Wemm d4d864ba62 Commit FreeBSD-specific changes. Mainly to do with structure layout
differences that we dont have.
1995-11-03 22:47:24 +00:00
Peter Wemm 39bb6d1ef0 Whoops. RE-Import NetBSD's fsdb - I believe this was written by John Kohl.
Obtained from: NetBSD
1995-11-03 22:38:54 +00:00