| Age | Commit message (Collapse) | Author |
|
returns ENOMEM in addition to EAGAIN.
Device-dependent start() routine may allocate buffer directly, or via
bus_dma(9) API (some implementations for bus_dma(9) like alpha allocate
memory internally).
If these attempts fail with ENOMEM, this is not a disk error, therefore
we must retry later, as already done for EAGAIN.
|
|
If a disk is backed by a physical medium other than itself, such as
cgd(4), then it passes DK_DUMP_RECURSIVE to disable the recursion
detection for dk_dump.
If, however, a device represents a physical medium on its own, such
as wd(4), then it passes 0 instead.
With this, I can now dump to dk on cgd on dk on wd.
|
|
|
|
attachment failed or when it hasn't finished yet.
|
|
request itself.
|
|
|
|
(if not busy).
|
|
and disk geometry are > DEV_BSIZE, such as fictitious cd(4) disklabel
still part of PR kern/53833
|
|
so that the check is meaningful if disklabel sector size and disk geometry
sector size differ - for example 512 disklabel vs 2048 for sparc cd(4)
conversion assumes that the sector sizes are multiples of DEV_BSIZE (512)
fixes kern/53833 by Andreas Gustafsson
Note: the checks are executed #ifdef DIAGNOSTIC, that's why nothing
is printed by 8.0 kernel, or anything built from release branches
|
|
call it with dksc->sc_iolock held.
|
|
These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.
HOWEVER! Some subsystems have
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))
even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.
To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.
I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:
cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))
It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.
Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
|
|
|
|
not trigger problem in PR kern/52769
|
|
|
|
while here, assert that the len is indeed non-negative. this is already
confirmed by sys_fdiscard, but let's be sure.
reported by: GCC, but with different compile flags
|
|
doesn't fit into 'int'.
|
|
the rndq handling code, and causes system crashes; gathering rnd there is
also bad idea from performance perspective
|
|
by the number of concurrent I/O requests. Also introduce a new disk_wait()
function to measure requests waiting in a bufq.
iostat -y now reports data about waiting and active requests.
So far only drivers using dksubr and dk, ccd, wd and xbd collect data about
waiting requests.
|
|
|
|
or interrupt was ignored while the queue was processed.
Bump kernel revision for changed dk_softc.
|
|
to adjust the label with driver specific data.
|
|
by dk_open() for the first opener and mirrors the use of the d_lastclose
callback.
Bump kernel version for the interface change.
|
|
global sc_busy flag guards against race so it's not actually necessary, and
this place is unlikely to need to be parallelized in near future
discussed with mlelstv@
|
|
for MPSAFE drivers
|
|
|
|
CID 136290{3,4}: missing break
|
|
|
|
|
|
|
|
|
|
pointers.
|
|
|
|
|
|
|
|
|
|
|
|
- set DKF_TAKEDUMP on attach, otherwise we can never dump
- add DKF_DUMP debugging
- use __func__ instead of hard-coding names
- only allow dumps on swap partitions
|
|
|
|
|
|
from hardware interrupt. Instead, release mutex while calling start routine.
The buffer peek/use/get sequence which can no longer be atomic. So consume
the buffer directly and on error privately save and retry the buffer later.
The dk_drain function is used to flush such a deferred buffer together with
the buffer queue.
Adjust drivers to use dk_drain.
Fix an error path where dk_done was called while the lock was already held.
|
|
by regular threads and by the biodone softint.
This allows diskstart routines to sleep (like cgd).
|
|
|
|
- d_diskstart callback now processes a single buffer only.
The new wrapper function dk_start processes the queue,
performs other buffer handling and also provides locking
for the the data structures.
- add d_discard callback to handle device specific function inside
the new dk_discard helper function.
Replace splbio with mutex to protect queue and disk structure.
Refactor common code in dk_strategy and dk_discard into dk_translate.
Adjust and simplify ld(4), cgd(4) and xbd(4) drivers accordingly.
ld(4) now becomes MP_SAFE.
Bump kernel version.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
temporarily invalid data while it is re-read.
|