Commit Graph

299 Commits

Author SHA1 Message Date
scottr bdd60e98f9 Include opt_ddb.h so we will get the Debugger() prototype. 1999-05-04 00:35:37 +00:00
perseant 4427f80b15 Other half of the ufs_hashlock locking fix (oops) 1999-04-16 16:23:46 +00:00
perseant 2d12a2d41d Fix locking panic on ufs_hashlock 1999-04-16 00:41:58 +00:00
perseant 40458c9d34 Fix lost lock in lfs_markv -- a typo-class bug, obvious when you look at it. 1999-04-14 19:37:28 +00:00
perseant 40cebde457 Check the superblock version field, and refuse to mount the filesystem
if the version number is higher than we know about.  This allows, e.g.,
changes in the format of the ifile, segment size restrictions and boundaries,
etc., which would not affect existing fields in the superblock, but which
would drastically affect the filesystem, to be smoothly integrated at a
later date.
1999-04-12 00:47:17 +00:00
perseant 65ba757424 Improve the debugging printfs in the cleaner syscalls (in particular, make
it obvious that they're coming from lfs).
1999-04-12 00:40:06 +00:00
perseant 8d72b3204a Disallow threshold-initiated cache flush when dirops are active. Also, make
SET_ENDOP use lfs_check instead of inlining most of it.
1999-04-12 00:36:47 +00:00
perseant a520288478 Fix block counting during file truncation, if not truncating to zero. 1999-04-12 00:30:08 +00:00
perseant bffea14a3f Make sure that the wakeup occurs for vnodes that lfs_update might be sleeping
on (nodes which are not marked IN_MODIFIED/IN_CLEANING, but which have dirty
buffers), by marking them with the appropriate flag if dirtybuffers were added
while the write was in progress.
1999-04-12 00:25:13 +00:00
perseant e6b7726c9a Better checking for held inode locks in lfs_fastvget, for a number of error
conditions.  Also change the default setting of lfs_clean_vnhead to 0, which
seems to make the locking problems go away (although this is difficult to
test as I can't reliably reproduce them).
1999-04-12 00:11:01 +00:00
perseant 7221719dc7 Fix "lfs_ifind: dinode xxx not found" panic. When inodes were freed,
then immediately reloaded, their dinodes were located in an inode block
which was not on disk at the advertized location, nor in the cache (although
it would be flushed to disk next segment write).  Fix this by using getblk()
instead of lfs_newbuf() for inode blocks.
1999-04-12 00:04:21 +00:00
perseant 97c6743666 Fix inode reporting in lfs_statfs (the meaning of f_files and f_ffree was
reversed).
1999-04-11 23:58:17 +00:00
perseant d24ffa7077 Mark the current segment with SEGUSE_ACTIVE at mount time, rather than waiting
for the first write.  If this is not done, the cleaner may try to clean the
current segment out from under the writer if the filesystem is mounted after
a crash (or any other time that the dirty:clean segment ration is high enough).
1999-04-11 23:31:09 +00:00
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