aboutsummaryrefslogtreecommitdiff
path: root/sbin/fsdb/fsdb.c
Commit message (Collapse)AuthorAgeFilesLines
* Revert r313780 (UFS_ prefix)Ed Maste2018-03-171-11/+11
| | | | Notes: svn path=/head/; revision=331095
* Prefix UFS symbols with UFS_ to reduce namespace pollutionEd Maste2018-03-171-11/+11
| | | | | | | | | | | | | Followup to r313780. Also prefix ext2's and nandfs's versions with EXT2_ and NANDFS_. Reported by: kib Reviewed by: kib, mckusick Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D9623 Notes: svn path=/head/; revision=331083
* Fix buildworld after r328075, by also renaming cgget to cglookup inDimitry Andric2018-01-171-1/+1
| | | | | | | | | | fsdb. Reported by: ohartmann@walstatt.org,david@catwhisker.org Pointy hat to: mckusick Notes: svn path=/head/; revision=328084
* The fix in r327273 turns a memory leak into freeing wild pointer.Xin LI2017-12-291-2/+4
| | | | | | | Fix this by freeing only the initialized pointer. Notes: svn path=/head/; revision=327335
* Plug memory leak by freeing wantedblk{32,64}.Warner Losh2017-12-281-0/+2
| | | | | | | CID: 273655, 273656 Notes: svn path=/head/; revision=327273
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-1/+3
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended. Notes: svn path=/head/; revision=326276
* prefix UFS symbols with UFS_ to reduce namespace pollutionEd Maste2017-02-151-12/+12
| | | | | | | | | | | | | | | | | | | | | Specifically: ROOTINO -> UFS_ROOTINO WINO -> UFS_WINO NXADDR -> UFS_NXADDR NDADDR -> UFS_NDADDR NIADDR -> UFS_NIADDR MAXSYMLINKLEN_UFS[12] -> UFS[12]_MAXSYMLINKLEN (for consistency) Also prefix ext2's and nandfs's NDADDR and NIADDR with EXT2_ and NANDFS_ Reviewed by: kib, mckusick Obtained from: NetBSD MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D9536 Notes: svn path=/head/; revision=313780
* Use nitems() from sys/param.h.Marcelo Araujo2016-07-301-2/+2
| | | | | | | Sponsored by: gandi.net (BSD Day Taiwan) Notes: svn path=/head/; revision=303539
* Revert 248634 and 248643 (e.g., restoring 248625 and 248639).Kirk McKusick2013-03-231-3/+4
| | | | | | | Build verified by: Glen Barber (gjb@) Notes: svn path=/head/; revision=248658
* Revert r248639 to fix build failure on head/Glen Barber2013-03-231-4/+3
| | | | Notes: svn path=/head/; revision=248643
* Fix the build after addition of cylinder group cacheing (r248625)Kirk McKusick2013-03-231-3/+4
| | | | | | | | Reported by: Glen Barber (gjb@) Pointy hat to: Kirk McKusick (mckusick@) Notes: svn path=/head/; revision=248639
* Fix sbin/ build with a 64-bit ino_t.Matthew D Fleming2012-09-271-11/+15
| | | | | | | Original code by: Gleb Kurtsou Notes: svn path=/head/; revision=241013
* The dump, fsck_ffs, fsdb, fsirand, newfs, makefs, and quot utilitiesKirk McKusick2011-01-241-1/+1
| | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=217769
* - Merge soft-updates journaling from projects/suj/head into head. ThisJeff Roberson2010-04-241-4/+7
| | | | | | | | | | | 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 Notes: svn path=/head/; revision=207141
* Update after function renames.Pawel Jakub Dawidek2006-10-311-2/+2
| | | | | | | Sponsored by: home.pl Notes: svn path=/head/; revision=163846
* Allow fsdb to manipulate the birthtime entries on UFS2.Ceri Davies2006-08-231-0/+18
| | | | | | | | Approved by: jhb MFC after: 1 month Notes: svn path=/head/; revision=161558
* o Implement findblk command: find the inode(s) owning the specifiedMaxim Konovalov2006-06-021-0/+265
| | | | | | | | | | disk block(s) number(s). Obtained from: NetBSD MFC after: 2 months Notes: svn path=/head/; revision=159169
* o Do recrack(arguments) for commands which actually take NAME asMaxim Konovalov2006-04-211-9/+10
| | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=157950
* Use the new name H_SETSIZE instead of the old H_EVENT to set the historyStefan Farfeleder2005-10-191-1/+1
| | | | | | | | | size. PR: 86355 Notes: svn path=/head/; revision=151471
* The libedit update made a const cast necessary.Stefan Farfeleder2005-08-071-1/+1
| | | | Notes: svn path=/head/; revision=148833
* Make fsck WARNS=2 clean.Lukas Ertl2004-10-091-16/+16
| | | | Notes: svn path=/head/; revision=136322
* Make this WARNS=2 clean byJohan Karlsson2003-11-131-0/+1
| | | | | | | | | | | | | - #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 Notes: svn path=/head/; revision=122621
* s/filesystem/file system/g as discussed on -developersTom Rhodes2002-08-211-4/+4
| | | | Notes: svn path=/head/; revision=102231
* This commit adds basic support for the UFS2 filesystem. The UFS2Kirk McKusick2002-06-211-24/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> Notes: svn path=/head/; revision=98542
* more file system > filesystemTom Rhodes2002-05-161-4/+4
| | | | Notes: svn path=/head/; revision=96707
* o __P removal.Warner Losh2002-03-211-29/+16
| | | | | | | | | o ansi function definitions. o main prototype removal o unifdef __STDC__ Notes: svn path=/head/; revision=92881
* Remove 'register' keyword.David E. O'Brien2002-03-201-4/+4
| | | | | | | | | 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?) Notes: svn path=/head/; revision=92806
* Something i always wanted to see: add a function to print the list ofJoerg Wunsch2002-01-261-16/+23
| | | | | | | | | | | 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 Notes: svn path=/head/; revision=89827
* Avoid pointless initialization of global variables to 0. This onlyJoerg Wunsch2002-01-261-2/+2
| | | | | | | | | | | 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 Notes: svn path=/head/; revision=89826
* Don't exit with -1 if the user typed "quit".Joerg Wunsch2002-01-261-1/+2
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=89810
* Allow fsdb the ability to work with entries named with whitespace embedded.Brian Feldman2002-01-251-2/+6
| | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=89791
* Check that the mode argument to fsdb's `chmod' command contains noIan Dowse2001-11-111-1/+1
| | | | | | | | | | 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. Notes: svn path=/head/; revision=86258
* *** empty log message ***David E. O'Brien2001-10-011-3/+4
| | | | Notes: svn path=/head/; revision=84261
* In fsdb, call sblock_init() which is now necessary to initialiseIan Dowse2001-04-231-0/+1
| | | | | | | | the global variable dev_bsize. Add a prototype for sblock_init() to fsck.h, and set the return type correctly. Notes: svn path=/head/; revision=75884
* Remove unused includes.Jeroen Ruigrok van der Werven2000-05-011-1/+0
| | | | Notes: svn path=/head/; revision=59869
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50476
* More egcs warning fixes:Warner Losh1999-04-251-2/+2
| | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=46080
* Fix some calculations that use sizeof to attempt to find the end of anDon Lewis1998-11-091-3/+3
| | | | | | | | | | 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 Notes: svn path=/head/; revision=41023
* Correct use of .Nm. Use .Bl/.El for enumerating options. Use .An. CorrectPhilippe Charnier1998-06-151-14/+6
| | | | | | | | formatting of rcsid. Remove unused #includes. Do not use memory after freeing it. Notes: svn path=/head/; revision=37001
* Remove __progname. Make -f a no-op flag as stated in the man page. RemovePhilippe Charnier1997-06-111-20/+17
| | | | | | | unused variables. Notes: svn path=/head/; revision=26557
* Implement a -r option to fsdb(8), ``read/only''.Joerg Wunsch1997-04-151-43/+52
| | | | Notes: svn path=/head/; revision=24956
* Missing $Id$Peter Wemm1997-03-131-1/+1
| | | | Notes: svn path=/head/; revision=23839
* Make this compile. Mostly use the new names for the ctime/atime/mtimePeter Wemm1997-03-131-1/+1
| | | | | | | stamps in the inodes and call one of fsck's utility funcs with a new arg. Notes: svn path=/head/; revision=23838
* Get rid of useless -f flag (though left for historical reasons).Guido van Rooij1996-09-301-2/+9
| | | | Notes: svn path=/head/; revision=18585
* Add chlen command so you can set the size of an inode. This was handyGuido van Rooij1996-09-261-0/+23
| | | | | | | | | 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. Notes: svn path=/head/; revision=18498
* ts_sec -> tv_secNate Williams1996-09-201-2/+2
| | | | | | | ts_nsec -> tv_nsec Notes: svn path=/head/; revision=18406
* Commit FreeBSD-specific changes. Mainly to do with structure layoutPeter Wemm1995-11-031-8/+8
| | | | | | | differences that we dont have. Notes: svn path=/head/; revision=12051
* Whoops. RE-Import NetBSD's fsdb - I believe this was written by John Kohl.Peter Wemm1995-11-031-0/+865
Obtained from: NetBSD Notes: svn path=/vendor/NetBSD/dist/; revision=12048