Commit Graph

68 Commits

Author SHA1 Message Date
kiyohara
e7ce62fde3 Check disk bounds, in RAW_PART. 2010-09-20 06:54:06 +00:00
jmcneill
b4ea244316 flush cache on suspend 2010-08-19 17:59:10 +00:00
dyoung
90dc63ec14 Extract ldlastclose() and use it in ldclose(). At the top of
ldbegindetach(), call disk_begindetach(..., ldlastclose, ...).

Compiles.  Not tested.
2009-07-23 21:38:33 +00:00
cegger
5496566c68 struct device * -> device_t, no functional changes intended. 2009-05-07 09:11:42 +00:00
yamt
70de973662 g/c BUFQ_FOO() macros and use bufq_foo() directly. 2009-01-13 13:33:58 +00:00
tron
362b2f2b14 Complete device_t/softc split for the ld(4) attachments. This should
prevent crashes while attaching a drive.

Patch supplied by Juan RP in PR kern/39468.
2008-09-09 12:45:39 +00:00
simonb
82bb1c2ff8 Add a flags argument to the ld(4) flush handlers, and call these with a
"poll" flag when called from ld_shutdown().

This is the infrastructure part of kern/38655 - in itself it doesn't
fix the panic referenced in that PR.

XXX: At least ld_twa.c and perhaps ld_iop.c and ld_icp.c need to
check for this new poll flag and do something useful.
2008-08-11 06:43:37 +00:00
ws
d172dc9df5 Destroy our mutex on detach in order to avoid
an "allocation contains active lock" panic
when halting a LOCKDEBUG kernel.
2008-08-01 16:09:45 +00:00
cube
4b9fef643e Use device_private() where appropriate.
Noted by Paul Goyette in PR#39110.
2008-07-06 14:07:44 +00:00
tsutsui
13a1e15f0e Use device_lookup_private() to get softc. 2008-06-11 12:41:22 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
cegger
c1886a2781 use aprint_*_dev and device_xname 2008-04-09 05:47:19 +00:00
jmcneill
47379c8458 Don't forget to deregister with PMF on detach. 2008-03-09 19:18:25 +00:00
jmcneill
fdf8cc9718 Replace shutdownhook with PMF power handler. 2008-03-09 19:15:01 +00:00
ad
0664a0459b Start detangling lock.h from intr.h. This is likely to cause short term
breakage, but the mess of dependencies has been regularly breaking the
build recently anyhow.
2008-01-04 21:17:40 +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
xtraeme
1b0de52cf2 Use sc_mutex (which runs at IPL_BIO) to protect the DIOC[GS]STRATEGY
ioctl ops, sorry didn't see it before.
2007-11-12 19:01:07 +00:00
xtraeme
4ffff27911 Implement DIOCGSTRATEGY and DIOCSSTRATEGY for dkctl <foo0> strategy. 2007-11-12 14:45:23 +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
b5a9ff06f1 Replace some uses of lockmgr(). 2007-07-21 19:51:47 +00:00
tron
c021b87a9d Reset error code if an ioctl() request is not handled by the generic
disk framework. This stops ld(4) from returning an error for various
ioctl() requests which actually *did* work. As a result fdisk(8) and
therefore also sysinst(8) work with ld(4) devices once again.

Based on a patch supplied by Todd Kover in PR kern/36244, successfully
tested with ld(4)@icp(4).
2007-04-30 17:23:09 +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
riz
52138eeaf6 Defer dkwedge_discover() until after interrupts are enabled. This
allows a kernel with options DKWEDGE_AUTODISCOVER to boot
on a machine with a twa(4) card.

ok matt@
2007-02-22 22:28:32 +00:00
ad
b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
riz
35ed82b748 Add disk-info properties to ld(4), based on Jason Thorpe's similar
code in wd(4).

OK ad, cube
2007-02-08 03:19:42 +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
thorpej
39cd836ee1 Use device_unit(). 2006-03-28 17:38:24 +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
christos
7df254d9f7 avoid variable shadowing. 2005-05-30 04:44:52 +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
briggs
fb9f110c8c Use aprint_*() instead of printf() at attach time. 2005-02-08 05:16:17 +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
c22daf01f0 Implement the DIOCCACHESYNC ioctl. 2004-10-26 22:46:13 +00:00
jdolecek
f5254bdba7 ldioctl(): fix typo in check for lockmgr() return value introduced
with the wedge support, which caused premature return and left dk_openlock
locked, leading to lockmgr() panic on close; newfs of ld disk now works again
2004-10-17 17:02:48 +00:00
thorpej
46cfcf0eb8 Add support for wedges to the logical disk driver. 2004-09-25 04:28:08 +00:00
thorpej
b560f85cc5 Use ANSI function decls, sprinkle static. 2004-08-30 00:34:41 +00:00
dbj
aeec9b8f23 use uint64 instead of int for sc_secperunit 2004-07-20 15:44:20 +00:00
tls
14cd9beeae Don't use BUFQ_FCFS. It degrades performance both for "smart" (Mylex
ExtremeRAID with NV cache) and "dumb" (3ware 6410) ld providers.

Instead, use the default buffer queue policy.

With the 3ware adapter, using the read priority strategy instead of FCFS,
for three extractions of pkgsrc, took 329 seconds instead of 331 -- but
with a dramatic improvement in perceived system response (latency for
I/O outside the main stream).

With the Mylex adapter, the improvement was dramatic: using read priority
instead of FCFS yielded an improvement from 381 seconds to 135 seconds!
There was a less-noticeable improvement in perceived latency as well.

The other disk drivers currently hard-wired to FCFS or another policy
should probably be changed as well.
2004-03-22 17:30:33 +00:00
fvdl
d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
darrenr
960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
thorpej
76464bb996 * Don't wait for commands to drain when adjusting the queue length.
Instead, wait when it's really needed, when detaching.  Project
  draining from spruious wakeups.
* Don't flush the controller's cache when detaching; we can't do it
  reliably, as the controller probably things the array drive no
  longer exists.  The cache is already flushed in ldclose() so this
  should be no problem.
2003-06-13 02:32:27 +00:00
thorpej
47edad1115 Always queue transfers in the ld driver to prevent transient resource
shortages in the back-ends from aborting transfers.

Reviewed by ad@.
2003-06-07 23:37:24 +00:00
thorpej
4aef050969 Add DIOCKLABEL support. Fixes PR kern/21605 (Luke Mewburn). 2003-05-17 16:11:52 +00:00
itojun
ce084afabe use strlcpy 2003-05-16 15:34:25 +00:00
thorpej
e43fecb228 Change bounds_check_with_label() to take a pointer to the disk structure,
rather than the label itself.  This paves the way for some future changes.
2003-05-10 23:12:28 +00:00
thorpej
8dc5018716 If the upper-layer provides a geometry, use it. 2003-01-27 02:43:30 +00:00