Commit Graph

143 Commits

Author SHA1 Message Date
christos e839ec30fc use getdisksize 2011-11-13 23:02:46 +00:00
hannken 2cc7a01f10 Change the vnode locking protocol of VOP_GETATTR() to request at least
a shared lock.  Make all calls outside of file systems respect it.

The calls from file systems need review.

No objections from tech-kern.
2011-10-14 09:23:28 +00:00
joerg 258624699d Fix memset usage. 2011-07-04 16:06:17 +00:00
jruoho b4a3a8f3ec Adjust the #ifdefs such that ccd(4) and cgd(4) show in
modstat(8) even if built into the kernel.
2011-06-21 06:23:38 +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 9b6bd2d968 Remove clause 3 (UCB advertising clause) from the University of Utah
copyright.  Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
2011-02-08 20:20:06 +00:00
dholland 0a4a6fb035 Fix previous, was all wrong. noticed by enami. 2010-11-19 09:11:45 +00:00
dholland 8f6ed30d57 Introduce struct pathbuf. This is an abstraction to hold a pathname
and the metadata required to interpret it. Callers of namei must now
create a pathbuf and pass it to NDINIT (instead of a string and a
uio_seg), then destroy the pathbuf after the namei session is
complete.

Update all namei call sites accordingly. Add a pathbuf(9) man page and
update namei(9).

The pathbuf interface also now appears in a couple of related
additional places that were passing string/uio_seg pairs that were
later fed into NDINIT. Update other call sites accordingly.
2010-11-19 06:44:33 +00:00
uebayasi 19b39d64b4 Include uvm/uvm_extern.h to access uvmexp. gtmpsc.c doesn't need
uvm(9) API at all.
2010-11-14 03:49:52 +00:00
haad 7147ed320b Add work in support for compiling ccd and cgd drivers as a modules. I forgot
to committ when I have written device module autoloading stuff.
2009-06-05 19:21:02 +00:00
ad 481ff5ace4 Fix problems with ccd:
- Pending async I/O was tossed on unconfigure (should not happen, but..)
- It could exhaust memory under heavy I/O load.
- If memory allocation failed, disk transfers could stall.
- v_numoutput was updated without v_interlock held.

Additionally:

- Make it MPSAFE.
- Use kmem_alloc().
2009-04-04 08:29:39 +00:00
yamt 70de973662 g/c BUFQ_FOO() macros and use bufq_foo() directly. 2009-01-13 13:33:58 +00:00
cegger 08ebead94e make this compile 2009-01-11 09:51:38 +00:00
christos 461a86f9bd merge christos-time_t 2009-01-11 02:45:45 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +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
hannken 6a545682ed ccdbuffer(): add missing initialization of new bufs b_objlock. 2008-02-02 10:40:50 +00:00
ad 4a780c9ae2 Merge vmlocking2 to head. 2008-01-02 11:48:20 +00:00
ad 598ab03ad0 Match the docs: MUTEX_DRIVER/SPIN are now only for porting code written
for Solaris.
2007-12-05 07:06:50 +00:00
pooka 61e8303e9d Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start.  In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern
2007-11-26 19:01:26 +00:00
ad 2af68666da Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.
2007-10-08 16:41:05 +00:00
ad eb171eaaa7 It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
2007-07-29 12:50:17 +00:00
ad 88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
cube 954bc13440 Change dk_lookup() to accept an additional argument of the type enum uio_seg
that tells whether the given path is in user space or kernel space, so it
can tell NDINIT().

While the raidframe calls were ok, both ccd(4) and cgd(4) were passing
pointers to user space data, which leads to strange error on i386, as
reported by Jukka Salmi on current-users.

The issue has been there since last august, I'm actually a bit surprised
that no one in the meantime has used ccd(4) or cgd(4) on an arch where it
would have simply faulted.
2007-06-26 15:22:23 +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 9abeea588a Replace some uses of lockmgr() / simplelocks. 2007-02-15 15:40:50 +00:00
christos 168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
christos 4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
christos 4589200621 Coverity CID 3801: Plug memory leak (from Arnaud Lacombe) 2006-09-29 14:39:09 +00:00
christos 1a789da3ec Use dk_lookup. 2006-08-27 04:58:40 +00:00
ad 3029ac48c7 - Use the LWP cached credentials where sane.
- Minor cosmetic changes.
2006-07-21 16:48:45 +00:00
christos 92d441e0ee don't allocate > 1K on the stack. 2006-06-12 22:02:45 +00:00
elad 2867b68bc3 integrate kauth. 2006-05-14 21:42:26 +00:00
jld 97297f3775 Make ccdioctl work without a process context; fixes xbdback-on-ccd.
Run by tech-kern on 2006-04-24; with approval and advice from wrstuden@.
2006-04-24 21:35:57 +00:00
lukem 8c09644630 * The kernel's struct ccd_softc has extra structure members over the
userland version; provide another ccd global variable (ccd_softc_elemsize)
  containing the kernel's size, and use that it ccdconfig(8) to convert the
  kernel's ccd_softc into userland versions.
  Fixes 'ccdconfig -g'.
* Use DISKUNIT() instead of home-grown cruft to determine the `N' of "ccdN".
  Fixes 'ccdconfig -g ccd1'.
* Use (void *) instead of (char *) in the calls to kvm_read().

XXX: ccd could be converted from nlist to sysctl.  "Someone else's yak shave".
2006-02-16 23:25:18 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
yamt aec75b1cc6 - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
  have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
  from sys/bufq.h to sys/bufq_impl.h.
  (is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c.  (not tested)
2005-10-15 17:29:10 +00:00
yamt bc505ef8dd use pseudo_disk_{init,attach,detach} where appropriate. 2005-08-20 12:01:04 +00:00
christos 7cdea212c0 No 0x in front of %p... 2005-05-22 15:54:45 +00:00
yamt 99229e5d39 introduce a function to drain bufq and use it where appropriate. 2005-03-31 11:28:53 +00:00
perry f31bd063e9 nuke trailing whitespace 2005-02-27 00:26:58 +00:00
yamt 05f25dcc2a move buffer queue related stuffs from buf.h to their own header, bufq.h. 2004-10-28 07:07:35 +00:00
thorpej f64a29d708 Implement the DIOCCACHESYNC ioctl; we simply pass it through to each
underlying component.
2004-10-26 22:44:45 +00:00
yamt 22399b45d0 change some members of struct buf from long to int.
ride on 2.0H.
2004-09-18 16:40:11 +00:00
thorpej 4152bad13d Remove a comment that doesn't really make sense. 2004-08-23 05:38:15 +00:00
thorpej b8d3850087 Use ANSI function decls and more use of static. 2004-08-23 04:38:42 +00:00
itojun d2f1c029b9 kill sprintf, use snprintf 2004-04-21 18:40:37 +00:00
hannken 3db4e2acd8 Make VOP_STRATEGY(bp) a real VOP as discussed on tech-kern.
VOP_STRATEGY(bp) is replaced by one of two new functions:

- VOP_STRATEGY(vp, bp)  Call the strategy routine of vp for bp.
- DEV_STRATEGY(bp)      Call the d_strategy routine of bp->b_dev for bp.

DEV_STRATEGY(bp) is used only for block-to-block device situations.
2004-01-25 18:06:48 +00:00
yamt 7266a95907 store a i/o priority hint in struct buf for buffer queue discipline. 2004-01-10 14:39:50 +00:00