Commit Graph

147 Commits

Author SHA1 Message Date
grog
65d077e189 Fix a bogon which stopped Vinum from recognizing half its keywords. 1999-05-11 03:55:35 +00:00
phk
500e41bd71 I got tired of seeing all the cdevsw[major(foo)] all over the place.
Made a new (inline) function devsw(dev_t dev) and substituted it.

Changed to the BDEV variant to this format as well: bdevsw(dev_t dev)

DEVFS will eventually benefit from this change too.
1999-05-08 06:40:31 +00:00
grog
ed62d1c685 Make Vinum compile correctly without VINUMDEBUG
Tripped-over-by:	Thomas Stromberg <tstromberg@rtci.com>
1999-05-08 02:50:44 +00:00
phk
693dd58bb3 Continue where Julian left off in July 1998:
Virtualize bdevsw[] from cdevsw.  bdevsw() is now an (inline)
        function.

        Join CDEV_MODULE and BDEV_MODULE to DEV_MODULE (please pay attention
        to the order of the cmaj/bmaj arguments!)

        Join CDEV_DRIVER_MODULE and BDEV_DRIVER_MODULE to DEV_DRIVER_MODULE
        (ditto!)

(Next step will be to convert all bdev dev_t's to cdev dev_t's
before they get to do any damage^H^H^H^H^H^Hwork in the kernel.)
1999-05-07 10:11:40 +00:00
grog
4f6fff14ba Include opt_vinum.h to get the VINUMDEBUG definition as early as
possible.  This fixed a problem building LINT.

Tripped-over-by: phk
1999-05-07 08:08:02 +00:00
grog
598e074404 Convert to use physread() and physwrite().
Advertised-by: phk
1999-05-07 08:07:09 +00:00
grog
b1c24e47cf Remove old grunge, including references to sys/disk.h (which is going
away).

Submitted-by:	phk
1999-05-07 01:35:29 +00:00
grog
234c1fa0c8 Remove old grunge
Submitted-by:	phk
1999-05-07 01:25:54 +00:00
phk
f57a01ebfc remove b_proc from struct buf, it's (now) unused.
Reviewed by:	dillon, bde
1999-05-06 20:00:34 +00:00
grog
e77a9a4583 Get extern declarations right.
Change DEBUG_EXITFREE to DEBUG_WARNINGS.
1999-05-02 07:59:04 +00:00
grog
befe3ef850 close_drive:
If a drive has gone down and has dirty buffers associated with it,
  we'll get a panic when we try to vn_close it.  Check for this
  situation and discard any buffers; they're toast anyway.

  Only complain about usage count if DEBUG_WARNINGS is set.

check_drive:
  Change parameter name from drivename to devicename.

  Get the check for a referenced drive right.

  If the partition isn't a vinum drive, set the last error to ENODEV.

vinum_scandisk:
  Change parameter name from drivename [] to devicename [].
1999-05-02 07:51:20 +00:00
grog
f16abeb3d7 vinum_mallocinfo:
Set the entry number correctly.
1999-05-02 07:50:38 +00:00
grog
00c882d027 set_sd_state:
Don't change state from reborn to reborn.  This caused a silly
  warning message.
1999-05-02 07:50:09 +00:00
grog
a2704f47c7 sizespec:
Implement scaling letter 's' to mean 'sectors' (of 512 bytes).
1999-05-02 07:49:13 +00:00
grog
6c7b9a1b08 Remove some dead variables.
Change DEBUG_EXITFREE to DEBUG_WARNINGS.
1999-05-02 07:48:00 +00:00
phk
16e3fbd2c1 Suser() simplification:
1:
  s/suser/suser_xxx/

2:
  Add new function: suser(struct proc *), prototyped in <sys/proc.h>.

3:
  s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/

The remaining suser_xxx() calls will be scrutinized and dealt with
later.

There may be some unneeded #include <sys/cred.h>, but they are left
as an exercise for Bruce.

More changes to the suser() API will come along with the "jail" code.
1999-04-27 11:18:52 +00:00
grog
b13c671e67 free_vinum: clear up a warning message. 1999-04-17 04:15:50 +00:00
grog
4ea2c51252 struct drive: add fields for debugging lockdrive deadlocks. 1999-04-10 08:12:44 +00:00
grog
16b49ae256 set_sd_state:
If a drive is down, take "empty" sds down.  Previously they were
  unchanged, which cause set_plex_state to take them up under some
  circumstances.
1999-04-10 08:12:12 +00:00
grog
a69fe82894 When VINUMDEBUG is set, add function basename() to return the base
name of a file.  Used by MMalloc and lockdrive.
1999-04-10 08:11:44 +00:00
grog
3053fd36c3 lockdrive: Add debug calls to catch occasional deadlocks on drives.
The problem is probably gone, but the debug checks remain
	   for a while.
1999-04-10 08:11:21 +00:00
grog
ab82ea3490 Add flag keyword w. 1999-04-10 08:10:55 +00:00
grog
02db416f92 daemon_save_config:
Fix a potential drive deadlock when saving config to a non-existent
  drive.

Add debug calls to catch occasional deadlocks on drives.  The problem
(above) is probably gone, but the debug checks remain for a while.
1999-04-10 08:10:24 +00:00
grog
fa23ff64d5 Define macro LOCKDRIVE for debugging drive locking deadlocks. 1999-04-10 08:09:49 +00:00
grog
ff04614b5c Add declaration for basename()
Change lockdrive definition if VINUMDEBUG is set.
1999-04-10 08:09:27 +00:00
grog
8a6f490fac Add debug calls to catch occasional deadlocks on drives. The problem
is probably gone, but the debug checks remain for a while.

update_plex_config: Catch yet another divide-by-zero problem when
		    detaching the last subdisk from a striped plex.

Uncovered-by: Michael Reifenberger <root@nihil.plaut.de>
1999-04-10 08:08:45 +00:00
grog
2dbfcc3870 update_plex_config: Eliminate a potential divide-by-zero.
Tripped-over-by: Karl Pielorz <kpielorz@tdx.co.uk>
1999-04-09 01:20:22 +00:00
grog
b08fc2420a Modify parameter checking in LongJmp to match the reality of an
enlarged kernel memory space.

Paniced-over-by:  Karl Pielorz <kpielorz@tdx.co.uk>
		  Michael Reifenberger <root@nihil.plaut.de>
1999-04-09 01:17:50 +00:00
grog
9ba513f1ae Add debug flag DEBUG_EXITFREE to log problems freeing memory on exit. 1999-04-05 04:03:45 +00:00
grog
a06e742697 remove_plex: If we don't find the plex in a volume to which it
claims to belong, remove it anyway.
1999-04-05 04:02:59 +00:00
grog
549cf01690 free_vinum: Clean out bdevsw entry before unloading kld.
Repeatedly-tripped-over-by: Vallo Kallaste <vallo@matti.ee>

		When VINUMDEBUG is set, free any memory found still
		allocated.

		Only log errors if DEBUG_EXITFREE is set.
1999-04-05 04:02:09 +00:00
grog
2559617dbe Destaticize some variables to allow checking on them when exiting. 1999-03-31 08:43:12 +00:00
grog
9c659047e8 daemonq_return request: Clean up request queue and free all memory
before returning to die.
1999-03-31 08:42:52 +00:00
grog
be6c330b8c free_drive: free the drive free list if it has one. 1999-03-31 08:42:04 +00:00
grog
4e194da43d vinumattach: Remove some really old, dead cruft.
free_vinum:	Wait for daemon to stop by checking the
		vinum_conf.flags & VF_DAEMONOPEN.

vinum_modevent:
		When compiled with VINUMDEBUG, check if we have
		forgotten to free any memory, and log an error if we
		have.

vinumopen:	Allow open of an empty subdisk (otherwise we can't
		initialize it).
1999-03-31 08:41:18 +00:00
grog
d14a3d013a Add flag VF_CREATED 1999-03-30 05:01:42 +00:00
grog
73f93e1855 Change the lengths of many ioctl parameters, which occasionally caused
EFAULTS due to sloppy programming.
1999-03-30 05:01:23 +00:00
grog
d99b74f017 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
grog
f5e8f5af9f 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_scandisk: increment drive use count when we find a good one.
1999-03-30 05:00:19 +00:00
grog
56aef4122f 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>

Remove unused (and braindead) functions volume_index, plex_index,
sd_index and drive_index.

Add a flag VF_CREATED for volumes.  VF_NEWBORN was being used in two
capacities, and they clashed, my Lord, they clashed.

find_object: restructure the search loop as a result of the change in
variable use.

Decrement object use count in the remove_<object> functions, not in
the free_<object> functions, which are often called with partially
initialized (and uncounted) objects.
1999-03-30 04:59:59 +00:00
grog
efbcf5a167 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>
1999-03-30 04:59:32 +00:00
grog
dd95cfacee Add definition LongJmp for longjmp if -DVINUMDEBUG.
Change some comment texts
1999-03-28 08:55:04 +00:00
grog
b76a5a44e6 set_sd_state: Handle sd_empty correctly. In particular, require
force to bring a subdisk of a RAID-5 plex out of this
		state.

update_plex_state:  Rewrite yet again.
1999-03-28 08:54:48 +00:00
grog
4e4c94e910 Put some \ns in some log messages. 1999-03-28 08:54:25 +00:00
grog
6457f5694b Add function LongJmp which checks the parameters before calling
longjmp.  I suspect that the occasional double panic may be the result
of incorrect parameters to longjmp.  This happens, of course, like the
entire file, only with -DVINUMDEBUG.
1999-03-28 08:54:03 +00:00
grog
1df24b0ec0 Remove longjmp declaration. 1999-03-28 08:53:46 +00:00
grog
3f46a30c8a Add declaration for forceup () (in vinumstate.c)
Add declarations for setjmp, cmd_buf and longjmp.
1999-03-28 08:53:23 +00:00
grog
7dd8acc7c6 Remove longjmp declaration.
give_sd_to_plex: Don't set Raid-5 subdisk state here.

config_subdisk: handle the name parameter correctly when the subdisk
		was referenced in a previous plex definition.  The
		name parameter must come first.

		Handle autosizing relatively correctly.  There is
		still a danger of losing drive space if problems
		occur with an autosized subdisk.

		Set state to empty, not up, when complete.  This also
		solves a nagging problem about enforcing the need to
		initialize RAID-5 plexes.

config_plex:    handle the name parameter correctly when the plex
		was referenced in a previous volume definition.  The
		name parameter must come first.

		Handle initial state better.

update_plex_config:
		Calculate the trim factor for RAID-5 plexes correctly.

		Set the number of down subdisks correctly when reading
		from disk config.
1999-03-28 08:53:02 +00:00
grog
27e0e9777f Remove longjmp declaration.
free_vinum:	Put a timeout on waiting for the daemon to die.
1999-03-28 08:52:33 +00:00
grog
fe2c874b37 Add 'referenced' states to subdisks and plexes. 1999-03-28 08:52:11 +00:00