Commit Graph

36 Commits

Author SHA1 Message Date
perseant ff33b3365d Fix spllevel problem with superblock exclusion and with segment write throttle.
May address PR#8383.
1999-11-17 20:08:30 +00:00
fvdl 0b1963121a Add Kirk McKusick's soft updates code to the trunk. Not enabled by
default, as the copyright on the main file (ffs_softdep.c) is such
that is has been put into gnusrc. options SOFTDEP will pull this
in. This code also contains the trickle syncer.

Bump version number to 1.4O
1999-11-15 18:49:07 +00:00
perseant fc5ecbb5a8 Back out my patch of the 8th (to address unreferenced inode problem).
Apparently this needs more thought.
1999-11-12 16:56:48 +00:00
perseant 26c34e715f If ifile blocks were written before dirops were complete, and then the
system crashed, inodes could be allocated that were not referenced.  (Though
not a serious problem, it evidences itself in phase 4 of fsck_lfs.)  Fix
this by marking if_daddr with UNASSIGNED before the inodes are actually
written; at mount time the ifile is checked for UNASSIGNED entries and
any that are found are linked back into the free list.  (The latter
functionality should move into the roll-forward agent when it materializes.)
1999-11-09 02:21:05 +00:00
perseant 3c63d0830f Address ufs_hashlock/ufs_ihashins protocol bug, discovered while doing a
post-mortem of a production machine.  Also, take the active dirop
count off of the fs and make it global (since it is measuring a global
resource) and tie the threshold value LFS_MAXDIROP to desiredvnodes.
1999-11-06 20:33:05 +00:00
mycroft 02781a3483 Fix printf() formats. 1999-10-01 22:07:42 +00:00
perseant c588aaf55f Make changes that will allow an LFS filesystem to be used as the root
filesystem.  In particular,

- Fix mknod deadlock, described in PR 8172.
- Enable lfs_mountroot.
- Make lfs_writevnodes treat filesystems mounted on lfs device nodes properly,
  by flushing that device rather than trying to add blocks to the device inode.

This, in combination with lfs boot blocks, will allow operation of an all-lfs
system.
1999-09-03 22:48:51 +00:00
wrstuden 379a26972f Modify file systems to deal with struct lock in struct vnode. All leaf
fs's other than nfs use genfs_lock() for locking.

Modify lookup routines to set PDIRUNLOCK when they unlock the parrent.
1999-07-08 01:05:58 +00:00
tls 4d649c3adb squash some compiler warnings on debug printfs by casting to int 1999-06-17 22:22:41 +00:00
perseant a818a47169 Minor changes to the segment live bytes calculation. In particular, fixed
a bug in fragment extension that could run the count negative.  Also, don't
overcount for inodes, and don't count segment summaries.  Thus, for empty
segments the live bytes count should now be exactly zero.
1999-06-15 22:25:41 +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 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 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 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
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
mycroft d4026f6eb5 GC the B_CACHE bit. 1998-11-09 01:18:34 +00:00
thorpej 5ecbc50348 Use DINODE_SIZE rather than sizeof(struct dinode). 1998-10-23 00:32:35 +00:00
pk 37109879dc PR#6032: define fixed sized on-disk superblock structure. 1998-09-11 21:27:12 +00:00
kleink d4a8052f98 Fix some arithmetics lossage on typeless pointers. 1998-05-08 18:31:13 +00:00
fvdl e5bc90f40c Merge with Lite2 + local changes 1998-03-01 02:20:01 +00:00
pk 2e8a55e122 TIMESPEC_TO_TIMEVAL => TIMEVAL_TO_TIMESPEC 1997-06-13 08:59:51 +00:00
bouyer 76c414a957 Add support for ext2fs, this needed a few modifications to ufs/ufs/inode.h:
- added an "union inode_ext" to struct inode, for the per-fs extentions.
  For now only ext2fs uses it.
- i_din is now an union:
	union {
		struct  dinode ffs_din; /* 128 bytes of the on-disk dinode. */
		struct ext2fs_dinode e2fs_din; /* 128 bytes of the on-disk dinode. */
	} i_din
  Added a lot of #define i_ffs_* and i_e2fs_* to access the fields.
- Added two macros: FFS_ITIMES and EXT2FS_ITIMES. ITIMES calls the rigth
  macro, depending on the time of the inode. ITIMES is used where necessary,
  FFS_ITIMES and EXT2FS_ITIMES in other places.
1997-06-11 10:09:37 +00:00
christos 90c7de0919 revert previous kprintf changes 1996-10-12 21:58:44 +00:00
christos de1b2b437e printf -> kprintf, sprintf -> ksprintf 1996-10-10 17:16:17 +00:00
mycroft c52352c819 Add a set of generic file system operations that most file systems use.
Also, fix some time stamp bogosities.
1996-09-01 23:47:48 +00:00
christos 7bd9e243f3 lfs prototypes 1996-02-09 22:28:45 +00:00
cgd 0bac4d47b1 C syntax fix, and syscall args style (For later.) 1994-08-21 03:15:32 +00:00
cgd fccfa11af5 New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD' 1994-06-29 06:39:25 +00:00
mycroft 264b874c14 Update to 4.4-Lite fs code, with local changes. 1994-06-08 11:41:58 +00:00