Commit Graph

494 Commits

Author SHA1 Message Date
Warner Losh
a163d034fa Back out M_* changes, per decision of the TRB.
Approved by: trb
2003-02-19 05:47:46 +00:00
Poul-Henning Kamp
f341ca9891 Remove #include <sys/dkstat.h> 2003-02-16 14:13:23 +00:00
Joerg Wunsch
1e35598c3a Deregister the dev_clone event handler when unloading the module. Bad
things might happen otherwise.

Noticed by:	Michael Reifenberger <root@nihil.reifenberger.com>
2003-02-11 21:12:43 +00:00
Poul-Henning Kamp
936cc4614b Rename bio_linkage to the more obvious bio_parent.
Add bio_t0 timestamp, and include <sys/time.h> where needed
2003-02-07 21:09:51 +00:00
Joerg Wunsch
e1df235292 Finally make vinum ready for the root filesystem in FreeBSD 5.x. (A
similar patch has been in 4.x for a while, but is more hacky there.)

For this to work, vinum has to be loaded early (e. g. from
boot/loader), for obvious reasons.  If the kernel env variable
(aka. loader variable) "vinum.autostart" is set, vinum then asks the
sysctl kern.disks for all available disks in the system, and scans
them for possible vinum headers.

For statically compiled kernels, this behaviour can be obtained even
without boot/loader by using "options VINUM_AUTOSTART" (though this is
not the recommended way).

Alternatively, the 4.x way to specify "vinum.drives" is also supported.

No further hacks (like the 4.x "vinum.root" variable) are needed,
since in 5.x, mountroot() asks back at the drivers to have them
resolve the name of the root FS into a dev_t (using the dev_clone
eventhandler).

(The MFC reminder below is for a partial MFC for vinum.autostart, the
rest is already there in 4.x.)

Timed out on:	grog
MFC after:	2 weeks
2003-02-05 21:02:56 +00:00
Poul-Henning Kamp
e70e846243 Put use of DIOCWLABEL under #ifdef NO_GEOM 2003-01-26 11:28:56 +00:00
Joerg Wunsch
d50ea522c1 Make the arguments to d_close() match the arguments to d_open(), since
otherwise the close operation is void, and the underlying device remains
marked as being busy.

Thanks to phk for finding this.

MFC after:	3 days
2003-01-22 14:06:46 +00:00
Alfred Perlstein
44956c9863 Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
2003-01-21 08:56:16 +00:00
Joerg Wunsch
652dfa8341 Make vinum disk-related devices readable by group "operator" to match
the configuration of any other disk-like devices.

(This is the DEVFS-only part, so no need to MFC.)

PR:		bin/28294, bin/32588
2003-01-16 23:47:04 +00:00
Poul-Henning Kamp
e2a3ea1c45 Remove unused second argument from DEV_STRATEGY(). 2003-01-03 05:57:35 +00:00
Greg Lehey
c6990de670 Back out revision 1.38. disklabel now understands vinum volumes again. 2002-12-18 00:18:54 +00:00
Greg Lehey
0538c676cc Create raw plexes and subdisks, not the old volume-related ones. This
crept in in the transition to devfs, and caused a number of "device
not configured" errors.

Approved by:	re (rwatson)
2002-12-13 00:27:32 +00:00
Greg Lehey
d54f0880cb revive_block: If we have an I/O error, don't forget to drop the stripe lock.
Approved by:	re (jhb)
2002-12-12 01:03:45 +00:00
Greg Lehey
b9742d01f4 Implement DIOCGDINFO for volumes. newfs will no longer build a file
system on a volume without a disk label.

Approved by: re (rwatson)
2002-12-02 23:56:59 +00:00
Greg Lehey
ad3507f645 Don't blindly call make_dev when configuring an object: the device
could already exist, and this triggers a booby trap panic in make_dev.

remove_plex_entry: Don't remove the stripe mutex here, it gets done in
free_plex.

Approved by: re (rwatson)
2002-12-02 23:53:32 +00:00
John Baldwin
50be24a116 Explicitly cast daddr_t's to long long's when printing them since daddr_t
is not long long on all archs.  (They happen to be long's on 64-bit arch's
and gcc considers that significant enough to warn about it.)  These should
probably be uintmax_t but I didn't feel like adding all the extra includes.
2002-11-07 21:52:51 +00:00
Robert Watson
6d4d944e33 Get Vinum up and running with GEOM:
(1) Use namei() and devfs to discover devices rather than a hard-coded
    MAKEDEV implementation.  Once rootfs is in place, this will allow
    Vinum to be used for the root file system partition.

(2) Pass FREAD to device opens so that GEOM will return sector size
    rather than an error on attempts to read label data.

(3) Avoid clobbering return values from close_drive() and masking this
    failure, resulting in a later divide by zero due to not having
    updated the Vinum-cached sector size.

(4) Ignore failures from DIOCWLABEL as that appears not to be required
    in the GEOM environment.

We've done testing in simple Vinum environments, but those with more
complex environments might want to give this a spin in DP2 and make
sure everything is up to speed.

Fixes in collaboration with:	iedowse
Reviewed by:			grog
2002-10-05 03:44:00 +00:00
Robert Watson
0c0d4e17e4 Refinement on previous fix for mutex destruction: make sure we don't
release the mutex multiple times for multi-plex volumes.

Following further consultation with:	grog
2002-10-05 03:33:38 +00:00
Robert Watson
96364d6806 Remove a panic on vinum module unload: make sure to destroy all mutexes
before freeing so that WITNESS doesn't dereference mutex data pointers
and page fault.  It's now possible to unload vinum.ko with a GENERIC
kernel on 5.0-CURRENT without panic.

Debugged/fixed with the aid of:	jake, grog
2002-10-05 03:07:23 +00:00
Poul-Henning Kamp
29c02e22c3 Reduce <sys/disklabel.h> poisoning a bit.
Sponsored by:	DARPA & NAI Labs.
2002-09-20 17:14:48 +00:00
Poul-Henning Kamp
46714777f5 Retire now unused DIOCGDVIRGIN kludge.
Sponsored by:	DARPA & NAI Labs.
2002-09-20 09:31:14 +00:00
Archie Cobbs
55f7c614fd Don't use "NULL" when "0" is really meant. 2002-08-21 23:39:52 +00:00
Joerg Wunsch
d718f8d486 Implement the DIOCGSECTORSIZE and DIOCGMEDIASIZE ioctls, and rename
the DIOCGDINFO ioctl into DIOCGDVIRGIN.  This allows the newfs(8) to
work on vinum volumes without the now removed -v option.

Approved by:	grog
2002-08-14 09:28:19 +00:00
Bruce Evans
ae4c33defa "Fixed" printf format errors (64-bit daddr_t casualties; should use %jx
instead of %llx when %j is available).

Changed nearby output formats from %x to %#x so that it is obvious that the
numbers are in hex (vinum mostly uses 0x%x elsewhere).

Didn't fix nearby format printf errors (long lines).
2002-05-25 11:12:30 +00:00
Peter Wemm
885fbc97c1 Fix new compiler unhappiness. 2002-05-24 06:01:07 +00:00
Tom Rhodes
d394511de3 More s/file system/filesystem/g 2002-05-16 21:28:32 +00:00
Poul-Henning Kamp
77068a7fe2 Retire the bogus uses of the disklabel field d_sbsize and begin to
initialize it to zero so we don't have to have everbody and their
aunt including FFS specific header files.

Sponsored by: DARPA & NAI Labs.
2002-05-12 20:49:41 +00:00
Greg Lehey
a182065f27 vinum_open: recognize twed device.
Submitted by:	Holger Kipp <holger.kipp@alogis.com>
PR:		37458
MFC after: 	5 days
		(to get 4.6 code freeze)
2002-04-26 04:23:19 +00:00
Poul-Henning Kamp
2dd527b3ac Move generic disk ioctls from <sys/disklabel.h> to <sys/disk.h>.
Sponsored by:	DARPA & NAI Labs
2002-04-08 09:20:07 +00:00
John Baldwin
6008862bc2 Change callers of mtx_init() to pass in an appropriate lock type name. In
most cases NULL is passed, but in some cases such as network driver locks
(which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used.

Tested on:	i386, alpha, sparc64
2002-04-04 21:03:38 +00:00
Poul-Henning Kamp
408ab1b875 Retire the bogus ioctl DIOCGPART in toto.
Once again we can notice that badly thought out hacks ferment and infect
far more code than initially expected.

Sponsored by:	DARPA and NAI Labs.
2002-04-02 11:52:13 +00:00
Poul-Henning Kamp
13c0a6f45e Stop using the bogus DIOCGPART ioctl, use DIOCGSECTORSIZE and
DIOCGMEDIASIZE instead.

The partition type check has been XXX'ed out since we cannot expect
that a BSD disklabel with a type field be available on all platforms.
2002-04-02 11:40:45 +00:00
John Baldwin
44731cab3b Change the suser() API to take advantage of td_ucred as well as do a
general cleanup of the API.  The entire API now consists of two functions
similar to the pre-KSE API.  The suser() function takes a thread pointer
as its only argument.  The td_ucred member of this thread must be valid
so the only valid thread pointers are curthread and a few kernel threads
such as thread0.  The suser_cred() function takes a pointer to a struct
ucred as its first argument and an integer flag as its second argument.
The flag is currently only used for the PRISON_ROOT flag.

Discussed on:	smp@
2002-04-01 21:31:13 +00:00
Poul-Henning Kamp
572a089e74 Remove bogus vinumdump(), if you can't dump, say so with nodump(). 2002-03-29 21:14:34 +00:00
Jeff Roberson
421e6a659e Remove unused include. 2002-03-20 09:55:07 +00:00
Kirk McKusick
0d2af52141 Introduce the new 64-bit size disk block, daddr64_t. Change
the bio and buffer structures to have daddr64_t bio_pblkno,
b_blkno, and b_lblkno fields which allows access to disks
larger than a Terabyte in size. This change also requires
that the VOP_BMAP vnode operation accept and return daddr64_t
blocks. This delta should not affect system operation in
any way. It merely sets up the necessary interfaces to allow
the development of disk drivers that work with these larger
disk block addresses. It also allows for the development of
UFS2 which will use 64-bit block addresses.
2002-03-15 18:49:47 +00:00
Poul-Henning Kamp
af91f4fa16 GC: BIO_ORDERED going away. 2002-02-22 09:18:46 +00:00
Greg Lehey
93bbd4c8da Grr. The last commit contained update conflicts. It just goes to
show that you should check the code even for a forced commit.

Spotted by:	dd
2002-01-29 02:49:15 +00:00
Greg Lehey
60fc37994f Forced commit. The previous commit log was garbled and didn't even
apply to this file.  The correct message is:

throw_rude_remark: Make sure we're holding the config lock before
                   proceeding.  There's no reason to assume that this
                   has ever happened, but the alternative might be a
                   double fault.
2002-01-29 02:14:51 +00:00
Greg Lehey
98912ee8cc vinumioctl: Fix a double fault caused by calling setjmp() without holding the config lock. The call was in fact superfluous. 2002-01-27 04:20:52 +00:00
Poul-Henning Kamp
90a13e1e9e Don't call cdevsw_{add,remove}(). 2001-11-04 11:55:19 +00:00
Greg Lehey
c253329a84 allocrqg: Don't ever try to write to a NULL pointer.
Reported by:	Jeff Roberson <jeff@midstream.com>
2001-11-03 02:39:15 +00:00
Greg Lehey
5de383bcbc attachobject: Return correct status after successfully attaching a
plex.

Indirectly found by:	Hendrik Scholz <hscholz@perikles.toppoint.de>
2001-10-13 07:22:12 +00:00
John Baldwin
7106ca0d1a Add missing includes of sys/lock.h. 2001-10-11 17:52:20 +00:00
Julian Elischer
b40ce4165d KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after:    ha ha ha ha
2001-09-12 08:38:13 +00:00
Greg Lehey
27b286aa8c Remove an accidentally forgotten #ifdef. This could cause depletion
of mutexes if a lot of plexes are created and destroyed.
2001-09-04 06:30:05 +00:00
Greg Lehey
d505403792 open_device: Recognize ar device.
Submitted by:  Valery Kotchiev <valery@rudiment.dk>
2001-08-01 04:35:28 +00:00
Peter Wemm
e664fdb13c The kernel *does* now define setjmp/longjmp. Dont duplicate it here.
In file included from ../../../dev/vinum/vinumhdr.h:77,
                 from ../../../dev/vinum/vinum.c:44:
../../../dev/vinum/vinumext.h:165: warning: redundant redeclaration of `setjmp' in same scope
../../../sys/systm.h:96: warning: previous declaration of `setjmp'
../../../dev/vinum/vinummemory.c:44: warning: redundant redeclaration of `longjmp' in same scope
../../../sys/systm.h:97: warning: previous declaration of `longjmp'
2001-07-27 00:44:36 +00:00
Peter Wemm
953d6e00e9 Fix warnings:
vinumhdr.h:80: warning: redundant redeclaration of `vinum_cdevsw'
 vinumext.h:239: warning: previous declaration of `vinum_cdevsw'
in each of the following files:
 vinum.c, vinumconfig.c, vinumdaemon.c, vinuminterrupt.c, vinumio.c,
 vinumioctl.c, vinumlock.c, vinummemory.c, vinumraid5.c, vinumrequest.c,
 vinumrevive.c, vinumstate.c, vinumutil.c
2001-06-15 00:23:11 +00:00
Greg Lehey
7b4bf18baa Change #if VINUMDEBUG to #ifdef VINUMDEBUG. This is a flag, not a variable. 2001-05-23 23:24:05 +00:00
Greg Lehey
468f05c7f7 Move objflags from vinumvar.h to vinumobj.h in preparation for
requiring fewer header files for userland programs.

Remove the gross debug device/non-debug device hack used to recognize
whether the kernel module was in sync with the userland module.
2001-05-23 05:27:40 +00:00
Greg Lehey
dd3dced8c4 Move objflags from vinumvar.h to vinumobj.h in preparation for
requiring fewer header files for userland programs.
2001-05-23 05:27:15 +00:00
Greg Lehey
4ec8f62211 Move external declaration to vinumhdr.h. 2001-05-23 05:26:40 +00:00
Greg Lehey
bc55b89e25 Set flag VF_HASDEBUG in vinum_conf to indicate that the module was
compiled with debug support.  This can be used by userland programs to
recognize which ioctls the module supports.

As a result, remove the gross debug device/non-debug device hack used
to recognize whether the kernel module was in sync with the userland
module.

Replace explicit references to major/minor numbers of vinum
superdevice with the VINUM_SUPERDEV macro written for that purpose.
2001-05-23 05:25:45 +00:00
Greg Lehey
4b2ec3c529 New header file.
Missed by:	Szilveszter Adam <sziszi@petra.hos.u-szeged.hu>
		David Wolfskill <david@catwhisker.org>
Pointy hat to:	grog
2001-05-22 22:29:35 +00:00
Greg Lehey
74f5bf080b Remove Malloc definitions (now in vinumext.h) 2001-05-22 06:08:52 +00:00
Greg Lehey
c6ef641d24 Add a field 'version' to vinum_conf. This field is a constant which
gets incremented every time the kernel-userland interface changes.
This enables vinum(8) to check for the correct kernel version and to
produce a useful message if it doesn't match.

Requested by:	Too many to count.

Move the definitions of struct drive, sd, plex and volume to
vinumobj.h.

Add a new debug flag, DEBUG_LOCKREQS, which logs only lock requests.
2001-05-22 02:37:28 +00:00
Greg Lehey
2e387f1bd3 vinumstart: If a write request is for a RAID-[45] plex or a volume
with more than one plex, the data will be accessed
            multiple times.  During this time, userland code could
            potentially modify the buffer, thus causing data
            corruption.  In the case of a multi-plexed volume this
            might be cosmetic, but in the case of a RAID-[45] plex it
            can cause severe data corruption which only becomes
            evident after a drive failure.  Avoid this situation by
            making a copy of the data buffer before using it.

	    Note that this solution does not guarantee any particular
	    content of the buffer, just that it remains unchanged for
	    the duration of the request.

Suggested by:	alfred
2001-05-22 02:36:47 +00:00
Greg Lehey
5be7546b83 tokenize: Take third parameter specifying the maximum number of
parameters to return.  This code is used both in userland and in the
kernel.
2001-05-22 02:35:57 +00:00
Greg Lehey
24ad5cd24b Cosmetics: wrap long lines to be < 80 characters. 2001-05-22 02:35:19 +00:00
Greg Lehey
c4d4f4147d Add a new debug flag, DEBUG_LOCKREQS, which logs only lock requests.
Use this instead of DEBUG_LASTREQS to decide whether to log lock
requests.

MFS:

vinumlock: Catch a potential race condition where one process is
           waiting for a lock, and between the time it is woken and
           it retries the lock, another process gets it and places it
           in the first entry in the table.

           This problem has not been observed, but it's possible, and
           it's easy enough to fix.

Submitted by:   tegge

vinumunlock: Catch a real bug capable of hanging a system.  When
             releasing a lock, vinumunlock() called wakeup_one.  This
             caused wakeups to sometimes get lost.  After due
             consideration, we think that this is due to the fact that
             you can't guarantee that some other process is also
             waiting on the same address.  This makes wakeup_one a
             very dangerous function to use.
2001-05-22 02:34:30 +00:00
Greg Lehey
cf65a3dc63 Change ioctls to use the expurgated userland version of the Vinum
structures.
2001-05-22 02:33:32 +00:00
Greg Lehey
acac8659d7 format_config: Replace long format lines.
Requested by:  bde

Add retryerrors keyword.

vinum_scandisk: Print a different message if an inadvertent start
command did not find any additional drives.  The previous message "no
drives found" confused and worried many people.

MFS:

vinum_open: Recognize Mylex devices as storage devices.
2001-05-22 02:32:22 +00:00
Greg Lehey
ab15c118bf complete_rqe:
In case of error, check the VF_RETRYERRORS flag in the subdisk and
  don't take the subdisk down if it's set, just retry the I/O.

  Requested by:	peter

  If the buffer has been copied (XFR_COPYBUF), release the copied
  buffer when the I/O completes.

  Suggested by:	alfred
2001-05-22 02:31:08 +00:00
Greg Lehey
0e414969e0 Remove unnecessary declarations of userland functions.
Desired by:	   bde

This commit is the first of a general cleanup of the header files..
It won't be enough to make bde happy.

Move debug definitions from vinumhdr.h.
2001-05-22 02:30:44 +00:00
Greg Lehey
177bb9657f config_sd: Add code to recognize "retryerrors" keyword.
config_plex: Don't create the device until we're finished.

parse_config: check for corrupted configuration, thus avoiding a
potential panic.

remove_sd_entry: Restore structure.
2001-05-22 02:29:54 +00:00
Greg Lehey
7e18e4ffbc free_vinum: Change some explicit struct member references to the SD,
PLEX and VOL.
2001-05-22 02:29:15 +00:00
Greg Lehey
2c4a6d9016 Add xferinfo flag bit for copied buffers.
Create a new struct rangelockinfo.  In revision 1.21 of vinumlock.c,
the plex info was removed from struct rangelock, since it wasn't
needed there.  It *is* needed for trace information, however, so use
struct rangelockinfo for that.
2001-05-22 02:28:55 +00:00
Greg Lehey
1739a10826 New file containing definitions for separate views of objects for
userland and kernel.
2001-05-22 01:41:12 +00:00
Poul-Henning Kamp
f83880518b Send the remains (such as I have located) of "block major numbers" to
the bit-bucket.
2001-03-26 12:41:29 +00:00
Alfred Perlstein
ea846c773d devfs convertion used VINUMRMINOR incorrectly (passing args in
backwards order)

Submitted by: Bernd Walter <ticso@mail.cicely.de>
2001-03-22 23:21:49 +00:00
Peter Wemm
e793f3a0e0 By convention, the moduledata is static unless there is a reason for it
to not be.
2001-03-13 05:55:43 +00:00
Alfred Perlstein
729d4f1db0 Fix vinum for both devfs and non-devfs systems.
userland tool:

  Use the vfs.devfs.generation sysctl to test for devfs presense
  (thanks phk!) when devfs is active it will not try to create the
  device nodes in /dev and therefore will not complain about the
  failure to do so.

  Revert the change in the #define for VINUM_DIR in the kernel
  header so that vinum can find its device nodes.

  Replace perror() with vinum_perror() to print file/line when
  DEVBUG is defined (not defined by default).

kernel:

  Don't use the #define names for the "superdev" creation since
  they will be prepended by "/dev/" (based on VINUM_DIR), instead
  use string constants.

  Create both debug and non-debug "superdev" nodes in the devfs.

Problem noticed and fix tested by: Martin Blapp <mblapp@fuchur.lan.attic.ch>
2001-02-20 22:07:36 +00:00
Alfred Perlstein
1a1f84bdd7 forced commit to note that the last delta also reordered some code in
remove_sd_entry() to:

  Simplify (hopefully) it by moving all error returns closer to
  the beginning of the function.

  Return an error when "Error removing subdisk %s: not found in
  plex %s\n" would have been reported, as I doubt that we are "OK"
  after printing that error message.
2001-02-20 12:14:01 +00:00
Alfred Perlstein
d9ca06d2a3 Take a shot at making vinum devfs aware.
Adding make_dev() and destroy_dev() calls in (hopefully) the right
places.

This is done by calling make_dev() in each object constructor and
caching the dev_t's returned from make_dev() in each struct
'subdisk'(sd), 'plex' and 'volume' such that the 'object'_free()
functioncs can call destroy dev.

This change makes a subset of the old /dev/vinum appear under devfs.

Enough nodes appear such that I'm able to mount my striped volume.

There may be more work needed to get vinum configuration working
properly.
2001-02-20 11:37:04 +00:00
Bosko Milekic
9ed346bab0 Change and clean the mutex lock interface.
mtx_enter(lock, type) becomes:

mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks)
mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized)

similarily, for releasing a lock, we now have:

mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN.
We change the caller interface for the two different types of locks
because the semantics are entirely different for each case, and this
makes it explicitly clear and, at the same time, it rids us of the
extra `type' argument.

The enter->lock and exit->unlock change has been made with the idea
that we're "locking data" and not "entering locked code" in mind.

Further, remove all additional "flags" previously passed to the
lock acquire/release routines with the exception of two:

MTX_QUIET and MTX_NOSWITCH

The functionality of these flags is preserved and they can be passed
to the lock/unlock routines by calling the corresponding wrappers:

mtx_{lock, unlock}_flags(lock, flag(s)) and
mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN
locks, respectively.

Re-inline some lock acq/rel code; in the sleep lock case, we only
inline the _obtain_lock()s in order to ensure that the inlined code
fits into a cache line. In the spin lock case, we inline recursion and
actually only perform a function call if we need to spin. This change
has been made with the idea that we generally tend to avoid spin locks
and that also the spin locks that we do have and are heavily used
(i.e. sched_lock) do recurse, and therefore in an effort to reduce
function call overhead for some architectures (such as alpha), we
inline recursion for this case.

Create a new malloc type for the witness code and retire from using
the M_DEV type. The new type is called M_WITNESS and is only declared
if WITNESS is enabled.

Begin cleaning up some machdep/mutex.h code - specifically updated the
"optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN
and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently
need those.

Finally, caught up to the interface changes in all sys code.

Contributors: jake, jhb, jasone (in no particular order)
2001-02-09 06:11:45 +00:00
Greg Lehey
2a1735da45 Allocate lock table and mutex not only for parity plexes, but also for
striped plexes.  This prevents various panics introduced in the last
rewrite of the locking code.

Suffered by:   "Niels Chr. Bank-Pedersen" <ncbp@bank-pedersen.dk>
2001-02-02 07:14:13 +00:00
John Baldwin
e7d904a13a - Proc locking around the vinumdaemon dinking with its flags.
- P_INMEM -> PS_INMEM.
2001-01-24 10:28:19 +00:00
Jake Burkholder
a448b62ac9 Make intr_nesting_level per-process, rather than per-cpu. Setup
interrupt threads to run with it always >= 1, so that malloc can
detect M_WAITOK from "interrupt" context.  This is also necessary
in order to context switch from sched_ithd() directly.

Reviewed By:	peter
2001-01-21 19:25:07 +00:00
Greg Lehey
9cd8b5cf0d Correct check for partition c. Previously the check was for drive 2,
which did not exactly have the desired result.

Submitted by:	Akira Watanabe <akira@myaw.ei.meisei-u.ac.jp>
2001-01-20 03:46:19 +00:00
Greg Lehey
940b9a4808 struct rangelock: Remove the field 'plex' from the entry. Range locks
are accessed only via the plex, so there's never any confusion as to
the plex number.  This value was, as a result, unused.
2001-01-14 06:34:57 +00:00
Greg Lehey
96f2d202a1 format_config: If a subdisk loses its drive (due to a bug which has
not yet been caught), don't save the config with a null drive
   	name (which causes the drive to be renamed "plex" on the next
   	start), put in the text "*invalid*" instead.

	This is damage control, not a fix.

Experienced by:	peter

Break some long format strings so that they fit in style(9)-sized
lines.

Remove some "outdentation".
2001-01-14 06:33:10 +00:00
Greg Lehey
a08d6f1a2c config_plex: Check that we have specified a plex organization.
Tripped over by:	"Jeroen C. van Gelderen" <jeroen@vangelderen.org>
2001-01-14 06:29:56 +00:00
Greg Lehey
891b3d045f Reinstate 1.19.
Prodded by: iedowse
2001-01-10 21:42:06 +00:00
Greg Lehey
a208c55ad3 Part of rewrite of RAID-[45] locking code:
Rename INITIAL_LOCKS to PLEX_LOCKS, since it now stays a constant.

struct plex:
  Add a mutex lockmtx.
  Remove alloclocks.
2001-01-10 05:08:30 +00:00
Greg Lehey
91c6496f6e vinumstart: Don't check for B_DONE on return from bre(), it doesn't
happen any more.

abortrequest: don't bufdone the user bp on error, let vinumstart() do
it.

Based on analysis by:	tegge
2001-01-10 05:07:52 +00:00
Greg Lehey
6e763eb38a bre5: don't bufdone the user bp on error, let vinumstart() do it.
Based on analysis by:	tegge
2001-01-10 05:07:14 +00:00
Greg Lehey
83d4664f33 Remove obsolete functions [un]lockplex and [un]lockvol.
Rewrite lockrange and unlockrange.  The lock table is now a fixed
size, so there is no possibility for race conditions when expanding.
The current size (256 locked ranges) should be large enough that it
makes no sense to expand it.  To do expansion right would require
quiescing the plex (requiring at least 256 I/O completions), and the
performance implications are horrendous.

Add a mutex per plex for accessing the lock table.

Based on analysis by:	tegge
2001-01-10 05:06:37 +00:00
Greg Lehey
6694e200e5 Get definition of Malloc right when not using VINUMDEBUG
Pointed out by:	tegge
2001-01-10 05:05:46 +00:00
Greg Lehey
8684adf5cd open_drive: Refuse to open partition c of a disk device.
This should eliminate one case of foot shooting .

vinum_scandisk: If a drive in the partition table is downed, free it.
This duplicates code for the compatibility partition, which for some
reason was omitted here.
2001-01-10 05:02:44 +00:00
Greg Lehey
5f1a173c01 config_plex: Initialize mutex for parity plexes.
remove_plex_entry: Destroy mutex for parity plexes.

Part of rewrite of RAID-[45] locking code.
2001-01-10 05:01:12 +00:00
Jake Burkholder
ef73ae4b0c Use PCPU_GET, PCPU_PTR and PCPU_SET to access all per-cpu variables
other then curproc.
2001-01-10 04:43:51 +00:00
Dag-Erling Smørgrav
a8513d6f69 Re-commit revision 1.32, which grog incorrectly backed out in revision 1.33. 2000-12-20 11:17:09 +00:00
Greg Lehey
7509f91aba revive_block: Don't go beyond the end of the stripe when reviving
striped plexes.

Submitted by:   des

Don't lock buffers before calls to sdio, sdio does it by itself.

Submitted by:	tegge

parityops:	Use correct casts when returning error information.
2000-12-20 05:18:58 +00:00
Greg Lehey
06694e9333 build_rq_buffer: Note which buffer headers we lock.
sdio: Unlock the buffer if we fail.

Submitted by:	tegge
2000-12-20 05:18:09 +00:00
Greg Lehey
e8c0649946 Rearrange #includes to make more sense. This is still not the reform
that bde is waiting to see, but at least it works.
2000-12-20 05:17:29 +00:00
Greg Lehey
3daf911efe Rename detached plexes and subdisks correctly (off by one error)
Submitted by:	Terry Glanfield <Terry.Glanfield@program-products.co.uk>
2000-12-20 05:16:46 +00:00
Greg Lehey
ed4963f8e1 open_drive: Add support for more than 32 devices of a particular kind.
Requested by:	Bernd Walter <ticso@cicely8.cicely.de>
		Cor Bosman <cor@xs4all.net>
		Kai Storbeck <kai@xs4all.net>
		Joe Greco <jgreco@ns.sol.net>

	     Add support for Compaq SMART-2 RAID (idad) as storage
	     device for Vinum subdisks.

Reported by:	Aaron Hill <hillaa@hotmail.com>
2000-12-20 05:15:50 +00:00
Greg Lehey
e872ce018e give_plex_to_volume: Recalculate volume size after attaching.
Cosmetics.
2000-12-20 05:13:26 +00:00
Greg Lehey
4fd45755c5 Add flag XFR_BUFLOCKED to identify buffers which have been locked.
Part of fix to ensure that we unlock buffers we lock.

In principle submitted by: tegge
2000-12-20 05:10:08 +00:00