Commit Graph

194 Commits

Author SHA1 Message Date
christos 912592a638 mention current status 2012-08-04 12:47:00 +00:00
christos 0c222dcdd0 Don't increment the mount reference count here. Otherwise we are left with
refcount of one when we unmount, and vfs_destroy does not... Who is expected
to decrement this anyway?!?!
2012-08-04 12:31:57 +00:00
christos 020a6ad2d4 - move debugging functions to vcoda so modules with -DDEBUG link
- fix writing to coda files. this is probably not the right way to do
  this, but it satisfies the locking protocol:
	1. Sometimes coda_open() is called with an unlocked vnode which
	   does not satisfy the locking protocol. Lock it for now. We
	   need to find out why this happens
	2. VFS_VGET sometimes returns the container vnode unlocked. What
	   is the locking protocol for VFS_VGET? We also lock it here.
2012-08-02 16:06:58 +00:00
matt 10543b2146 -fno-common fallout. 2012-07-28 00:10:22 +00:00
christos 4af0aec9a5 comment out debugging printfs 2012-05-04 17:57:22 +00:00
christos b01ba4dca4 depend on "vcoda" since it has symbols we need. 2012-05-04 02:06:27 +00:00
christos b6690e266f fix locking in getpages when running executables. 2012-05-04 01:40:13 +00:00
christos 89fb5ce609 remove variable names from prototypes. 2012-05-04 01:38:56 +00:00
christos b43ddeabe0 move the assert after the locked case. 2012-05-03 14:26:42 +00:00
christos e4d18b9bd2 Instead of sharing the coda vnode lock with the ffs vnode lock, share the
ffs vnode lock with coda.
2012-05-02 16:51:01 +00:00
christos bc2122f164 cosmetic only: __func__, vnode_t 2012-04-28 20:15:07 +00:00
christos ee12655fb3 Fixes from get/putpages from rmind.
In grab vnode, share the lock of the coda vnode with the underlying vnode,
so that the locking protocol works.
2012-04-28 20:01:09 +00:00
christos a28e849d3a remove multiple definitions. 2012-04-26 17:18:33 +00:00
christos 704aca390d re-arrange things so that vcoda does not depend on coda. 2012-04-26 03:04:54 +00:00
christos c51fe45f15 use CODA_MAXNAMLEN instead of bogus MAXNAMLEN 2011-09-27 00:54:47 +00:00
gdt bcb68cbe5c Reduce verbosity of semi-debug coda_inactive printf.
Rather than print if the usecount is > 0, only print if it is greater
than 1.  It seems 1 is normal.
2011-09-13 19:34:27 +00:00
plunky 7f3d4048d7 NULL does not need a cast 2011-08-31 18:31:02 +00:00
rmind e225b7bd09 Welcome to 5.99.53! Merge rmind-uvmplock branch:
- Reorganize locking in UVM and provide extra serialisation for pmap(9).
  New lock order: [vmpage-owner-lock] -> pmap-lock.

- Simplify locking in some pmap(9) modules by removing P->V locking.

- Use lock object on vmobjlock (and thus vnode_t::v_interlock) to share
  the locks amongst UVM objects where necessary (tmpfs, layerfs, unionfs).

- Rewrite and optimise x86 TLB shootdown code, make it simpler and cleaner.
  Add TLBSTATS option for x86 to collect statistics about TLB shootdowns.

- Unify /dev/mem et al in MI code and provide required locking (removes
  kernel-lock on some ports).  Also, avoid cache-aliasing issues.

Thanks to Andrew Doran and Joerg Sonnenberger, as their initial patches
formed the core changes of this branch.
2011-06-12 03:35:36 +00:00
rmind 4a4e52516e Remove cache_purge(9) calls from reclamation routines in the file systems,
as vclean(9) performs it for us since Lite2 merge.
2011-05-19 03:11:55 +00:00
dholland 14402d0ff1 Abolish the SAVENAME and HASBUF flags. There is now always a buffer,
so the path in a struct componentname is now always valid during VOP
calls.
2010-11-30 10:43:01 +00:00
dholland d4eb05390d Abolish struct componentname's cn_pnbuf. Use the path buffer in the
pathbuf object passed to namei as work space instead. (For now a pnbuf
pointer appears in struct nameidata, to support certain unclean things
that haven't been fixed yet, but it will be going away in the future.)

This removes the need for the SAVENAME and HASBUF namei flags.
2010-11-30 10:29:57 +00:00
christos 0882e5d877 Fix incorrect comments about the buffer size being 2K; it is really 8K now.
From Robert Watson.
2010-08-07 20:39:33 +00:00
christos 014333fdb8 Correct incomplete size checks for the coda ioctls. From Dan Rosenberg. 2010-07-20 17:26:03 +00:00
hannken 245651a23d Remove vlockmgr(). Generic vnode lock operations now use a rwlock located
in the vnode.  All LK_* flags move from sys/lock.h to sys/vnode.h.  Calls
to vlockmgr() in file systems get replaced with VOP_LOCK() or VOP_UNLOCK().

Welcome to 5.99.34.

Discussed on tech-kern.
2010-07-01 13:00:54 +00:00
hannken 1423e65b26 Clean up vnode lock operations pass 2:
VOP_UNLOCK(vp, flags) -> VOP_UNLOCK(vp): Remove the unneeded flags argument.

Welcome to 5.99.32.

Discussed on tech-kern.
2010-06-24 12:58:48 +00:00
hannken d06039d236 coda_lock(): LK_INTERLOCK flag no longer possible. 2010-06-24 10:37:22 +00:00
hannken f6c438ba23 Clean up vnode lock operations:
- VOP_LOCK(vp, flags): Limit the set of allowed flags to LK_EXCLUSIVE,
   LK_SHARED and LK_NOWAIT.  LK_INTERLOCK is no longer allowed as it
   makes no sense here.

- VOP_ISLOCKED(vp): Remove the for some time unused return value
  LK_EXCLOTHER.  Mark this operation as "diagnostic only".
  Making a lock decision based on this operation is no longer allowed.

Discussed on tech-kern.
2010-06-24 07:54:46 +00:00
pooka 4f49fb9915 Don't generate unused fs_thefs.h headers. 2010-03-02 16:43:48 +00:00
rmind dbd9b86792 Remove some unecessary includes sys/user.h header. 2009-11-23 02:13:44 +00:00
blymn 42207b1c5e Make file_id unsigned so it does not get sign extended when promoted
to a 64bit ino_t.
2009-09-28 10:51:35 +00:00
dholland effcf1af5c Convert 67 namei call sites to use namei_simple, in these functions:
check_console, veriexecclose, veriexec_delete, veriexec_file_add,
emul_find_root, coff_load_shlib (sh3 version), coff_load_shlib,
compat_20_sys_statfs, compat_20_netbsd32_statfs,
ELFNAME2(netbsd32,probe_noteless), darwin_sys_statfs,
ibcs2_sys_statfs, ibcs2_sys_statvfs, linux_sys_uselib,
osf1_sys_statfs, sunos_sys_statfs, sunos32_sys_statfs,
ultrix_sys_statfs, do_sys_mount, fss_create_files (3 of 4),
adosfs_mount, cd9660_mount, coda_ioctl, coda_mount, ext2fs_mount,
ffs_mount, filecore_mount, hfs_mount, lfs_mount, msdosfs_mount,
ntfs_mount, sysvbfs_mount, udf_mount, union_mount, sys_chflags,
sys_lchflags, sys_chmod, sys_lchmod, sys_chown, sys_lchown,
sys___posix_chown, sys___posix_lchown, sys_link, do_sys_pstatvfs,
sys_quotactl, sys_revoke, sys_truncate, do_sys_utimes, sys_extattrctl,
sys_extattr_set_file, sys_extattr_set_link, sys_extattr_get_file,
sys_extattr_get_link, sys_extattr_delete_file,
sys_extattr_delete_link, sys_extattr_list_file, sys_extattr_list_link,
sys_setxattr, sys_lsetxattr, sys_getxattr, sys_lgetxattr,
sys_listxattr, sys_llistxattr, sys_removexattr, sys_lremovexattr

All have been scrutinized (several times, in fact) and compile-tested,
but not all have been explicitly tested in action.

XXX: While I haven't (intentionally) changed the use or nonuse of
XXX: TRYEMULROOT in any of these places, I'm not convinced all the
XXX: uses are correct; an audit might be desirable.
2009-06-29 05:08:15 +00:00
tsutsui d779b85d3e Remove extra whitespace added by a stupid tool.
XXX: more in src/sys/arch
2009-04-18 14:58:02 +00:00
cegger e2cb85904d bcopy -> memcpy 2009-03-18 17:06:41 +00:00
cegger 35fb64746b bcmp -> memcmp 2009-03-18 15:14:29 +00:00
christos 461a86f9bd merge christos-time_t 2009-01-11 02:45:45 +00:00
pooka f9f4344f37 #ifdef _LKM -> #ifndef _KERNEL_OPT 2008-12-30 12:56:12 +00:00
rumble a1221b6d4a Convert file systems to dynamically attach with the new module interface.
Make VFS hooks dynamic while we're here and say farewell to VFS_ATTACH and
VFS_HOOKS_ATTACH linksets.

As a consequence, most of the file systems can now be loaded as new style
modules.

Quick sanity check by ad@.
2008-05-10 02:26:09 +00:00
ad 42d0626726 PR kern/38141 lookup/vfs_busy acquire rwlock recursively
Simplify the mount locking. Remove all the crud to deal with recursion on
the mount lock, and crud to deal with unmount as another weirdo lock.

Hopefully this will once and for all fix the deadlocks with this. With this
commit there are two locks on each mount:

- krwlock_t mnt_unmounting. This is used to prevent unmount across critical
  sections like getnewvnode(). It's only ever read locked with rw_tryenter(),
  and is only ever write locked in dounmount(). A write hold can't be taken
  on this lock if the current LWP could hold a vnode lock.

- kmutex_t mnt_updating. This is taken by threads updating the mount, for
  example when going r/o -> r/w, and is only present to serialize updates.
  In order to take this lock, a read hold must first be taken on
  mnt_unmounting, and the two need to be held across the operation.

One effect of this change: previously if an unmount failed, we would make a
half hearted attempt to back out of it gracefully, but that was unlikely to
work in a lot of cases. Now while an unmount that will be aborted is in
progress, new file operations within the mount will fail instead of being
delayed. That is unlikely to be a problem though, because if the admin
requests unmount of a file system then s(he) has made a decision to deny
access to the resource.
2008-05-06 18:43:44 +00:00
ad e3610f1886 kern/38135 vfs_busy/vfs_trybusy confusion
The symptom was that sometimes file systems would occasionally not appear
in output from 'df' or 'mount' if the system was busy. Resolution:

- Make mount locks work somewhat like vm_map locks.
- vfs_trybusy() now only fails if the mount is gone, or if someone is
  unmounting the file system. Simple contention on mnt_lock doesn't
  cause it to fail.
- vfs_busy() will wait even if the file system is being unmounted.
2008-04-29 23:51:04 +00:00
ad baa3395f8f PR kern/38057 ffs makes assuptions about devvp file system
PR kern/33406 softdeps get stuck in endless loop

Introduce VFS_FSYNC() and call it when syncing a block device, if it
has a mounted file system.
2008-04-29 18:18:08 +00:00
ad 284c2b9aef Merge proc::p_mutex and proc::p_smutex into a single adaptive mutex, since
we no longer need to guard against access from hardware interrupt handlers.

Additionally, if cloning a process with CLONE_SIGHAND, arrange to have the
child process share the parent's lock so that signal state may be kept in
sync. Partially addresses PR kern/37437.
2008-04-24 18:39:20 +00:00
plunky 755dfb4f38 when queueing a message back to Venus, prioritise signals by inserting
them at the head of the queue.

The original code had a comment saying to do this but the INSQUE did
not have any way to do that so it didn't actually
2008-03-21 18:02:39 +00:00
plunky 72ac0bcc50 convert more insque/remque style queuing to use a queue(3) TAILQ,
this necessitates using a flag to indicate vc_open instead of abusing
the queue pointer but apart from that there is no functional
difference.
2008-03-21 17:59:57 +00:00
plunky 6e030479a6 remove some unnecessary casting 2008-03-01 17:26:07 +00:00
rmind c6186face4 Welcome to 4.99.55:
- Add a lot of missing selinit() and seldestroy() calls.

- Merge selwakeup() and selnotify() calls into a single selnotify().

- Add an additional 'events' argument to selnotify() call.  It will
  indicate which event (POLL_IN, POLL_OUT, etc) happen.  If unknown,
  zero may be used.

Note: please pass appropriate value of 'events' where possible.
Proposed on: <tech-kern>
2008-03-01 14:16:49 +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
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
ad 1997a1e1f4 Remove VOP_LEASE. Discussed on tech-kern. 2008-01-25 14:32:11 +00:00
ad 02098ba8d6 Use vp->v_rdev, don't look at the union. 2008-01-15 18:11:25 +00:00