Commit Graph

639 Commits

Author SHA1 Message Date
chs 94cfc87907 bring in the change from FreeBSD's rev. 1.107 of this file:
date: 2002/02/07 00:54:32;  author: mckusick;  state: Exp;  lines: +10 -7
  Occationally deleted files would hang around for hours or days
  without being reclaimed. This bug was introduced in revision 1.95
  dealing with filenames placed in newly allocated directory blocks,
  thus is not present in 4.X systems. The bug is triggered when a
  new entry is made in a directory after the data block containing
  the original new entry has been written, but before the inode
  that references the data block has been written.

  Submitted by:   Bill Fenner <fenner@research.att.com>

This should fix NetBSD PR 15531.
2002-02-10 18:06:03 +00:00
lukem caa29fae38 #undef DIRBLKSIZ before #define-ing it 2002-02-06 15:44:49 +00:00
perseant 8ded9a2c7d Correct free list tail pointer, when adding blocks of new inodes to v2
filesystems.  Should fix PR #14408.
2002-02-04 03:32:16 +00:00
chs eecf9e208a fix PR 15299 by making MFS filesystems not be "async".
in the longer term, MFS needs to be made a lot more VM-friendly.
2002-02-03 03:51:57 +00:00
tv 880a2cf970 These sources are pulled into makefs(8), so we need config.h and protection
for __KERNEL_RCSID().
2002-01-31 19:19:22 +00:00
tv 5d28098c5b Revert previous. This is actually being done a better way. 2002-01-31 19:18:18 +00:00
tv 8ec192426e For makefs, only include <machine/bswap.h> if it exists. 2002-01-31 19:17:02 +00:00
tv af3dca1ea8 #undef MAXNAMLEN before defining it; this lets ufs/ufs/dir.h be used
properly on non-NetBSD hosts with makefs(8).
2002-01-31 19:16:34 +00:00
chs 1b454dbb4f fix an error case. 2002-01-26 08:32:05 +00:00
enami ac35ac58f5 - For CIRCLEQ, comparing the loop variable against NULL doesn't make sense.
- Minor KNF while I'm here.

# This doesn't fix real problems though.
2002-01-18 00:30:03 +00:00
enami 9ad4436bc2 Fix typo which prevents diagnostic test from working. 2002-01-16 08:33:12 +00:00
lukem 25ca00a979 Only pull in <sys/systm.h> #ifdef _KERNEL, since it's a kernel only header.
In the ! _KERNEL case, provide own prototype for panic() instead.
2002-01-09 23:51:00 +00:00
lukem 202e920175 revert part of rev 1.14 - #include <ufs/ufs/dinode.h> - because that
makes it MUCH more difficult to reference this file stand-alone.
2002-01-07 15:25:22 +00:00
thorpej fdb5b56e5f Do not compare an integer to NULL. 2001-12-31 21:37:22 +00:00
fvdl a833eaf1fe XXXX temporary measure: in the case of a softdep 'unmount pending error',
do not mark the filesystem clean, as this will mean that one or more
     files were likely not completely removed (will show up as unconnected
     in fsck). Prevents filesystems from being marked clean while they're
     not until this problem has been figured out.
2001-12-30 15:46:53 +00:00
fvdl d0f7c6fb96 Use softdep_change_linkcnt to note that the inode mode was set to 0.
From FreeBSD.
2001-12-27 01:48:38 +00:00
fvdl c9218f8686 The softdep code sometimes use vfs_vget .. vput. For removals, these
would result in a vop_inactive call for the vnode each time, resulting
in vinvalbuf->fsync. The original softdep code avoided the fsync
in vinvalbuf by not calling it if there were no dirty blocks. This
was changed in NetBSD. Also, flush_inodedeps was changed to mark
the inode as modified so that it would do an inode update and flush the
last one. This combination basically caused a sync write for each removed
file in an rm -rf (showing up delayed from the syncer a lot of the time).

If called from vinvalbuf (FSYNC_RECLAIM), and there were no dirty blocks
or pages to begin with, still do everything as normal, so that possible dirty
blocks in transit to disk are properly waited for, etc, but don't pass
UPDATE_WAIT to VOP_UPDATE, since there is no need for it in that case.
2001-12-27 01:44:59 +00:00
fvdl 2b5fe12a98 Pull over one missed fix from FreeBSD wrt. running out of quota. Also
reshuffle some code a bit to make it look more similar (no functional
change).
2001-12-27 01:29:05 +00:00
fvdl 08f29df58c As pointed out by mycroft and reflected in the comment, update the
directory inode before creating the new entry (not the freshly alloced
directory which isn't linked anywhere yet).
2001-12-23 16:16:59 +00:00
fvdl 983d322c7c Fix botch in my original softdep code merge: remove redundant (and
synchronous to boot) VOP_UPDATE call.
2001-12-23 14:00:21 +00:00
fvdl f1db177e10 Fix from FreeBSD that I missed: speed up handling of short-lived
files a bit.
2001-12-23 11:54:46 +00:00
chs 2ddcad30f6 process the delayed-free queue more often. 2001-12-23 08:53:46 +00:00
fvdl 68728c0901 ffs_reload may be called after an old fsck has run, and the pending*
fields may not be zero. Just reset them silently, it's not an error.
2001-12-19 15:20:19 +00:00
fvdl 3d8b2ffe36 Bring over fixes from FreeBSD that weren't incorporated yet, mainly
from Kirk McKusick. They implement taking pending block/inode frees
into account for the sake of correct statfs() numbers, and adding
a new softdep type (newdirblk) to correctly handle newly allocated
directory blocks.

Minor additional changes: 1) swap the newly introduced fs_pendinginodes
and fs_pendingblock fields in ffs_sb_swap, and 2) declare lkt_held
in the debug version of the softdep lock structure volatile, as it
can be modified from interrupt context #ifdef DEBUG.
2001-12-18 10:57:21 +00:00
chs 0d70d731c2 use the new compatibility routines to allow mmap() to work
(in the same non-coherent fashion that it worked pre-UBC)
until someone has time to do it the right way.
2001-12-18 07:51:16 +00:00
chs 03dd7ce1e8 when truncating a file, make sure the last block of the file is actually
allocated, since other parts of the code assume this.
2001-12-18 06:50:28 +00:00
chs 5a690c92a1 add a VOP_PUTPAGES method for all the filesystems that don't have pages,
just unlock the interlock.
2001-12-06 04:27:40 +00:00
chs a4f1bc813a pick up changes from ufs_balloc_range(). 2001-11-30 07:06:19 +00:00
chs 9958c29316 VOP_PUTPAGES() requires page-aligned offsets, so be sure to provide such.
fixes PR 14759.

(while I'm here, call VOP_PUTPAGES() directly instead of indirecting through
the UVM pager op vector.)
2001-11-30 07:05:53 +00:00
chs a106161b5a add spaces for KNF. confirmed to produce identical objects. 2001-11-23 21:44:25 +00:00
chs 3f9a8628df we need to hold the pageq lock while calling uvm_page_unbusy() on
pages that uvm_page_unbusy() will free.
2001-11-22 02:42:37 +00:00
lukem 4a269de9a1 fix compile error noted by itojun in [kern/14638] 2001-11-19 11:56:50 +00:00
lukem 5b0ef8ec1a be consistent and cache UFS_*NEEDSWAP results in more functions 2001-11-19 07:00:21 +00:00
simonb f809eb7333 Set `flags' before being used in the WRITE() function. 2001-11-17 07:22:34 +00:00
lukem 2ee0a3f232 move code to calculate size of direct for a given namlen to separate
DIRECTSIZ() macro, and use this to implement a (now shorter) DIRSIZ().
inspired by freebsd
2001-11-16 16:09:17 +00:00
lukem 2565646230 don't need <sys/types.h> when including <sys/param.h> 2001-11-15 09:47:59 +00:00
chs 4b4425d13b some callers of ufs_bmaparray() in LFS depend on *nump being set to 0 for
direct blocks, so restore that behaviour.
2001-11-13 06:23:17 +00:00
chs dc4cf974e0 track some changes in the ufs code:
update UVM's notion of the file size in *_write() rather than
*_balloc().
2001-11-10 17:48:02 +00:00
chs c237f81065 update to track ufs_bmap.c:
don't call ufs_getlbns() for direct blocks.
2001-11-10 17:46:23 +00:00
chs 9f52e62b73 fix the previous change: use the correct test for a block number
referring to a direct block.
2001-11-10 07:11:00 +00:00
chs 81625d675b the previous fix (in rev. 1.26) for hangs when the filesystem is full
was wrong, so fix it right this time.  undo the previous change and
instead, replace the troublesome VOP_FSYNC()s with code that just flushes
the particular indirect blocks that we allocated.  this resolves the
softdeps for those blocks.  then we can change the pointer for
the first indirect block we allocated to zero, write that, and finally
invalidate all the indirect blocks we've touched.  also, wait until
after we finish all this before freeing any blocks we allocated.
fixes PRs 14413 and 14423.
2001-11-08 05:27:25 +00:00
chs df71d3fadc in both paths that can cause fragments to be expanded (write and truncate-up),
deal with the fragment expansion separately before the rest of the operation.
this allows us to simplify ufs_balloc_range() by not worrying about implicit
fragment expansion.

call VOP_PUTPAGES() directly for vnodes instead of
going through the UVM pager "put" vector.
2001-11-08 05:24:52 +00:00
chs 0de5f1ba39 only call ufs_getlbns() for blocks which involve indirects, and assert
that this is so.  use a shift instead of a multiply in one place.
2001-11-08 05:00:51 +00:00
chs f57fce8e9e call VOP_PUTPAGES() directly for vnodes instead of
going through the UVM pager "put" vector.
2001-11-08 04:51:05 +00:00
lukem 6ff2f2f438 add RCSID. (note; this file gets #included) 2001-11-08 02:42:31 +00:00
lukem ec6245465a add RCSID 2001-11-08 02:39:06 +00:00
simonb c56d879335 Remove some variables that are set but never used. 2001-11-06 07:11:29 +00:00
simonb 915441c64b Use the sector size from the partition info, not a hard-coded value. 2001-11-06 07:09:39 +00:00
simonb ecf09baab6 Remove a variable that is set but never used. 2001-11-06 07:08:09 +00:00
simonb bb57e2c53c Remove some bogus checks for unsigned variables < 0. 2001-11-06 06:59:05 +00:00