Commit Graph

336 Commits

Author SHA1 Message Date
perseant 6a87896854 Take out the `#ifdef USE_UFSHASH'; use ufs_hashlock to lock the inode free
list instead of free_lock.
1999-04-11 23:24:04 +00:00
perseant 46ae977773 Change the reference to "newlfs" in the CHANGES file to the correct "newfs_lfs" 1999-04-10 18:31:05 +00:00
mycroft 704563569f It was silly to not make this exportable. 1999-04-04 18:15:58 +00:00
mycroft 9e81cc5022 Fix obvious bugs:
* The MNT_UPDATE case had a null pointer dereference.  (This is a good example
  of why blindly adding bogus initializiers is a FUNDAMENTALLY BAD IDEA!)
* Make sure the whole ufsmount is zeroed, as the export code relies on this.
* If we decided to use the second/alternate superblock, make sure to copy the
  in-core version from the right buffer.
Also, reenable NFS exporting.
1999-04-04 09:56:44 +00:00
perseant 7ea5ec6723 Fix buffer handling problems in lfs_vinvalbuf 1999-04-01 23:28:09 +00:00
perseant 4158afaaf3 Add initialization to quell compiler warning (only on some platforms?) 1999-03-30 16:11:43 +00:00
perseant 322fef73ae Move variable initialization to the top of lfs_vflush 1999-03-30 16:03:16 +00:00
perseant 5589f33082 Fix unit mismatch in debugging code in lfs_segclean; also put it properly
within `#ifdef DEBUG_LFS'.
1999-03-29 22:13:07 +00:00
perseant 3e0bf5e0d8 Fix the other missing dirop wakeup 1999-03-29 21:54:26 +00:00
perseant f058684b7f lfs_truncate calls vinvalbuf to invalidate all currently-hald buffers, which
in turn forces a flush of the vnode, whether or not it is involved in a dirop.
(This can happen during a remove or rmdir, when the directory is shrunk.)
Because of the nature of dirops, however, flushing a vnode involved in a dirop
is disallowed (and was marked with a panic).  This patch has lfs_truncate
call a specialized vinvalbuf that only invalidates buffers following the new
end-of-file, and thus does not require a flush.  Also the panic is demoted,
in case I missed any other path to lfs_vflush.
1999-03-29 21:51:38 +00:00
perseant fbc5e63cd6 Make sysctl variable lfs_clean_vnhead do what it was supposed to do,
namely, toggle whether vnodes loaded only for cleaning (as opposed to
normal filesystem use) are freed to the *head* of the vnode free list,
rather than the tail.  This should avoid a possible cache flushing
effect, if the cleaner cleans a segment containing a large number of
live inodes.
1999-03-25 22:38:28 +00:00
perseant cffa290130 Since dirop vnodes can't be flushed, they hold a reference until their
dirop is completely written to disk.  This means that ordinary calls to
ufs vnops which would ordinarily call VOP_INACTIVE through vrele/vput,
don't.  This patch detects that condition after such vnops have been
run, and calls VOP_INACTIVE if it would ordinarily have been called by
the ufs call.
1999-03-25 22:33:03 +00:00
perseant a3748f1cc7 Fixes to make dirops and lfs_vflush play together well. In particular,
if we are short on vnodes, lfs_vflush from another process can grab a
vnode that lfs_markv has already processed but not yet written; but
lfs_markv holds the seglock.  When lfs_vflush gets around to writing it,
the context for copyin is gone.  So, now lfs_markv calls copyin itself,
rather than having lfs_writeseg do it.
1999-03-25 22:26:52 +00:00
perseant 6b51bdc17c Lock buffers with B_BUSY between data checksum calculation and write, so
some other process doesn't change the data after it was checksummed.
1999-03-25 22:02:36 +00:00
perseant 1cacaa295f Change lfs_sb_cksum to use offsetof() instead of an inlined version.
Fix lfs_vref/lfs_vunredf to ignore VXLOCKed vnodes that are also being
flushed.

Improve the debugging messages somewhat.
1999-03-25 21:54:10 +00:00
perseant e6ef2d67dd clean up unused/required #ifdefs 1999-03-25 21:39:18 +00:00
tron 057ae88da9 Don't include "opt_uvm.h" any more. 1999-03-24 11:05:31 +00:00
mrg d2397ac5f7 completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
1999-03-24 05:50:49 +00:00
kleink 9ee75a4fcc Add _PC_FILESIZEBITS to pathconf vnop. 1999-03-22 19:21:07 +00:00
perseant d1afff4165 Move dlfs_pad to the end of struct dlfs (after the pad), for upward
compatibility.
1999-03-17 18:38:34 +00:00
perseant c5fb3ffb03 Fix pad on lfs.h so it is really 512 bytes, as advertized 1999-03-17 16:49:00 +00:00
perseant e1c9a578a8 New CHANGES files that describes briefly all nontrivial changes made to
the LFS since the 4.4lite2 code was merged into NetBSD.

TODO updated to remove everything marked DONE in 4.4, and add in a list
of more current things to do.

Get rid of comments about the cleaner syscall code and missing fragment
support from README.
1999-03-15 00:46:47 +00:00
chs 462ac41141 if an mfs i/o is successful, set b_resid to 0.
this allows the vnd driver to work on mfs files.
1999-03-15 00:18:24 +00:00
perseant 1b8f5ea3c3 New sources should leave the LFS in a more-or-less working state. Changes
include:

	- DIROP segregation is enabled, and greater care is taken
	  to make sure that a checkpoint completes.  Fsck is not
	  needed to remount the filesystem.
	- Several checks to make sure that the LFS subsystem does not
	  overuse various resources (memory, in particular).
	- The cleaner routines, lfs_markv in particular, are completely
	  rewritten.  A buffer overflow is removed.  Greater care is taken
	  to ensure that inodes come from where lfs_cleanerd say they come
	  from (so we know nothing has changed since lfs_bmapv was called).
	- Fragment allocation is fixed, so that writes beyond end-of-file
	  do the right thing.
1999-03-10 00:20:00 +00:00
perseant 414152aa79 Added flags to lfs_check call 1999-03-10 00:00:32 +00:00
perseant 9dceca5347 Add IN_CLEANING flag for LFS 1999-03-09 23:57:14 +00:00
mycroft b174019ccc Pass null pointers to VOP_UPDATE rather than having all the callers fetch the
current time themselves.
1999-03-05 21:09:48 +00:00
mycroft 86ed73efb4 Permit the access and modify time pointers passed to VOP_UPDATE to be null,
meaning the current time.
1999-03-05 20:47:06 +00:00
bouyer 00d7241e81 Don't check fs_bsize before the superblock has been swapped if needed.
Check value of sbsize before allocating memory with this value.
1999-03-05 12:02:18 +00:00
wrstuden 862a56e88b Modify vfsops to seperate vfs_fhtovp() into two routines. vfs_fhtovp() now
only handles the file handle to vnode conversion, and a new call,
vfs_checkexp(), performs the export verification.
1999-02-26 23:44:43 +00:00
mrg b3d5e1889f pull across patches from warner losh <imp@freebsd.org> (freebsd ufs_vnops.c
versions 1.109&1.110), adjusted for our ext2fs support, and also commited
there also.  this avoids overflowing the link count.
1999-02-26 07:30:00 +00:00
bouyer 36a5fdb528 Some new fields in the ext2fs superblock, from Tim Shepard.
While I'm there, reformat this file a bit.
1999-02-17 13:09:43 +00:00
thorpej a4376d6a58 Fix printf format problems on Alpha. 1999-02-12 01:38:38 +00:00
bouyer 22d556f6cf Make sure a buffer optained from bread() is always bresle()'d in case of
error. Closes PR kern/1448 from Wolfgang Solfrank.
1999-02-10 13:14:08 +00:00
bouyer dc306354b0 Move the bswap functions from libutil to libc (this bups the
minor of libc and the major of libutil). For little-endian architectures
merge the bnswap() assembly versions with nto* and hton* using symbols
aliasing. Use symbol renaming for the bswap function in this case to avoid
namespace pollution.
Declare bswap* in machine/bswap.h, not machine/endian.h. For little-endian
machines, common code for inline macros go in machine/byte_swap.h
Sync libkern with libc.
Adjust #include in kernel sources for machine/bswap.h.
1999-01-15 13:31:15 +00:00
bouyer cdbe530495 No need to #include malloc.h here. 1998-12-04 11:02:30 +00:00
bouyer 3efc699962 Sanity check a few values in the superblock, to avoid mallocing huge
memory area if we try to mount a corrupted filesystem. Fixes kern/3933.
1998-12-04 11:00:40 +00:00
bouyer 4787b2ea75 - intentation
- sync LK_* flags with ffs/ufs
1998-12-02 10:44:52 +00:00
kenh cbc0f73bee Update device special file modification times if NODEVMTIME isn't set. 1998-12-01 23:18:48 +00:00
bouyer bef8c343db In ext2fs_sync(), don't flush the vnode if vput() returned an error. Fixes
PR kern/6495.
1998-12-01 14:37:44 +00:00
thorpej 1fcae7f1be defopt FFS_EI 1998-11-12 19:51:10 +00:00
mycroft d4026f6eb5 GC the B_CACHE bit. 1998-11-09 01:18:34 +00:00
cgd 515148e0a3 cast arg to dbtob to u_quad_t; consisent, and fixed size unnecessary 1998-11-06 23:03:06 +00:00
cgd af24dfc946 argument to dbtob needs to be cast to u_quad_t here to avoid shift lossage 1998-11-06 23:02:12 +00:00
mycroft 1a5b9c6c30 Do not corrupt file flags when file system is full! 1998-10-27 21:32:58 +00:00
thorpej 978c3d97f5 For consistency w/ FFS/LFS, define EXT2_DINODE_SIZE, and use it instead
of pointer arithmetic and/or sizeof(struct ext2fs_dinode).
1998-10-23 00:33:23 +00:00
thorpej 5ecbc50348 Use DINODE_SIZE rather than sizeof(struct dinode). 1998-10-23 00:32:35 +00:00
thorpej f7948d05a1 Use DINODE_SIZE rather than pointer arithmetic. 1998-10-23 00:31:28 +00:00
thorpej c8a2232a27 Define a symbolic constant to represent the size of a dinode. 1998-10-23 00:28:45 +00:00
christos e62c8fd824 Missed a conditional for FFS_EI; appears when we compile without -Ox 1998-10-04 18:07:57 +00:00
bouyer 5440442505 Not time to #include <machine/bswap.h>m, it will come with the move
of bswap*() from libutil to libc.  Sorry !
1998-09-30 09:08:16 +00:00
bouyer b10470bc11 #include opt_uvm.h only if _KENREL and !_LKM
Make ext2fs_init() call ufs_init(). it was doing the init by itself,
testing for extern done != 0. This bug was hidden by the fact that
ext2fs_init() is called before ffs_init().
1998-09-29 10:24:57 +00:00
pk 3059ae05ba Apply patch from PR#5542: buffer overflow in lfs_markv(). 1998-09-15 10:53:22 +00:00
christos 361a71f864 Fix copyright '\t' -> ' ' 1998-09-13 15:14:40 +00:00
pk 37109879dc PR#6032: define fixed sized on-disk superblock structure. 1998-09-11 21:27:12 +00:00
fvdl 077a042a3f Fix some maxsymlinklen comparisons for old filesystems that were
wrong after the byteswap changes.
1998-09-08 08:37:12 +00:00
fvdl 8fe5a08b64 Correct maxsymlink comparison for old filesystems that was clobbered in
byteswap changes.
1998-09-08 08:21:12 +00:00
kenh 466e22e1b7 Add a NODEVMTIME compile-time option. This will inhibit the updating
of modification times on device special files.  Probably only useful
for low-power systems.
1998-09-04 16:04:26 +00:00
thorpej 38cf17f475 Use the pool allocator and the "nointr" pool page allocator for LFS inodes. 1998-09-01 03:26:05 +00:00
thorpej 3ae149efac Use the pool allocator and "nointr" pool page allocator for ext2fs inodes. 1998-09-01 03:20:46 +00:00
thorpej 60cfe320cc Use the pool allocator and the "nointr" pool page allocator for FFS inodes.
XXX MFS also comes in here for inodes, and used a different malloc type,
but the structure is the same, so we just use the FFS inode pool.
1998-09-01 03:11:08 +00:00
rvb 7e0aabe421 Remove v_type != DIR check. First, vn_readdir already does
this check, before calling VOP_READDIR.  Second, vn_readdir
returns a different error even.  Finally, some FS's might
want to write their directories into files that look like
BSD directories and then have ufs_readdir parse them.
1998-08-30 00:16:04 +00:00
thorpej 9f42788795 Add some braces to make egcs happy. 1998-08-25 04:43:46 +00:00
thorpej 39f683419f Back out part of last change (uninitialized work-around). 1998-08-18 18:15:41 +00:00
thorpej 6fc90a1a4d Add some braces to make egcs happy (ambiguous else warning). Also,
deal with bogus uninitialized warning (__noreturn__ related)
1998-08-18 06:47:53 +00:00
matthias 574106c52b create miscfs/genfs/genfs_vnops.c:genfs_enoioctl and make all the other
filesystems use it instead of a private version.
1998-08-10 08:11:10 +00:00
perry 27ca6798df bzero->memset, bcopy->memcpy, bcmp->memcmp 1998-08-09 20:15:38 +00:00
mrg 5d236ade07 minr KNF nit .. 1998-08-09 03:16:23 +00:00
kleink 12a866151b Recognize _PC_SYNC_IO. 1998-08-03 14:19:57 +00:00
kleink 933111f98f Implement support for IEEE Std 1003.1b-1993 synchronous I/O:
* in the read vnode operator, check for IO_SYNC being set in the ioflag and
  synchronously update the file's meta-data if appropriate.
* in the write vnode operator, update the appropriate checks for IO_SYNC being
  set in the ioflag to reflect that IO_DSYNC is now inclusive-or'ed into
  IO_SYNC, and require all IO_SYNC bits to be set for operations defined by
  synchronized I/O file integrity completion but not by synchronized I/O data
  integrity completion.
1998-08-02 18:57:23 +00:00
mjacob d0aa61ad21 fix to accomodate change in vn_rdwr prototype 1998-07-28 20:37:33 +00:00
thorpej 6326c90134 Change the "aresid" argument of vn_rdwr() from an int * to a size_t *,
to match the new uio_resid type.
1998-07-28 18:37:47 +00:00
thorpej e95c22ee96 Don't cast the null residual pointer passed to vn_rdwr(). 1998-07-28 18:17:34 +00:00
drochner 2dcc522f1d The fragtbl[], inside[] and around[] variables are needed by "fsck",
so we can't put them inside "#ifdef _KERNEL".
Put declarations inside .c files where needed to preserve namespace.
1998-07-28 17:30:01 +00:00
mycroft 829367f279 Omit some externs if not _KERNEL. 1998-07-28 04:17:51 +00:00
jonathan d275e56dee * defopt COMPAT_{09,10,11,12,13} and COMPAT_NOMID.
TODO: revisit interaction between native compat and emul compat usage.
1998-07-05 08:49:30 +00:00
thorpej 0f66e53c03 Use genfs_lease_check() 1998-06-25 22:20:39 +00:00
sommerfe 7ba7fbbb23 Always include fifos; "not an option any more". 1998-06-24 20:58:44 +00:00
sommerfe 76f1116825 Don't include opt_fifo.h if not kernel... 1998-06-23 23:15:50 +00:00
sommerfe becaafeea0 defopt for options FIFO 1998-06-22 22:00:59 +00:00
mrg 670c3dfa60 splify UVM #ifdef. 1998-06-20 13:14:53 +00:00
kleink 2d869bbacf KNF, mostly of FFS_EI changes. 1998-06-13 16:26:22 +00:00
cgd 651b44e211 Rework the way kernel include files are installed. In the new method,
as with user-land programs, include files are installed by each directory
in the tree that has includes to install.  (This allows more flexibility
as to what gets installed, makes 'partial installs' easier, and gives us
more options as to which machines' includes get installed at any given
time.)  The old SYS_INCLUDES={symlinks,copies} behaviours are _both_
still supported, though at least one bug in the 'symlinks' case is
fixed by this change.  Include files can't be build before installation,
so directories that have includes as targets (e.g. dev/pci) have to move
those targets into a different Makefile.
1998-06-12 23:22:30 +00:00
kleink 74ce7ac984 KNF: only include one of <sys/{param,types}.h>, not both. 1998-06-10 15:57:39 +00:00
scottr 7171cca4b8 Protect various config(8)-generated files from inclusion while
building LKMs.  Fixes PR 5557.
1998-06-09 07:46:31 +00:00
mikel c1f8034333 ffs_ -> ext2fs_ in warning; art@openbsd.org 1998-06-09 06:33:22 +00:00
ragge 1a66918fc0 Wrong include file order; caused compile error on vax. 1998-06-08 17:59:08 +00:00
scottr d48f258f90 Use the newly-defined opt_quota.h. 1998-06-08 04:27:50 +00:00
kleink 382743ada3 Convert fsync vnode operator implementations and usage from the old `waitfor'
argument and MNT_WAIT/MNT_NOWAIT to `flags' and FSYNC_WAIT.
1998-06-05 19:53:00 +00:00
kleink d4a8052f98 Fix some arithmetics lossage on typeless pointers. 1998-05-08 18:31:13 +00:00
ross ac5774c288 Fix a 64-bit pointer/int warning. 1998-03-19 03:42:35 +00:00
bouyer 091dafd39f Add support for reading/writing FFS in non-native byte order, conditioned
to "options FFS_EI". The superblock and inodes (without blk addr) are
byteswapped at disk read/write time, other metadatas are byteswapped
when used (as they are acceeded directly in the buffer cache).
This required the addition of a "um_flags" field to struct ufsmount.
ffs_bswap.c contains superblock and inode byteswap routines also used
by userland utilities.
1998-03-18 15:57:26 +00:00
kleink 5cf59ee9ad Move the permission check in vfs_syscalls.c::change_owner() back to
ufs_chown() again - the facility required in this context would be a
filesystem-specific super-user determination, which is not available yet.
1998-03-10 11:56:40 +00:00
cgd c35a34ab68 ext2fs_checkoverlap is (or at least seems) unused, and its prototype is
#ifdef DIAGNOSTIC.  Make the function #ifdef DIAGNOSTIC, as well, so we
don't get a warning about the function declaration not being a prototype.
1998-03-04 06:50:25 +00:00
drochner 22dbd3c3da Don't cast the quad_t file size to u_long, this can cause overflows. 1998-03-03 09:02:51 +00:00
fvdl 221505c12f Make this compile again with UVM 1998-03-03 01:49:21 +00:00
fvdl e5209f31b8 A cookie should point to the *next* entry. Grrr. 1998-03-02 22:26:14 +00:00
bouyer 6d339338e6 Close kern/5077: When DIAGNOSTIC is defined, don't complain about
bad magic numbers at a mount attempt. A message is still printed when the
magic number is OK, but the version number or the block size is bad.
Patch from Soren S. Jorvang, but different from the one in the PR.
1998-03-02 16:13:42 +00:00
fvdl d201db498e Remove accidentally enabled lfs_mountroot from vfsops struct. 1998-03-01 22:16:39 +00:00
fvdl 8c7c2ea123 Remove accidentally enabled mfs_mountroot from vfsops struct. 1998-03-01 22:16:01 +00:00