Commit Graph

43 Commits

Author SHA1 Message Date
Greg Lehey
e802b7f05e Remove DIOCGDINFO ioctl. This almost makes newfs work again without
the -v option, though it's not clear that it won't bite us elsewhere.

Forgotten by: phk

Implement setreadpol() function for the VINUM_READPOL ioctl.

Submitted by:  Allan Saddi <allan@saddi.com>
2003-05-05 05:33:59 +00:00
Greg Lehey
f911210e72 Rewrite of startup code:
Add ioctl VINUM_READCONFIG which implements both the "read" and
"start" commands in vinum(8).  Aim for marginally better error
messages when something goes wrong.
2003-05-04 05:16:02 +00:00
Greg Lehey
01fbffad0e Rewrite minor number decoding. Now we have only three types of
object: subdisks, plexes and volumes.  The encoding for plexes and
subdisks no longer reflects the object to which they belong.  The
super devices are high-order volume numbers.  This gives vastly more
potential volumes (4 million instead of 256).

As a result of the minor number changes, split out the superdevice
handling into a separate function, vinum_super_ioctl.  This was most
of the code of vinumioctl.

attachobject: Improve error checking.
2003-05-01 01:30:59 +00:00
Poul-Henning Kamp
c3dbde2864 NO_GEOM cleanup: unifdef -UNO_GEOM 2003-02-22 09:36:40 +00:00
Poul-Henning Kamp
e70e846243 Put use of DIOCWLABEL under #ifdef NO_GEOM 2003-01-26 11:28:56 +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
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
Poul-Henning Kamp
46714777f5 Retire now unused DIOCGDVIRGIN kludge.
Sponsored by:	DARPA & NAI Labs.
2002-09-20 09:31:14 +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
Peter Wemm
885fbc97c1 Fix new compiler unhappiness. 2002-05-24 06:01:07 +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
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
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
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
cf65a3dc63 Change ioctls to use the expurgated userland version of the Vinum
structures.
2001-05-22 02:33:32 +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
762166daca Remove a redundant statement. 2000-06-02 04:03:57 +00:00
Greg Lehey
14d0b39e73 Change linkage to parity maintenance operations. 2000-05-11 07:22:18 +00:00
Greg Lehey
74a2966a34 Modify comments to indicate that RAID-5 functions also apply to
RAID-4.

Approved-by:  jkh
2000-02-29 06:12:34 +00:00
Greg Lehey
5756902abc Add function moveobject, which currently moves subdisks to different
drives.  This function just does the low-level configuration changes;
the resultant subdisk is stale if it previously had any contents,
otherwise it is empty (i.e. in need of initializing if it's RAID-5).
We still need to handle getting the contents moved over, but the
current version will suffice to migrate subdisks from a disk which has
failed.

Submitted-by:  Marius Bendiksen <marius@marius.scancall.no>
2000-01-05 06:07:26 +00:00
Greg Lehey
553faec194 Remove reference to obsolete initsd function.
This should have been committed yesterday.

Broke-world-for:	USW2 Root <root@usw2.freebsd.org>
1999-10-13 23:00:30 +00:00
Greg Lehey
aa1c16b781 Add ioctls VINUM_CHECKPARITY and VINUM_RESETPARITY, still to be fully
implemented.
1999-09-28 22:55:37 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Greg Lehey
4fe498363c Add VINUM_SETSTATE_FORCE ioctl for diddling individual object states.
This is a repair tool which can also be used for panicing the system.
Use with utmost care if at all.
1999-08-24 02:26:15 +00:00
Greg Lehey
55eecd1064 vinumioctl: add ioctls for raw subdisks and plexes. Remove code for
drives (we refuse to touch drives, that's the disk driver's business).
1999-08-14 06:27:25 +00:00
Greg Lehey
f9c8e4cda3 Import RAID-5 code.
Add Cybernet copyright.

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

detchobject:  Don't update the object configuration.

replaceobject: Add preliminary code.  This is not yet complete.

vinumw.h vinumparser.c:

Add keyword 'hotspare'.
1999-08-07 08:09:36 +00:00
Greg Lehey
c9b0944731 Be more intelligent about attaching subdisks to plexes. 1999-06-22 05:37:57 +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
9d622f47e1 Make Vinum compile correctly without VINUMDEBUG
Tripped-over-by:	Thomas Stromberg <tstromberg@rtci.com>
1999-05-08 02:50:44 +00:00
Greg Lehey
560863926b Remove old grunge, including references to sys/disk.h (which is going
away).

Submitted-by:	phk
1999-05-07 01:35:29 +00:00
Greg Lehey
8cb67ba580 Revise use of the vinum_conf variables drives_used, subdisks_used,
plexes_used and volumes_used.  Now these fields are only informative,
and the <object>_allocated count is used for searches, etc.  This also
required checking the object state before doing things with the
presumed object.

Problems-reported-by: Kiril Mitev <kiril@ideaglobal.com>

VINUM_<object>CONFIG: return ENXIO rather than EFAULT if an object
doesn't exist.
1999-03-30 05:01:06 +00:00
Greg Lehey
738082e8b0 Remove longjmp declaration. 1999-03-28 08:53:46 +00:00
Greg Lehey
8d2eda6481 VINUM_STARTCONFIG:
Pass the 'data' parameter to start_config, which uses it as the
  parameter 'force.
1999-03-23 04:48:31 +00:00
Greg Lehey
301851b630 VINUM_RESETCONFIG: do the reset even if the config is open (as it has
to be for us to issue the ioctl :-).  Also remove the opencount
parameter of the config, which just never worked.
1999-03-13 07:34:56 +00:00
Greg Lehey
33e00380bc Change printf() calls to log() calls.
Change VINUM_SAVECONFIG: it now requires a parameter.  0 means
"configuration updates are finished, please save", and 1 means "please
just save the config".  This second meaning is invoked by the new
"saveconfig" command to vinum(8).
1999-03-02 06:54:57 +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
ac4cd383ca Correct #include in vinumioctl.c to compile correctly
without VINUMDEBUG

Submitted-by: peter
1999-01-24 05:14:39 +00:00
Greg Lehey
c3dff4f036 Include Peter Wemm's renaming and restructuring
Remove #ifdefs for FreeBSD 2.c

Change from lkm to kld

correct type of `flags' in calls to set_drive_state.

set_drive_parms: handle anonymous drives correctly (remove them)

drive VOP functions: use the PID of the original opener to fool the
lock manager.

open_drive: be quiet about failures (they're normal when scanning the
partitions).

close_drive: lock drive before closing.

remove_drive: lock drive before deallocating.

read_drive_label: set drive up when all is OK

check_drive:
  Complete rewrite.  Offload most of the code to the new
  vinum_scandisk

format_config:
  use snprintf and %qd options to make much less emetic.
  Remove old supporting functions.

vinum_scandisk:
  Moved here from vinum.c
  Almost complete rewrite, incorporating much of what was check_drive.
  We still don't have a general way to find the drives on a system, so
  get the user to supply the names via the `read' command.  For each
  device, try each possible compatibility slice name (there's a danger
  of finding both /dev/da1h and /dev/da0s1h otherwise).  Sort the
  partitions found in reverse order of last update time and read them
  in, setting the `update' parameter to parse_config and descendents.

save_config: rename to daemon_save_config, since the function is now
called by the daemon.  Create a new function save_config which queues
the request with the daemon.

daemon_save_config:  some mods to allow for the unfamiliar
environment.
1999-01-21 00:35:35 +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
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