Commit Graph

244 Commits

Author SHA1 Message Date
jmmv 2a3e5eeb7c Apply the NFS exports list rototill patch:
- Remove all NFS related stuff from file system specific code.
- Drop the vfs_checkexp hook and generalize it in the new nfs_check_export
  function, thus removing redundancy from all file systems.
- Move all NFS export-related stuff from kern/vfs_subr.c to the new
  file sys/nfs/nfs_export.c.  The former was becoming large and its code
  is always compiled, regardless of the build options.  Using the latter,
  the code is only compiled in when NFSSERVER is enabled.  While doing this,
  also make some functions in nfs_subs.c conditional to NFSSERVER.
- Add a new command in nfssvc(2), called NFSSVC_SETEXPORTSLIST, that takes a
  path and a set of export entries.  At the moment it can only clear the
  exports list or append entries, one by one, but it is done in a way that
  allows setting the whole set of entries atomically in the future (see the
  comment in mountd_set_exports_list or in doc/TODO).
- Change mountd(8) to use the nfssvc(2) system call instead of mount(2) so
  that it becomes file system agnostic.  In fact, all this whole thing was
  done to remove a 'XXX' block from this utility!
- Change the mount*, newfs and fsck* userland utilities to not deal with NFS
  exports initialization; done internally by the kernel when initializing
  the NFS support for each file system.
- Implement an interface for VFS (called VFS hooks) so that several kernel
  subsystems can run arbitrary code upon receipt of specific VFS events.
  At the moment, this only provides support for unmount and is used to
  destroy NFS exports lists from the file systems being unmounted, though it
  has room for extension.

Thanks go to yamt@, chs@, thorpej@, wrstuden@ and others for their comments
and advice in the development of this patch.
2005-09-23 12:10:31 +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
dbj 36c3355e33 add code to handle inodes with extended attribute blocks
this is currently turned off with "#ifdef notyet" since the
kernel will not correctly clean up extended attribute blocks on truncation

Originally written by Kirk McKusick and Network Associates Laboratories for
FreeBSD.
2005-06-08 20:34:06 +00:00
dbj ab963542e1 for ufs2, assume FS_44INODEFMT
this is necessary for freebsd compatbility, since they do not initialize
the old field.
2005-06-02 01:23:19 +00:00
lukem 700088dc7f appease gcc -Wuninitialized 2005-06-02 00:38:41 +00:00
christos ae0d3ab2e1 Remove stray " I" from message. 2005-04-30 20:29:56 +00:00
christos f77e3699c8 Dammit, get rid of the debugging abort() calls. It is no fun to have a broken
fsck program on a busted filesystem.
2005-04-30 20:24:32 +00:00
xtraeme 76500fc2f9 WARNS=2 is the default defined in sbin/Makefile.inc. (thanks wiz) 2005-01-20 16:39:22 +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
wiz 442b6cb908 Add -P to usage. 2005-01-19 16:42:14 +00:00
wiz b15d62ff8b Sort options. Bump date for -P. Remove superfluous -. 2005-01-19 16:41:04 +00:00
christos d90f13b3bf Use -DPROGRESS to enable the progress bar, don't depend on SMALL. 2005-01-13 19:56:02 +00:00
christos a73c2bd574 Add a progress meter to fsck_ffs based on the work by thorpej presented
to the mailing lists last January. This is optional.
2005-01-13 15:22:35 +00:00
dsl 09993d7a4e Rewrite getdisklabelpart() to avoid problems with isdigit(*ch_ptr) and
an incorrect check for a (probably impossible) empty string.
Add comments to avoid confusion...
2004-10-29 19:02:17 +00:00
dbj 0f5aab3826 always print warning and return non-zero exit when there are unresolved inconsistencies. 2004-10-11 15:24:09 +00:00
ragge 801400d3c7 Cast to (long long int) to make last change compile on amd64. 2004-10-09 20:08:44 +00:00
dbj 43cd78416c when allocating inodes, such as for the lost+found directory,
extend the inostat array if needed.  Otherwise, inoinfo() will
return the static "unallocated" inode template, which was
getting improperly modified.
Before this fix, any time the lost+found directory got created,
fsck would set all of the inode/directory counts wrong since
suddenly unallocated inodes would turn into directory inodes
2004-10-08 17:33:52 +00:00
dbj 6ca6b809d3 have allocdir fail cleanly when allocino fails 2004-10-08 17:29:29 +00:00
dbj a10669f5c2 if debug, print found/expected block & inode counts when incorrect 2004-10-08 16:42:55 +00:00
mycroft 20f54b189f Reduce memory usage slightly. 2004-07-20 15:05:32 +00:00
wiz 0747ba10a5 Add -a to usage. Closes PR 25916 by Kouichirou Hiratsuka. 2004-06-25 14:50:15 +00:00
mycroft b98bb8c608 Use pread()/pwrite(). 2004-06-12 01:35:46 +00:00
fair 0b112129b9 Correct a misnumbering of options, as noted in PR 25784. 2004-06-02 19:27:24 +00:00
hannken 8c21bc6224 Add ffs internal snapshots. Written by Marshall Kirk McKusick for FreeBSD.
- Not enabled by default. Needs kernel option FFS_SNAPSHOT.
- Change parameters of ffs_blkfree.
- Let the copy-on-write functions return an error so spec_strategy
    may fail if the copy-on-write fails.
- Change genfs_*lock*() to use vp->v_vnlock instead of &vp->v_lock.
- Add flag B_METAONLY to VOP_BALLOC to return indirect block buffer.
- Add a function ffs_checkfreefile needed for snapshot creation.
- Add special handling of snapshot files:
    Snapshots may not be opened for writing and the attributes are read-only.
    Use the mtime as the time this snapshot was taken.
    Deny mtime updates for snapshot files.
- Add function transferlockers to transfer any waiting processes from
  one lock to another.
- Add vfsop VFS_SNAPSHOT to take a snapshot and make it accessible through
  a vnode.
- Add snapshot support to ls, fsck_ffs and dump.

Welcome to 2.0F.

Approved by: Jason R. Thorpe <thorpej@netbsd.org>
2004-05-25 14:54:55 +00:00
wiz 65a50720b0 Various improvements; mostly mention arguments of flags by name to
simplify the description and improve lists.
2004-05-05 14:30:59 +00:00
dbj 78877ce800 fix 64bit bug in chkrange()
problem noticed by nathanw
fix from freebsd
2004-04-26 23:46:22 +00:00
christos 6bd1d6d4db Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
2004-04-21 01:05:31 +00:00
dbj f1e11b338f add support for downgrading a filesystem fslevel from 4 to 3 2004-04-14 17:37:11 +00:00
dbj 0270c91526 set fs_old_nrpos to 1 when doing -c4 upgrade.
This isn't used by kernel, but does affect cg layout slightly
2004-04-14 17:35:19 +00:00
dbj 069e170f1c fix range error when swapping postbl for compatibility 2004-04-13 22:36:36 +00:00
dbj ea34a908d3 fix whitespace in debug printf 2004-04-12 06:28:05 +00:00
dsl 2dc6ea479c Don't use an ffsv1 superblock from 64k (SBLOCK_UFS2) when looking
for the main filesystem superblock.
64k is the offset of the first alternate if the blocksize if 64k.
Fixes part of PR kern/24809
2004-03-21 20:01:41 +00:00
dbj ab48f19cba don't calculate fake superblock used for finding alternate superblocks
if the disklabel is missing the cpg parameter.  Also print a warning
if this is skipped because of a missing fsize, frag or cpg disklabel parameter
this fixes a divide by zero error reported by martin@
2004-01-20 15:29:35 +00:00
dbj 67b7740914 print warning if the user specifies a conversion level greater than implemented 2004-01-17 22:17:07 +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 6300af6ca7 change the message "COVERTING TO FFSv2 SUPERBLOCK" to
"CONVERT TO NEW SUPERBLOCK LAYOUT" to help avoid confusion
2004-01-12 19:40:24 +00:00
mrg 2a3954efe6 - some KNF (80 cols)
- fix a printf format issue
2004-01-10 14:28:37 +00:00
wiz cf9b70c6d4 Update Dd for previous and fix a case. 2004-01-09 23:42:11 +00:00
dbj 8f3b1a3c98 use %#llx instead of %llx when printing incorrect qfmask or qbmask 2004-01-09 22:23:18 +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
jmmv b635f565e7 Homogenize usage messages: make the 'usage' word all lowercase, as this seems
to be the most common practice in our tree.
2004-01-05 23:23:32 +00:00
dbj 1c65fb7cac fix logic for handling symlinks in inodes when isappleufs 2004-01-03 17:56:21 +00:00
dbj 1f5f1d50af when doing both -c 2 and -B, swap the blocks listed in the inode
of symlinks, since the swapping happens before the symlinks
are moved into the inode.
2004-01-03 17:27:35 +00:00
dbj f491995334 fix paste-o in previous commit 2004-01-03 10:25:06 +00:00
dbj f3786e90b7 fix bugs with unsigned comparison ofs fs_maxsymlinklen 2004-01-03 10:11:41 +00:00
dbj 9aad8f72b5 increase size of buffer used for updating symlinks with -c 1
otherwise, the block read will blow the stack
2004-01-03 10:07:02 +00:00