Commit Graph

42 Commits

Author SHA1 Message Date
John Baldwin
7106ca0d1a Add missing includes of sys/lock.h. 2001-10-11 17:52:20 +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
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
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
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
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
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
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
de8ac2cfda Allow revive block sizes up to MAXPHYS.
Change struct plex to reflect changes to parity maintenance functions.
2000-05-11 07:27:27 +00:00
Greg Lehey
a32d2d99c4 Increase the initial size of a RAID-5 plex lock table to 256 entries,
which seems to correspond better with what a busy plex needs.  This
may also help us avoid race conditions when expanding the table which
may have been contributing to the random corruption, panics and hangs
we've been seeing in RAID-5 plexes, particularly with ata drives.

Eagerly-awaited-by: sos
2000-05-04 07:48:40 +00:00
Greg Lehey
2903a30d77 Set default revive block size to 64 kB.
Implicitly-sanctioned-by:	jkh
2000-03-01 07:25:46 +00:00
Greg Lehey
2cd253ad0f Replace the preprocessor variable names BDEV_MAJOR and CDEV_MAJOR with
VINUM_BDEV_MAJOR and VINUM_CDEV_MAJOR respectively.

Set DRIVE_MAXACTIVE and VINUM_MAXACTIVE to 30000, effectively
disabling the request limitation code.  This code was added as an
attempt to escape from a bug which seems to have gone away, and it's
very likely I'll remove the code Real Soon Now, but I don't want to do
it just yet.

struct drive: Remove references to vnode pointers, including debug
output.  Vinum now talks directly to the device driver.  Instead, add
a dev_t.

enum plexorg: Add an instance for RAID-4.

Change checks for striped or RAID-5 plexes to a macro 'isstriped',
which now also includes RAID-4.

Change checks for RAID-5 plexes to a macro 'isparity', which now also
includes RAID-4.

Approved-by:  jkh
2000-02-29 06:17:26 +00:00
Greg Lehey
ffa258b0aa Explicitly type large scalar parameters to avoid compilation warnings
on alpha.

Submitted-by:	      Bernd Walter <ticso@cicely.de>

struct sd: Add a field for the pid of the reviver when the subdisk is
reviving.

Replace block device macros with generalized device macros.
2000-01-05 06:13:01 +00:00
Peter Wemm
664a31e496 Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"
is an application space macro and the applications are supposed to be free
to use it as they please (but cannot).  This is consistant with the other
BSD's who made this change quite some time ago.  More commits to come.
1999-12-29 04:46:21 +00:00
Greg Lehey
5473959c2b Change default revive block size to 60 kB (was 64 kB), and set a
maximum of 64 kB.

vinum_conf, struct drive: add fields for the current number of active
requests and the maximum ever active.

struct sd: Add fields for initialize progress.

struct mc: set the size of saved file names to MCFILENAMELEN instead
of the previous explicit constant.
1999-10-13 03:21:54 +00:00
Greg Lehey
a13f3fcca5 struct plex: Add variables checkblock and rebuildblock to keep track
of parity check and rebuild operations.  This enables us
             to stop the operation and restart at a later time.

enum parityop: Trivial enum to decide what parityops() is going to do.
1999-09-28 22:58:07 +00:00
Greg Lehey
03705cdeb7 Initialize the si_bsize fields of the new dev structure. This fixes
some swapper problems analogous to those experienced with ccd.

This fix is a kludge: since we currently don't track the "sector size"
in a volume label, we guess a worst case (4 kB, as used by vnode
devices).  If the concept of sector size is here to stay, I'll make
some changes to track the "sector size" of a volume.  This will
probably be the maximum of the sector sizes of all component drives,
but things could get ugly if we start allowing non-standard sector
sizes such as 524 bytes.

Unkludged-version-submitted-by:	phk
1999-08-29 01:41:53 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Greg Lehey
60402eb12d Add 'initialized' state for subdisks. After initializing, the subdisk
goes into initialized state, not 'up'.  This makes it easier to ensure
consistency in multi-plex volumes.

update_plex_state: redo transitions from empty and initialized
subdisks to up or reviving, depending on the number of plexes.

Reported-by:	Bernd Walter <ticso@cicely.de>
		Remy Nonnenmacher <remy@synx.com>
1999-08-15 02:29:14 +00:00
Greg Lehey
af78609425 Tidy up comments.
Add definitions for VINUM_BLOCK_PLEX and VINUM_CHAR_PLEX.

struct plex: add lock-related variables.

struct rangelock: add variables.
1999-08-14 06:31:37 +00:00
Greg Lehey
5b19bbcb6f Import RAID-5 code.
Add Cybernet copyright.

OK'd-by:     Chuck Jacobus <chuck@cybernet.com>

Define VINUM_BLOCK_SD and VINUM_CHAR_SD macros to create raw subdisk
device numbers.

Add VF_HOTSPARE flag.
1999-08-07 08:15:25 +00:00
Greg Lehey
aa30608b44 Modify device numbering method to work with latest -CURRENT. Briefly,
the device numbers are now minor number only, so that we can still
compare them after dev_t has turned into a blob.

Broken-by:	dev_t changes
Reported-by:	Vallo Kallaste <vallo@matti.ee>
		"Niels Chr. Bank-Pedersen" <ncbp@bank-pedersen.dk>
1999-07-22 08:40:37 +00:00
Greg Lehey
7d6715c52c Change the type of the freelist sectors variable to u_int64_t in
order to ensure that initializers will be of correct type.
1999-07-02 07:56:47 +00:00
Greg Lehey
2096c6b68a Add some comments about the VINUMMINOR macro, which is not for human
consumption.
1999-06-22 05:41:36 +00:00
Greg Lehey
e4d6d0216b Modify to work with new style dev_t.
With_copious_input_from:  peter
			  phk
1999-05-15 05:49:21 +00:00
Greg Lehey
9f8115fd0c Remove some dead variables.
Change DEBUG_EXITFREE to DEBUG_WARNINGS.
1999-05-02 07:48:00 +00:00
Greg Lehey
09c1cbfe92 struct drive: add fields for debugging lockdrive deadlocks. 1999-04-10 08:12:44 +00:00
Greg Lehey
0ad9aafaa2 Add debug flag DEBUG_EXITFREE to log problems freeing memory on exit. 1999-04-05 04:03:45 +00:00
Greg Lehey
ec78ad25c9 Add flag VF_CREATED 1999-03-30 05:01:42 +00:00
Greg Lehey
dfb9ab7989 Add definition LongJmp for longjmp if -DVINUMDEBUG.
Change some comment texts
1999-03-28 08:55:04 +00:00
Greg Lehey
6d723f4eb0 Add flag VF_FORCECONFIG for use by the config_drive and friends. 1999-03-23 04:49:32 +00:00
Greg Lehey
3c7e349bca Define two superdevices for vinum(8), depending on whether they are
compiled with or without debugging support.  This enables us to catch
(fatal) mismatches between the kernel and userland.

Coalesce flags VINUM_DISKCONFIG and VINUM_READING_CONFIG.  They did
essentially the same thing.

Add VINUM_BIGDRIVE for pretending we have macho hardware.
1999-03-19 07:19:52 +00:00
Greg Lehey
962113a4bf Remove opencount from vinum_conf and struct vol, and disk index from
struct vol.

Add time to struct mc, remove KVA crud.

Add debug flags DEBUG_EOFINFO and DEBUG_MEMFREE.
1999-03-13 07:40:52 +00:00
Greg Lehey
587ce8d9ae Correct some diagrams
Remove pid field from struct sd, struct plex and struct volume

Add flags VF_STOPPING, VF_OPEN and VF_DAEMONOPEN
1999-03-02 06:58:09 +00:00
Greg Lehey
7f1050341c Change multiline comments to start with a lone /* and end with a */,
apparently in accordance with style(9).

Complained-about-by: bde
1999-01-29 01:17:54 +00:00
Greg Lehey
33953e5e97 Include Peter Wemm's renaming and restructuring
Change from lkm to kld

Add field plexsdno to sd struct

Add flag VF_NEWBORN to drive, sd, plex and volume structs, indicating
that the object has just been created.

Add object types for raw (unattached) plexes and subdisks

Remove definitions of VOLNO, PLEXNO and SDNO (now functions Volno,
Plexno and Sdno)

Move revive parameters from struct plex to struct sd.

struct plex:
  maintain a count of the number of inaccessible subdisks.
  remove defective and unmapped regions.

Debug flags: make an enum (previously #define)

Set default revive block size to 64kB (was 32 kB)
1999-01-21 00:41:58 +00:00
Peter Wemm
c285ca1254 Some relatively minor tweaks to enable vinum to be built into a static
kernel as a pseudo-device.  The changes were:
- #ifdef DEBUG -> #ifdef VINUMDEBUG
- opt_vinum.h for holding above config variable
- Fixing up a few stray problems where DEBUG wasn't optional.
- config.c -> vinumconfig.c (there's already a config.o)
- Other *.c -> vinum*.c (wasn't strictly necessary, but done in case we end
  up with something else conflicting later on and we might have to have yet
  more repository copies of files).
- include file paths fixups..  (ie: get them all from the kernel tree
  instead of partly from the kernel and partly from /usr/include/machine)

I've spoken with Greg about this..  I hope this doesn't mess him around
too much..
1998-12-28 16:28:24 +00:00
Peter Wemm
ef2dbe9885 If I've done this right, revive the vinum code in it's now home after it
was savaged in the blood bath a few hours ago.
1998-12-28 04:56:24 +00:00
Søren Schmidt
c74cd3590f Remove LKM's depricated by modules. 1998-12-27 19:38:15 +00:00
Greg Lehey
c51cd25e95 Change some numeric #defines to enums 1998-11-02 04:11:16 +00:00
Greg Lehey
721fbc5ae0 config.c:
config_drive:
    Catch an instance of anonymous drives.  Doubtless many remain.

interrupt.c:
  complete_rqe:
    Call logrq to log iodone events if DEBUG_LASTREQS is set.

    Call set_sd_state with setstate_noupdate to avoid buffered I/O out
    of interrupt context.

    Use define DEBUG_RESID instead of constant.

memory.c:
  Remove dead expandrq() function

  Malloc:
    Remove directory component of file names in malloc table.

  Add function vinum_rqinfo (part of the request tracing stuff).

request.c:
  Add function logrq (part of the request tracing stuff).

  vinumstrategy:
    Check whether config needs to be written to disk, do it if so.
    This is a stopgap until the Vinum daemon (bacchusd?  oenologistd?)
    is written.

    If DEBUG_LASTREQS is set, call logrq to log user buffer headers.

  launch_requests:
    Correct format of debug output to console.

    If DEBUG_LASTREQS is set, call logrq to log request elements.

request.h:
  Add definitions for request trace.

state.c:
  set_sd_state:
    Check flags for setstate_noupdate.  If set, don't write the config
    to disk, just set global VF_DIRTYCONFIG flag.  This is part of the
    kludge to avoid writing config from an interrupt context.

vinumext.h:
    Add declaration for vinum_rqinfo, put inside #ifdef DEBUG
    Remove dead macro expandrq

vinumio.h:
  Increase maximum ioctl reply length to 4 kB if DEBUG is set.
  Define VINUM_RQINFO ioctl if DEBUG is set.

vinumioctl.c:
  vinumioctl:
    Change implementation of VINUM_DEBUG ioctl: use a debug flag
    (DEBUG_REMOTEGDB) to decide whether to go into remote debugging or
    not.

    Implement VINUM_RQINFO.

vinumkw.h:
  Define kw_info even when not debugging.

vinumvar.h:
  Define VF_DIRTYCONFIG
  Add pointers to request info to vinum_info if DEBUG is set.
  Define setstate_noupdate
  Define additional debug bits DEBUG_RESID, DEBUG_LASTREQS and
  DEBUG_REMOTEGDB.
1998-10-21 08:32:32 +00:00
Greg Lehey
e4381fa521 Import base vinum lkm sources 1998-09-16 05:56:21 +00:00