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>
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.
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).
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.
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..
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.