Commit Graph

1495 Commits

Author SHA1 Message Date
ad be04ac4896 Make rusage collection per-LWP and collate in the appropriate places.
cloned threads need a little bit more work but the locking needs to
be fixed first.
2008-03-27 19:06:51 +00:00
ad 021b86dd4b Changes for PR kern/38291 (panic unmounting MFS /tmp):
- Reference count the mfsnode to fix an aincent bug. Only destroy when
  reference count drops to zero. In mfs_start(), busy the mount and get
  a reference to the mfsnode to prevent it disappearing while the server
  is running. If the file system is gone already, vfs_busy() will fail.
- Always destroy the bufq.
- Use a global mfs_lock for simplicity.
- Replace use of malloc/free. Fixes broken MALLOC_TYPE change.
2008-03-26 14:19:43 +00:00
ad a9ca7a3734 Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.
2008-03-21 21:54:58 +00:00
ad 110d5cc274 Make MFS MP-safe. Needed because of the funny tricks it plays. 2008-02-21 14:10:57 +00:00
matt e2ca3f7504 Merge all the *different* definitions of bufqueues into one common one. 2008-02-20 17:13:29 +00:00
ad fb00b83874 Give bbusy() an interlock argument. If the we need to wait for the buffer,
the interlock is dropped and reacquired when awoken. This allows for
busying buffers attached to a list that is not locked by bufcache_lock.
2008-02-15 13:46:04 +00:00
ad b2fa822a33 The buffer LOCKED flag need not be under the protection of bufcache_lock,
BUSY is enough.
2008-02-15 13:30:56 +00:00
ad 648f07789f Do genfs_node_init() earlier. PR kern/36162. 2008-02-05 15:18:36 +00:00
hannken a524d758da Make it work after lockmgr -> vlockmgr conversion:
- Initialize si_vnlock in si_mount_init().
  - Also initialize vl_recursecnt to zero.
- Destroy it only in si_mount_dtor().
- Simplify the v_lock <-> si_vnlock exchange.
- Don't abuse the overall error variable for LK_NOWAIT errors.
- ffs_snapremove: release the vnode one instead of three times.
2008-01-30 17:20:04 +00:00
ad 08da6a8594 Replace use of lockmgr. 2008-01-30 14:54:01 +00:00
ad 7356aff6af Replace use of LK_SLEEPFAIL. 2008-01-30 14:50:28 +00:00
ad 25153c3ec9 PR kern/37706 (forced unmount of file systems is unsafe):
- Do reference counting for 'struct mount'. Each vnode associated with a
  mount takes a reference, and in turn the mount takes a reference to the
  vfsops.
- Now that mounts are reference counted, replace the overcomplicated mount
  locking inherited from 4.4BSD with a recursable rwlock.
2008-01-30 11:46:59 +00:00
ad 3490efcc63 Replace struct lock on vnodes with a simpler lock object built on
krwlock_t. This is a step towards removing lockmgr and simplifying
vnode locking. Discussed on tech-kern.
2008-01-30 09:50:19 +00:00
hannken 89cea1c2c4 - Always destroy si_vnlock after use.
- Take care of vnodes without file system data.
2008-01-28 17:49:06 +00:00
dholland 717e1785a5 Fix some race conditions in rename.
Introduce a per-FS rename lock and new vfsops to manipulate it.
Get this lock while renaming. Also add another relookup() in do_sys_rename,
which is a hack to kludge around some of the worst deficiencies of
ufs_rename.
reviewed-by: pooka (and an earlier rev by ad)
posted on tech-kern with no objections.
2008-01-28 14:31:15 +00:00
pooka eb6074e41f Replace vrelel() 010101-mania with a flags parameter. However,
leave flags unimplemented for a while (no change in functionality).
2008-01-27 22:47:31 +00:00
ad 1997a1e1f4 Remove VOP_LEASE. Discussed on tech-kern. 2008-01-25 14:32:11 +00:00
ad 2c1cdef339 Ignore clean vnodes in a couple more places. 2008-01-25 14:16:41 +00:00
ad 51d8643120 - Fix a couple of locking botches.
- Remove calls to VOP_LEASE().
2008-01-25 13:31:22 +00:00
pooka 1bff00ecec Destroy extattr lock when destroying extattrs associated with the
mountpoint.  Make stopping extattrs always succesful to facilitate
always being able to free resources.
2008-01-25 10:49:32 +00:00
pooka 04177824be spec_node_init() mfs device vnode.
fixes PR kern/37867 by Steve Woodford
2008-01-25 10:30:20 +00:00
ad 927229e57b quotaoff: ignore clean vnodes. Fixes PR kern/37818. 2008-01-24 22:55:21 +00:00
ad 703069c0e9 specfs changes for PR kern/37717 (raidclose() is no longer called on
shutdown). There are still problems with device access and a PR will be
filed.

- Kill checkalias(). Allow multiple vnodes to reference a single device.

- Don't play dangerous tricks with block vnodes to ensure that only one
  vnode can describe a block device. Instead, prohibit concurrent opens of
  block devices. As a bonus remove the unreliable code that prevents
  multiple file system mounts on the same device. It's no longer needed.

- Track opens by vnode and by device. Issue cdev_close() when the last open
  goes away, instead of abusing vnode::v_usecount to tell if the device is
  open.
2008-01-24 17:32:52 +00:00
hannken 0409981d90 si_mount_dtor(): destroy si_vnlock before free. 2008-01-24 17:29:56 +00:00
hannken ca2bbf9908 Fix a typo from the vmlocking2 merge: vmark() the right vnode. 2008-01-24 16:26:44 +00:00
pooka c40d447080 Sprinkle comments about um_lock status on function entry and exit.
No functional change.
2008-01-21 23:36:26 +00:00
ad 42c90ece4c Fix dodgy tests of v_usecount. 2008-01-17 10:39:14 +00:00
ad abb6491738 mfs_close: remove a broken assertion. 2008-01-17 10:24:05 +00:00
christos 20f21ddc4a fix locking botch; vunmark() needs the mountvnode lock, and the loop invariant
is to exit with the mountvnode lock held.
2008-01-15 21:30:46 +00:00
ad 08c770b434 Initialize caches at IPL_SOFTBIO (not IPL_NONE) so that we are allocating
from kmem_map.
2008-01-12 00:34:10 +00:00
ad dd68496f43 Fix hangs on 'biolock' when creating a directory under / with softdep. 2008-01-09 18:20:54 +00:00
ad 0b52913dee Go back to freeing on disk inodes in the inactive routine. It would be
better not to do this, but it rules out potential side effects with softdep.
2008-01-09 16:15:22 +00:00
ad 52603a7d6d Fix 'panic: softdep_update_inodeblock: update failed'. 2008-01-07 16:56:27 +00:00
tnn 51f964a289 softdep_freefile: don't acquire ufsmount lock twice. 2008-01-07 05:20:25 +00:00
ad e01dd1a1f8 Use pool_cache. 2008-01-03 19:28:48 +00:00
pooka 8e7631e799 make the UFS_EXTATTR case build 2008-01-03 02:23:27 +00:00
pooka d53e261066 valloc -> vnalloc, vfree -> vnfree
Avoids collision with userland valloc(3).

no functional change
ad ok
2008-01-03 01:26:28 +00:00
ad 4a780c9ae2 Merge vmlocking2 to head. 2008-01-02 11:48:20 +00:00
perry b6a2ef7569 Convert many of the uses of __attribute__ to equivalent
__packed, __unused and __dead macros from cdefs.h
2007-12-25 18:33:32 +00:00
dsl 7e2790cf6f Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
    int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
2007-12-20 23:02:38 +00:00
dyoung c9b4d7e0b1 Call genfs_node_init a little earlier to avoid a vput()ing an
uninitialized node, later, which leads to a kernel panic.  Patch
by Antti Kantee.
2007-12-20 16:18:57 +00:00
he cd15efd05d Fix a use of lfs_truncate() inside an #ifdef notyet (so no resulting change);
lfs_truncate() has lost its lwp argument.
2007-12-12 18:36:10 +00:00
he 8b0afebe4f Make this build again, as part of sys/lkm/dev/vnd/:
- lfs_truncate() has lost its lwp argument.
- Cast from void* to char* before doing pointer arithmetic.
2007-12-12 18:35:21 +00:00
lukem 2b0e4fae39 Move __KERNEL_RCSID() so that it's always available if this file is
compiled, even if DEBUG isn't defined.
(This matches the behaviour of various other source files that
provide functions only if DEBUG is enabled.)
2007-12-12 03:49:03 +00:00
ad e38a5a204c Fix a stray brelse() that got missed. 2007-12-12 03:10:47 +00:00
lukem 85a77245b2 defflag LFS_KERNEL_RFW (in opt_lfs.h).
Note: lfs_rfw.c doesn't compile if you define the option; locking API fallout?
2007-12-12 02:56:03 +00:00
lukem 961afe5035 use __KERNEL_RCSID() instead of __RCSID() 2007-12-11 12:16:34 +00:00
pooka db06a930e6 Remove cn_lwp from struct componentname. curlwp should be used
from on.  The NDINIT() macro no longer takes the lwp parameter and
associates the credentials of the calling thread with the namei
structure.
2007-12-08 19:29:36 +00:00
ad 5870896633 Grab ump->um_lock in another spot. 2007-12-08 15:23:32 +00:00
ad c27abd2a99 Add some comments. 2007-12-08 15:21:19 +00:00