Commit Graph

1369 Commits

Author SHA1 Message Date
perseant
6a87e08daa Get rid of our own private copy of genfs_putpages, having adapted the real
genfs_putpages to suit our purposes.
2007-04-24 22:47:56 +00:00
yamt
337d052ee1 hold proclist_mutex when calling psignal(). 2007-04-19 11:05:14 +00:00
perseant
0549fd6148 Add/change a couple of comments about locking restrictions. 2007-04-18 00:50:06 +00:00
perseant
0d8a7af5d6 Remember to write dirops when the vnode we are trying to flush is a dirop. 2007-04-18 00:49:33 +00:00
perseant
72507061e4 Fix another locking protocol error in lfs_fsync(). 2007-04-17 20:30:28 +00:00
perseant
43d50ff956 Fix MP locking protocol violations introduced in my previous commit. 2007-04-17 06:49:40 +00:00
perseant
9be0ebd9da Install a new sysctl, vfs.lfs.ignore_lazy_sync, which causes LFS to ignore
the "smooth" syncer, as if vfs.sync.*delay = 0, but only for LFS.  The
default is "on", i.e., ignore lazy sync.

Reduce the amount of polling/busy-waiting done by lfs_putpages().  To
accomplish this, copied genfs_putpages() and modified it to indicate which
page it was that caused it to return with EDEADLK.  fsync()/fdatasync()
should no longer ever fail with EAGAIN, and should not consume huge
quantities of cpu.

Also, try to make dirops less likely to be written as the result of a
VOP_PUTPAGES(), while ensuring that they are written regularly.
2007-04-17 01:16:46 +00:00
pooka
bc8224a1b3 fix comment: struct fid is in fstypes.h now 2007-04-09 12:21:24 +00:00
hannken
fc6776f366 Remove now obsolete vn_start_write() and vn_finished_write() and
corresponding flags.

Revert softdep_trackbufs() to its state before vn_start_write() was added.

Remove from struct mount now unneeded flags IMNT_SUSPEND* and
members mnt_writeopcountupper, mnt_writeopcountlower and mnt_leaf.

Welcome to 4.99.17
2007-04-08 11:20:42 +00:00
hannken
11601689e7 Remove calls to now obsolete vn_start_write() and vn_finished_write(). 2007-04-07 14:21:52 +00:00
perseant
b196644e3b correct comment for lfs_putpages 2007-04-05 17:44:18 +00:00
ad
4b1d78c00e Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.
2007-03-13 02:11:28 +00:00
ad
59d979c5f1 Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.
2007-03-12 18:18:22 +00:00
christos
53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
ad
b89010bfa3 Destroy the hash locks on final unmount. 2007-02-27 16:11:51 +00:00
perseant
d1d9b558a7 Reverse the order of searching the vnode list in lfs_writevnodes(). This
should speed up e.g. "chown -R" on LFS filesystems; e.g. it shows a 100%
increase in the 'seq_stat' column of bonnie++.
2007-02-23 23:16:03 +00:00
thorpej
b3667ada6d TRUE -> true, FALSE -> false 2007-02-22 06:05:00 +00:00
thorpej
712239e366 Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
2007-02-21 22:59:35 +00:00
pooka
5b38c61dd4 tyop in comment, fix it 2007-02-20 18:03:03 +00:00
pooka
7016942297 In readdir, in case cookies was already allocated but is later free'd
due to an error, reset value of cookies to NULL to avoid confusing
callers.

should fix kern/35728
2007-02-20 16:45:58 +00:00
ad
adbb9ec2fa Call genfs_node_destroy() where appropriate. 2007-02-20 16:21:03 +00:00
ad
d266042a07 Release ufs_hashlock before calling ungetnewvnode(). 2007-02-18 14:26:52 +00:00
pavel
934634a18c Change the process/lwp flags seen by userland via sysctl back to the
P_*/L_* naming convention, and rename the in-kernel flags to avoid
conflict. (P_ -> PK_, L_ -> LW_ ). Add back the (now unused) LSDEAD
constant.

Restores source compatibility with pre-newlock2 tools like ps or top.

Reviewed by Andrew Doran.
2007-02-17 22:31:36 +00:00
hannken
198beb0314 Make fstrans(9) the default helper for file system suspension.
Replaces the now obsolete vn_start_write()/vn_finished_write().
2007-02-16 17:23:53 +00:00
ad
93a5fa21eb Destroy the fraglock on unmount. 2007-02-15 17:47:56 +00:00
ad
9abeea588a Replace some uses of lockmgr() / simplelocks. 2007-02-15 15:40:50 +00:00
ad
b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
elad
2ddc81b57b Add missing ')'. Noted by Paul Goyette. 2007-02-07 05:54:42 +00:00
bouyer
0ce1424e8f in ufs_dirremove swap ep->d_reclen before use if needed (affect UFS_DIRHASH
only).
While there remove an unneeded swap before compare against 0 in ufs_direnter().
Both pointed out by Pawel Jakub Dawidek on tech-kern@, thanks !
2007-02-06 20:49:20 +00:00
hannken
4d607243ba Change fstrans enum types to upper case.
No functional change.

From Antti Kantee <pooka@netbsd.org>
2007-01-29 15:42:50 +00:00
hubertf
eda05c6413 Remove more duplicate headers.
Patch by Slava Semushin <slava.semushin@gmail.com>

Again, this was tested by comparing obj files from a pristine and a patched
source tree against an i386/ALL kernel, and also for src/sbin/fsck_ffs,
src/sbin/fsdb and src/usr.sbin/makefs. Only changes in assert() line numbers
were detected in 'objdump -d' output.
2007-01-29 01:52:43 +00:00
hannken
1b9c6382e3 New file system suspension API to replace vn_start_write and vn_finished_write.
The suspension helpers are now put into file system specific operations.
This means every file system not supporting these helpers cannot be suspended
and therefore snapshots are no longer possible.

Implemented for file systems of type ffs.

The new API is enabled on a kernel option NEWVNGATE.  This option is
not enabled by default in any kernel config.

Presented and discussed on tech-kern with much input from
Bill Studenmund <wrstuden@netbsd.org> and YAMAMOTO Takashi <yamt@netbsd.org>.

Welcome to 4.99.9 (new vfs op vfs_suspendctl).
2007-01-19 14:49:08 +00:00
isaki
be241a0e51 Correct indent. 2007-01-07 09:33:18 +00:00
elad
1e70d64818 Consistent usage of KAUTH_GENERIC_ISSUSER. 2007-01-04 16:55:29 +00:00
perseant
df25fd6968 Change VONWORKLST handling to better match its other uses; in particular,
check memq and clear VWRITEMAPDIRTY at the same time.
2007-01-03 02:42:23 +00:00
elad
d4e1860d1a Add KAUTH_SYSTEM_CHSYSFLAGS so we can get rid of the last three
securelevel references (ufs, ext2fs, tmpfs).

Intentionally undocumented.
2007-01-02 11:18:56 +00:00
yamt
90b1120ae3 ufs_readdir: start from offsets known to be valid,
rather than assuming users feed us valid offsets.
2006-12-26 14:50:08 +00:00
yamt
8bf7662829 merge yamt-splraiseipl branch.
- finish implementing splraiseipl (and makeiplcookie).
	  http://mail-index.NetBSD.org/tech-kern/2006/07/01/0000.html
	- complete workqueue(9) and fix its ipl problem, which is reported
	  to cause audio skipping.
	- fix netbt (at least compilation problems) for some ports.
	- fix PR/33218.
2006-12-21 15:55:21 +00:00
chs
975004d9f1 several ext2fs fixes provided by Barry Bouwsma:
- set ip->i_e2fs_dtime to time_second, not time_uptime.
 - don't allow ipref to go negative
 - fs->e2fs.e2fs_icount is a valid inode number, allow it.
2006-12-09 22:07:48 +00:00
chs
c398ae9734 a smorgasbord of improvements to vnode locking and path lookup:
- LOCKPARENT is no longer relevant for lookup(), relookup() or VOP_LOOKUP().
   these now always return the parent vnode locked.  namei() works as before.
   lookup() and various other paths no longer acquire vnode locks in the
   wrong order via vrele().  fixes PR 32535.
   as a nice side effect, path lookup is also up to 25% faster.
 - the above allows us to get rid of PDIRUNLOCK.
 - also get rid of WANTPARENT (just use LOCKPARENT and unlock it).
 - remove an assumption in layer_node_find() that all file systems implement
   a recursive VOP_LOCK() (unionfs doesn't).
 - require that all file systems supply vfs_vptofh and vfs_fhtovp routines.
   fill in eopnotsupp() for file systems that don't support being exported
   and remove the checks for NULL.  (layerfs calls these without checking.)
 - in union_lookup1(), don't change refcounts in the ISDOTDOT case, just
   adjust which vnode is locked.  fixes PR 33374.
 - apply fixes for ufs_rename() from ufs_vnops.c rev. 1.61 to ext2fs_rename().
2006-12-09 16:11:50 +00:00
hannken
818b049a35 On snapshot creation be sure the snapshot vnode has valid quota information.
Fixes PR kern/35121
2006-12-02 17:21:11 +00:00
joerg
f39fcf5763 LFS will never set SF_SNAPSHOT and doesn't support ffs_snapgone anyway.
So conditionally the calls to that function on the inclusion of FFS and
allow a LFS-only kernel to link.
2006-11-16 22:29:03 +00:00
christos
5d48d92007 ifdef out an unused function if !FFS_NO_SNAPSHOT 2006-11-16 21:21:34 +00:00
christos
168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
jmmv
b1fe4841a1 Let ext2fs be built even when none of ffs, lfs and mfs are present. 2006-11-13 16:12:54 +00:00
reinoud
dc5b5420b9 Revisit mnt_vnodelist TAILQ patch. Remove all suspicious TAILQ_FOREACH()
loops where vnodes can get removed or added during the loops. This could
lead to panic's on unmount since nodes are skipped or otherwise
TAILQ_NEXT(0xdeadbeef, ...) was dereferenced.
2006-10-25 22:01:54 +00:00
drochner
bffbce1754 import a fix from FreeBSD (rev.1.185):
After a rmdir()ed directory has been truncated, force an update of
the directory's inode after queuing the dirrem that will decrement
the parent directory's link count.  This will force the update of
the parent directory's actual link to actually be scheduled.  Without
this change the parent directory's actual link count would not be
updated until ufs_inactive() cleared the inode of the newly removed
directory, which might be deferred indefinitely.  ufs_inactive()
will not be called as long as any process holds a reference to the
removed directory, and ufs_inactive() will not clear the inode if
the link count is non-zero, which could be the result of an earlier
system crash.
[plus description about problems woth background fsck solved
by this; irrelevant to NetBSD]

For me, the good effect is at least that I'm getting less filesystem
inconsistencies after a crash.

Approved by christos quite a while ago.
2006-10-24 19:36:26 +00:00
reinoud
0ce809091d Replace the LIST structure mp->mnt_vnodelist to a TAILQ structure since all
vnodes were synced and processed backwards. This meant that the last
accessed node was processed first and the earlierst last.

An extra benefit is the removal of the ugly hack from the Berkly days on
LFS.

In the proces, i've also replaced the various variations hand written loops
by the TAILQ_FOREACH() macro's.
2006-10-20 18:58:12 +00:00
yamt
65a8f1c211 ffs_truncate: don't forget to zero the past eof in the case of
blocksize < pagesize.  PR/33777 from Simon Burge.
XXX check other filesystems, esp. lfs.
2006-10-17 11:39:18 +00:00
yamt
72fc92b729 ffs_alloc: remove an assertion which is no longer true. 2006-10-15 12:23:56 +00:00