summaryrefslogtreecommitdiff
path: root/sbin/dump/traverse.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix build break from dump incompatibility I introduced in -r340411Kirk McKusick2018-11-141-4/+4
| | | | | | | Pointy-hat to: mckusick Notes: svn path=/head/; revision=340422
* Plug build break after r340411.Gleb Smirnoff2018-11-131-4/+4
| | | | Notes: svn path=/head/; revision=340416
* Add asserts to prevent overflows of c_addr.Warner Losh2018-06-111-0/+4
| | | | | | | | | | | | | Add some asserts that prevents the overflows of c_addr. This can't happen, absent bugs. However, certain large filesystems can cause problems. These have been prevented by r334968, but a solution is needed. These asserts will help assure that solution is correct. PR: 228807 Reviewed by: db Notes: svn path=/head/; revision=334969
* Revert r313780 (UFS_ prefix)Ed Maste2018-03-171-10/+10
| | | | Notes: svn path=/head/; revision=331095
* Prefix UFS symbols with UFS_ to reduce namespace pollutionEd Maste2018-03-171-10/+10
| | | | | | | | | | | | | 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
* In preparation for converting to libufs to read the superblock,Kirk McKusick2017-12-271-10/+10
| | | | | | | | | | | | change conflicting function names: getino => getinode bread => blkread No functional change. Notes: svn path=/head/; revision=327253
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. 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. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* Renumber copyright clause 4Warner Losh2017-02-281-1/+1
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* prefix UFS symbols with UFS_ to reduce namespace pollutionEd Maste2017-02-151-19/+18
| | | | | | | | | | | | | | | | | | | | | 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 NULL instead of 0.Marcelo Araujo2016-04-191-1/+1
| | | | | | | | | malloc will return NULL in case it cannot allocate memory. MFC after: 2 weeks. Notes: svn path=/head/; revision=298235
* Fix a bug which could break extended attributes in a dump output.Hiroki Sato2014-09-101-1/+6
| | | | | | | | | | | This occurred when a file was >892kB long and had a large data (>1kB) in the extended attributes. Reported by: Masashi Toriumi Reviewed by: mckusick Notes: svn path=/head/; revision=271411
* Fix sbin/ build with a 64-bit ino_t.Matthew D Fleming2012-09-271-5/+6
| | | | | | | Original code by: Gleb Kurtsou Notes: svn path=/head/; revision=241013
* When using dump to generate level 0 dumps which are then rsync'edKirk McKusick2008-05-231-0/+5
| | | | | | | | | | | | | | | to a remote machine, the fact that the dump date is stored with each header (inode) record makes rsync significantly less efficient than necessary. This also applies to inode access times when they are not important data to retain. When implementing an offsite backup solution of this type, these dates in particular are not important, especially if it prevents effective offsite backups. PR: bin/91049 Submitted by: Forrest W Christian <fwc@mt.net> Notes: svn path=/head/; revision=179267
* (bread): For a read that is contained entirely within a block, never copyThomas Quinot2007-04-051-1/+1
| | | | | | | | | | | out more than size bytes to the caller's buffer. PR: bin/111191 Reviewed by: pb MFC after: 1 week Notes: svn path=/head/; revision=168392
* Fix an error in dumping large sparse files containing extended attributes.Kirk McKusick2007-02-271-2/+2
| | | | Notes: svn path=/head/; revision=167055
* Update the dump program to save extended attributes. UpdateKirk McKusick2007-02-261-18/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the restore program to restore all dumped extended attributes. If the restore is running as root, it will always be able to restore all extended attributes. If it is not running as root, it makes a best effort to set them. Using the -v command line flag or the `verbose' command in interactive mode will display all the extended attributes being set on files (and at the end on directories) that are being restored. It will note any extended attributes that could not be set. The extended attributes are placed on the dump image immediately following each file's data. Older versions of restore can work with the newer dump images. Old versions of restore will correctly restore the file data and then (silently) skip over the extended attribute data and proceed to the next file. This resolves PR 93085 which will be closed once the code has been MFC'ed. Note that this code will not compile until these header files have been updated: <protocols/dumprestore.h> and <sys/extattr.h>. PR: bin/93085 Comments from: Poul-Henning Kamp and Robert Watson MFC after: 3 weeks Notes: svn path=/head/; revision=167011
* Dump keeps a bitmap of the state of various inodes, which is sizedDavid Malone2006-04-111-8/+20
| | | | | | | | | | | | | to match the number of inodes on the disk. If we find a directory entry with a crazy inode number in it, don't look beyond the end of the bitmap to find that inode's state. Instead skip that directory entry and print a warning. Reviewed by: iedowse MFC after: 3 weeks Notes: svn path=/head/; revision=157660
* Make gcc4 happy by making consistent signedness.Xin LI2005-05-021-1/+1
| | | | Notes: svn path=/head/; revision=145794
* Avoid casts as lvalues.Alexander Kabaev2004-07-281-2/+8
| | | | Notes: svn path=/head/; revision=132762
* Remove advertising clause from University of California Regent's license,Mark Murray2004-04-091-4/+0
| | | | | | | | | per letter dated July 22, 1999. Approved by: core, imp Notes: svn path=/head/; revision=128073
* In mapdirs(), do not use the `dp' inode pointer after searchdir()Ian Dowse2003-11-041-3/+3
| | | | | | | | | | | | | | | | | has been called, since it points to a shared inode buffer that may be overwritten. The two cases where `dp' was used incorrectly appear to have been overlooked when "nodump" inheritance was first added in revision 1.12. This is reported to correct propagation of the nodump flag on directories that are larger than one block in size. PR: bin/58912 Submitted by: Volker Paepcke <vpaepcke@incore.de> MFC after: 1 week Notes: svn path=/head/; revision=122060
* Dump is hard-wired to believe that it can read disks onKirk McKusick2003-05-071-4/+47
| | | | | | | | | | | | | | | | | | | | | 1024-byte boundaries. For many years this was a reasonable assumption. However, in recent years we have begun seeing devices with 2048-byte sectors. These devices return errors when dump tries to read starting in the middle of a sector or when it tries to read only the first half of a sector. Rather than change the native block size used by dump (and thus create an incompatible dump format), this fix checks for transfer requests that start and/or end on a non-sector boundary. When such a read is detected, the new code reads the entire sector and copies out just the part that dump needs. Reviewed by: Poul-Henning Kamp <phk@critter.freebsd.dk> Approved by: re (John Baldwin <jhb@FreeBSD.org>) Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=114810
* Add a caching option to dump. Use -C. Note that NetBSD has a caching optionMatthew Dillon2003-01-131-3/+4
| | | | | | | | | | | | | | | | | | | | | | called -r but it takes 512 byte blocks instead of megabytes, and I felt a megabytes specification would be far more useful so I did not use the same option character. This will *greatly* improve dump performance at the cost of possibly missing filesystem changes that occur between passes, and does a fairly good job making up for the loss of buffered block devices. Caching is disabled by default to retain historical behavior. In tests, dump performance improved by about 40% when dumping / or /usr. Beware that dump forks and the cache may wind up being larger then you specify, but a more complex shared memory implementation would not produce results that are all that much better so I kept it simple for now. MFC after: 3 days Notes: svn path=/head/; revision=109187
* Correct the estimated block count calculated by dump to accountKirk McKusick2002-12-031-1/+4
| | | | | | | | | for the minimal amount of space used by a snapshot. Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=107542
* Properly handle UFS2 sparsely allocated inodes. The UFS2 filesystemKirk McKusick2002-12-031-25/+66
| | | | | | | | | | | | | only preallocates a small number of inodes. The dump program tries to scan through all the allocated inodes on a filesystem which causes bad behavior if they have never been allocated. Thus dump must calculate the set of inodes that have actually been allocated and scan only those inodes. Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=107541
* Mark snapshots so that dump will dump them as zero lengthKirk McKusick2002-11-301-2/+8
| | | | | | | | | regular files rather than trying to interpret the snapshot. Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=107430
* Use the standardized CHAR_BIT constant instead of NBBY in userland.Mike Barcroft2002-09-251-1/+2
| | | | Notes: svn path=/head/; revision=103949
* Replace various spelling with FALLTHROUGH which is lint()ablePhilippe Charnier2002-08-251-2/+2
| | | | Notes: svn path=/head/; revision=102411
* s/filesystem/file system/g as discussed on -developersTom Rhodes2002-08-211-3/+3
| | | | Notes: svn path=/head/; revision=102231
* Change utimes to set the file creation time (for filesystems thatKirk McKusick2002-07-171-4/+4
| | | | | | | | | | | support creation times such as UFS2) to the value of the modification time if the value of the modification time is older than the current creation time. See utimes(2) for further details. Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=100207
* Oops, the previous revision (1.22) introduced a potential alignmentIan Dowse2002-07-081-15/+20
| | | | | | | | | | | | issue, since the MAXBSIZE-sized buffers are accessed as arrays of block pointers, but were declared as char[] arrays. Use a union to avoid this, which also makes a number of casts unnecessary. Pointed out by: bde Reviewed by: bde Notes: svn path=/head/; revision=99626
* Use a fixed MAXBSIZE-size auto array instead of a static pointerIan Dowse2002-07-081-6/+2
| | | | | | | | | | | | to a malloc'd buffer in dmpindir() and dirindir(). These functions recursively call themselves to handle deeper levels of indirect blocks, so a single static buffer was not suitable. Bug tracked down by: Don Lewis <dl-freebsd@catspoiler.org> Approach suggested by: bde Notes: svn path=/head/; revision=99564
* Replace the use of %qd with intmax_t/%jd and fix a number of -WallIan Dowse2002-07-081-12/+12
| | | | | | | | | | and -Wformat warnings: o Include timeconv.h for the time conversion functions. o Remove unused variables. o Correct a few cases where %d was used when printing longs. Notes: svn path=/head/; revision=99562
* Fix some printf format errors.Ian Dowse2002-07-071-5/+5
| | | | | | | Submitted by: Don Lewis <dl-freebsd@catspoiler.org> Notes: svn path=/head/; revision=99530
* This commit adds basic support for the UFS2 filesystem. The UFS2Kirk McKusick2002-06-211-73/+197
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* s/daddr_t/ufs_daddr_t/gPoul-Henning Kamp2002-06-061-12/+12
| | | | | | | | | This should fix the issues which cropped up after daddr_t grew up. Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=97956
* o remove __PWarner Losh2002-03-201-53/+19
| | | | | | | | o Use ANSI function definitions o unifdef -D__STDC__ Notes: svn path=/head/; revision=92837
* Files in subdirectories of directories that have the nodump flag setDavid E. O'Brien2001-12-051-2/+5
| | | | | | | | | | | | | | | | are sometimes incorrectly being dumped. The problem arises because the subdirectory only gets its entry cleared from usedinomap if it is also present in dumpinomap, and it is the absence of a directory in usedinomap that internally indicates that the directory is under the effects of UF_NODUMP (either directly or inherited). PR: 32414 Submitted by: David C Lawrence <tale@dd.org> Notes: svn path=/head/; revision=87413
* Zap a number of #ifdef sunos blocks, and all of the `register'Ian Dowse2001-11-171-24/+17
| | | | | | | keywords. Notes: svn path=/head/; revision=86473
* Convert two instances of a lseek()+read() combination to a pread().Mike Heffner2001-07-011-8/+4
| | | | | | | | PR: bin/17640 MFC after: 2 weeks Notes: svn path=/head/; revision=79039
* Fix bogon with the nodump flag.Jordan K. Hubbard2001-04-191-5/+10
| | | | | | | Submitted by: Dima Dorfman <dima@unixfreak.org> Notes: svn path=/head/; revision=75689
* Support inheritance of the "nodump" flag down a hierarchy.David E. O'Brien2001-03-031-26/+66
| | | | | | | | Submitted by: Dima Dorfman <dima@unixfreak.org> Obtained from: NetBSD Notes: svn path=/head/; revision=73375
* Add include of errno.h where needed, remove extern int errno where not.Warner Losh2000-04-141-1/+1
| | | | | | | These commits were inspired by a similar commit to netbsd. Notes: svn path=/head/; revision=59216
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50476
* Fix nested if/else within an ifBill Fumerola1999-07-081-2/+3
| | | | Notes: svn path=/head/; revision=48688
* 64bit fixes.Dima Ruban1998-10-271-4/+4
| | | | | | | | | | (Note: ``dump'' doesn't work on alpha yet. Apparently there's a problem somewhere is the physio() area) Submitted by: myself && Matt Dillon. Notes: svn path=/head/; revision=40668
* Correct use of .Nm. Add rcsid. Remove unused #includes.Philippe Charnier1998-06-151-1/+4
| | | | Notes: svn path=/head/; revision=36997
* Merge Lite2 changes (rather bigish, the dump/restore folks should check)Peter Wemm1997-03-111-6/+5
| | | | Notes: svn path=/head/; revision=23672
* Update CHANGEDSINCE macro to conform to -current dinode.hJordan K. Hubbard1997-02-161-5/+0
| | | | Notes: svn path=/head/; revision=22810
* ts_sec -> tv_secNate Williams1996-09-201-1/+1
| | | | | | | ts_nsec -> tv_nsec Notes: svn path=/head/; revision=18410