Commit Graph

412 Commits

Author SHA1 Message Date
perseant 4be4b8ad47 Don't try to inactivate dirop vnodes that are still in the middle of
their dirop.
2000-06-06 22:56:54 +00:00
perseant 9139045320 Protect inode free list with seglock, instead of separate lock, so that
the head of the inode free list (on the superblock) always matches the
rest of the free list (in the ifile).

Protect lfs_fragextend with seglock, to prevent the segment byte count
fudging from making its way to disk.

Don't try to inactivate dirop vnodes that are still in the middle of
their dirop (may address PR#10285).
2000-06-06 20:19:14 +00:00
fredb ef3785c36a Make this build. (Balance parenthesis. 2000-05-31 03:37:34 +00:00
perseant 61861bace5 update for IN_ACCESSED changes 2000-05-31 01:40:01 +00:00
mycroft 719d6db0e2 Adjust where IN_MODIFIED and IN_ACCESSED are cleared (as in the FFS code). 2000-05-30 19:09:44 +00:00
mycroft 70ac5e4326 Back out previous kluge. 2000-05-30 17:40:12 +00:00
mycroft 64f5a574a7 In ffs_update():
* Move the clearing of IN_MODIFIED and IN_ACCESSED later, so they are not
  cleared if the bread() failed.
* Explicitly set waitfor to 0 in the softdep case, if IN_MODIFIED is not
  set (mirroring the bwrite()/bdwrite() decision).
2000-05-30 17:23:52 +00:00
fvdl f0112539bd Mark an inode as changed after a rename. It wasn't before in the softdep
case, which created inodes with dependencies, but no IN_* flag set,
so the dependencies were never flushed (after the waitfor check in
ffs_update was removed).
2000-05-30 15:22:12 +00:00
perseant ae7e580ebd Don't try to "correct" accounting for fragments being extended but which
have never been written to disk.
2000-05-30 04:08:41 +00:00
mycroft 4db674fa50 According to Frank, buffers with dependencies *are* left on v_dirtyblks, so
remove the FSYNC_RECLAIM check and force them to be flushed.
2000-05-29 18:53:35 +00:00
mycroft ced05c5744 Pull in IN_ACCESSED changes and some MNT_LAZY `bug fixes' from FFS to EXT2FS. 2000-05-29 18:41:07 +00:00
mycroft 33ec489188 Pull in IN_ACCESSED changes and some MNT_LAZY `bug fixes' from FFS. 2000-05-29 18:34:36 +00:00
mycroft edfd1e6f32 Use LIST_{FIRST,NEXT,EMPTY}(). 2000-05-29 18:28:48 +00:00
mycroft d747ada9c2 Add a new inode flags called IN_ACCESSED. This used in place of IN_MODIFIED
to record that the atime was updated.  In ffs_update(), we only do synchronous
writes if something *other* than the atime was changed.
2000-05-29 18:04:30 +00:00
mycroft 941524439a Never call softdep_sync_metadata() in the FSYNC_RECLAIM case. Any pending
blocks are detached from the vnode at this point.  When the dependencies are
broken to enable writing the blocks, the vnode will be regenerated.  (The only
reason we sync buffers in this case is that they have to be detached from the
vnode.)
2000-05-29 17:19:20 +00:00
mycroft c47adf55e0 In ffs_fsync(), remove the FSYNC_RECLAIM special case, so that it properly
waits for pending buffers, and doesn't throw away time stamp updates.
2000-05-29 17:12:06 +00:00
mycroft ccf1cf4b69 MNT_WAIT -> FSYNC_WAIT 2000-05-29 16:28:27 +00:00
mycroft dad58e313b Pull in indirect block unwind code from FFS. 2000-05-28 08:44:32 +00:00
mycroft 1ea529f6df DTRT when unwinding multiple levels. 2000-05-28 08:31:41 +00:00
mycroft 4fc7b946c2 When unwinding a failed allocation, make sure to nuke the unwound block from
the vnode's block list.  This fixes `itrunc3' panics (at least in some cases;
further testing is needed) and prevents further lossage later on.
2000-05-28 08:15:40 +00:00
mycroft 4656dfd24f Add a new function to remove extra buffers when truncating a file. This is
more generic than the vinvalbuf(V_SAVEMETA) case, avoiding synchronous
operations when truncating to a non-zero length.
2000-05-28 04:13:56 +00:00
thorpej 21fc65e1a8 sleep() -> tsleep() 2000-05-27 04:52:27 +00:00
perseant 29f616cebe Prevent dirops from getting around lfs_check and wedging the buffer cache.
All the dirop vnops now mark the inodes with a new flag, IN_ADIROP, which
is removed as soon as the dirop is done (as opposed to VDIROP which stays
until the file is written).  To address one issue raised in PR#9357.
2000-05-27 00:19:52 +00:00
thorpej 7b6dd5a1c9 In chkdq(), check for NOCRED. Should fix port-alpha/10147. 2000-05-20 03:25:14 +00:00
thorpej 5026e056e2 Back out previous change; there is something Seriously Wrong. 2000-05-19 20:42:20 +00:00
thorpej f636538446 NULL != 0 2000-05-19 04:34:39 +00:00
thorpej dd494c1a6c Redo the way MFS does I/O to the server's address space. Instead of
queueing up buffers and awakening the MFS server process to do the I/O,
we do the I/O to the server process's address space directly using
facilities provided by UVM.

This makes it possible for buffers attempting to flush out while the
MFS is being unmounted to actually do the I/O, where before it would
fail if the server process wasn't in the MFS idle loop (i.e. had been
signaled and was attempting to exit).

Should fix kern/10122 (I can no longer reproduce the problem described
in the PR when running with these changes), and any number of other
MFS-related complaints made by people over time.
2000-05-16 17:20:23 +00:00
thorpej 6d7f14dc5d Record the proc directly, not the pid, of the MFS server process,
and nuke the spare fields in the mfsnode.
2000-05-16 00:24:08 +00:00
bouyer 1900598507 Sync copyrigth notice. 2000-05-15 08:51:55 +00:00
perseant f0728fdce1 Change the sementics of the last parameter from a boolean ("waitfor") to
a set of flags ("flags").  Two flags are defined, UPDATE_WAIT and
UPDATE_DIROP.

Under the old semantics, VOP_UPDATE would block if waitfor were set,
under the assumption that directory operations should be done
synchronously.  At least LFS and FFS+softdep do not make this
assumption; FFS+softdep got around the problem by enclosing all relevant
calls to VOP_UPDATE in a "if(!DOINGSOFTDEP(vp))", while LFS simply
ignored waitfor, one of the reasons why NFS-serving an LFS filesystem
did not work properly.

Under the new semantics, the UPDATE_DIROP flag is a hint to the
fs-specific update routine that the call comes from a dirop routine, and
should be wait for, or not, accordingly.

Closes PR#8996.
2000-05-13 23:43:06 +00:00
perseant bcbb008f63 stop vnode reference leak introduced in patch to PR#9994 2000-05-10 16:47:01 +00:00
perseant 737dec82d6 Change the way LFS does block accounting, from trying to infer from the
buffer cache flags, to marking the inode and/or indirect blocks with a
special disk address UNWRITTEN==-2 when a block is accounted for.  (This
address is never written to disk, but only used in-core.  This is essentially
the same method of block accounting as on the UBC branch, where the buffer
headers don't exist.)  Make sure that truncation is handled properly,
especially in the case of holey files.

Fixes PR#9994.
2000-05-05 20:59:20 +00:00
perseant 37f567639c Test whether the filesystem is an LFS before trying to read the alternate
superblock (whose disk address is stored in the primary superblock).  Also,
refuse to mount a filesystem whose superblocks overlap or where the alt.
superblock has a lower disk address than the primary superblock.

Solves PR#10001.
2000-04-29 00:23:00 +00:00
perseant 4ea5a53003 get rid of unused variable aflags 2000-04-24 19:07:16 +00:00
perseant eedb742e6e Fix problems outlined in PR#9926:
- lfs_truncate extends the file if called with length > i_ffs_size;
    - lfs_truncate errors out if called with length < 0;
	- lfs_balloc block accounting corrected for the case of blocks read
	  into the cache before they exist on disk;
	- mp->mnt_stat.f_iosize is initialized in lfs_mountfs.
2000-04-23 21:10:26 +00:00
jdolecek c78399fc88 Add a new sysctl variable vfs.ffs.log_changeopt - if this is true,
an optimalization strategy change is logged into syslog. Default
is 0 (to not log). This replaces the recent not quite "right"
change to only log the change if kernel is compiled with DEBUG.
2000-04-04 09:23:20 +00:00
augustss 169ac5b3c1 Remove register declarations. 2000-03-30 12:41:09 +00:00
simonb e4f5c09322 Delete redundant decls of fifo_vnodeop_p - it's in <miscfs/fifofs/fifo.h>.
Don't need <sys/conf.h> here.
2000-03-30 02:49:11 +00:00
simonb c2e5560a03 Delete redundant decls of rootvp - it's in <sys/systm.h>.
Delete redundant decl of ffs_sbupdate() - it's in <ufs/ffs/ffs_extern.h>.
2000-03-30 02:48:22 +00:00
jdolecek a6cb6fe4ee Log the optimization changes only if DEBUG. Fixes kern/9697 2000-03-29 08:46:57 +00:00
simonb bd11640b2c Remove redundant decl of rootvp - it's in <sys/systm.h>. 2000-03-29 04:03:08 +00:00
simonb 0fd09c8496 Don't need to include <sys/conf.h> here. 2000-03-29 03:43:33 +00:00
thorpej fa7d868ade Small cosmetic change. 2000-03-22 01:03:33 +00:00
fvdl 512503c606 If we're reclaiming, and there are no dirty blocks, just return. 2000-03-17 01:26:52 +00:00
jdolecek 67d0de97b6 Change ufs_init() to keep global count of how many times it was called.
Resources are initialized still just once (on first call).

Add ufs_done(), which takes care of freeing all resources allocated in
ufs_init(). The resources are freed only when last user of the code exits.
2000-03-16 18:26:49 +00:00
jdolecek 03efc0b2b7 Add new VFS op routine - vfs_done and call it on filesystem detach
in vfs_detach(). vfs_done may free global filesystem's resources,
typically those allocated in respective filesystem's init function.
Needed so those filesystems which went in via LKM have a chance to
clean after themselves before unloading.

For each leaf filesystem, add appropriate vfs_done routine.

Also remember how many times ffs_init() was called and do
the appropriate initialization on first call only. In ffs_done(),
destroy the resources when called by the last user of ffs code.
Change mfs to call ffs_init()/ffs_done() appropriately.
2000-03-16 18:20:06 +00:00
jdolecek 89015c4648 Add new VFS op routine - vfs_done and call it on filesystem detach
in vfs_detach(). vfs_done may free global filesystem's resources,
typically those allocated in respective filesystem's init function.
Needed so those filesystems which went in via LKM have a chance to
clean after themselves before unloading. This fixes random panics
when LKM for filesystem using pools was loaded and unloaded several
times.

For each leaf filesystem, add appropriate vfs_done routine.
2000-03-16 18:08:17 +00:00
fvdl 1c78f3708b Inititalize the fs variable struct a little earlier to avoid referencing
a bad pointer in a printf. Problem reported by Krister Walfridsson.
2000-03-16 10:37:00 +00:00
fvdl e3dbad5a3c Revert this back to 2 revisions ago, these checks are done higher up now. 2000-03-15 16:31:52 +00:00
fvdl 563d336e44 Don't immediately return in ffs_fsync if there appears to be no data
to flush if it's a vnode on a softdep filesystem. softdep_sync_metadata
may still need to do some work.
2000-03-14 13:06:29 +00:00