summaryrefslogtreecommitdiffstats
path: root/sys/dev/vinum
Commit message (Collapse)AuthorAgeFilesLines
* Move objflags from vinumvar.h to vinumobj.h in preparation forgrog2001-05-231-2/+37
| | | | requiring fewer header files for userland programs.
* Move external declaration to vinumhdr.h.grog2001-05-231-1/+2
|
* Set flag VF_HASDEBUG in vinum_conf to indicate that the module wasgrog2001-05-231-10/+6
| | | | | | | | | | | | 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.
* New header file.grog2001-05-221-0/+54
| | | | | | Missed by: Szilveszter Adam <sziszi@petra.hos.u-szeged.hu> David Wolfskill <david@catwhisker.org> Pointy hat to: grog
* Remove Malloc definitions (now in vinumext.h)grog2001-05-221-21/+2
|
* Add a field 'version' to vinum_conf. This field is a constant whichgrog2001-05-221-191/+30
| | | | | | | | | | | | | 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.
* vinumstart: If a write request is for a RAID-[45] plex or a volumegrog2001-05-221-13/+23
| | | | | | | | | | | | | | | | | 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
* tokenize: Take third parameter specifying the maximum number ofgrog2001-05-221-6/+8
| | | | | parameters to return. This code is used both in userland and in the kernel.
* Cosmetics: wrap long lines to be < 80 characters.grog2001-05-221-2/+4
|
* Add a new debug flag, DEBUG_LOCKREQS, which logs only lock requests.grog2001-05-221-12/+25
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Change ioctls to use the expurgated userland version of the Vinumgrog2001-05-223-20/+22
| | | | structures.
* format_config: Replace long format lines.grog2001-05-221-18/+28
| | | | | | | | | | | | | | 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.
* complete_rqe:grog2001-05-221-7/+41
| | | | | | | | | | | | 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
* Remove unnecessary declarations of userland functions.grog2001-05-221-13/+25
| | | | | | | | | 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.
* config_sd: Add code to recognize "retryerrors" keyword.grog2001-05-221-29/+48
| | | | | | | | | 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.
* free_vinum: Change some explicit struct member references to the SD,grog2001-05-221-13/+23
| | | | PLEX and VOL.
* Add xferinfo flag bit for copied buffers.grog2001-05-221-2/+16
| | | | | | | 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.
* New file containing definitions for separate views of objects forgrog2001-05-221-0/+275
| | | | userland and kernel.
* Send the remains (such as I have located) of "block major numbers" tophk2001-03-262-4/+1
| | | | the bit-bucket.
* devfs convertion used VINUMRMINOR incorrectly (passing args inalfred2001-03-221-3/+3
| | | | | | backwards order) Submitted by: Bernd Walter <ticso@mail.cicely.de>
* By convention, the moduledata is static unless there is a reason for itpeter2001-03-131-1/+1
| | | | to not be.
* Fix vinum for both devfs and non-devfs systems.alfred2001-02-202-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* forced commit to note that the last delta also reordered some code inalfred2001-02-201-1/+1
| | | | | | | | | | | 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.
* Take a shot at making vinum devfs aware.alfred2001-02-204-19/+57
| | | | | | | | | | | | | | | | | 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.
* Change and clean the mutex lock interface.bmilekic2001-02-092-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* Allocate lock table and mutex not only for parity plexes, but also forgrog2001-02-021-3/+3
| | | | | | | 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>
* - Proc locking around the vinumdaemon dinking with its flags.jhb2001-01-241-1/+6
| | | | - P_INMEM -> PS_INMEM.
* Make intr_nesting_level per-process, rather than per-cpu. Setupjake2001-01-212-2/+2
| | | | | | | | 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
* Correct check for partition c. Previously the check was for drive 2,grog2001-01-201-1/+1
| | | | | | which did not exactly have the desired result. Submitted by: Akira Watanabe <akira@myaw.ei.meisei-u.ac.jp>
* struct rangelock: Remove the field 'plex' from the entry. Range locksgrog2001-01-142-7/+3
| | | | | are accessed only via the plex, so there's never any confusion as to the plex number. This value was, as a result, unused.
* format_config: If a subdisk loses its drive (due to a bug which hasgrog2001-01-141-12/+25
| | | | | | | | | | | | | | | 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".
* config_plex: Check that we have specified a plex organization.grog2001-01-141-3/+6
| | | | Tripped over by: "Jeroen C. van Gelderen" <jeroen@vangelderen.org>
* Reinstate 1.19.grog2001-01-101-2/+3
| | | | Prodded by: iedowse
* Part of rewrite of RAID-[45] locking code:grog2001-01-101-27/+29
| | | | | | | | Rename INITIAL_LOCKS to PLEX_LOCKS, since it now stays a constant. struct plex: Add a mutex lockmtx. Remove alloclocks.
* vinumstart: Don't check for B_DONE on return from bre(), it doesn'tgrog2001-01-101-12/+4
| | | | | | | | | happen any more. abortrequest: don't bufdone the user bp on error, let vinumstart() do it. Based on analysis by: tegge
* bre5: don't bufdone the user bp on error, let vinumstart() do it.grog2001-01-101-2/+1
| | | | Based on analysis by: tegge
* Remove obsolete functions [un]lockplex and [un]lockvol.grog2001-01-101-139/+64
| | | | | | | | | | | | | 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
* Get definition of Malloc right when not using VINUMDEBUGgrog2001-01-101-1/+1
| | | | Pointed out by: tegge
* open_drive: Refuse to open partition c of a disk device.grog2001-01-101-5/+9
| | | | | | | | 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.
* config_plex: Initialize mutex for parity plexes.grog2001-01-101-1/+10
| | | | | | remove_plex_entry: Destroy mutex for parity plexes. Part of rewrite of RAID-[45] locking code.
* Use PCPU_GET, PCPU_PTR and PCPU_SET to access all per-cpu variablesjake2001-01-102-2/+2
| | | | other then curproc.
* Re-commit revision 1.32, which grog incorrectly backed out in revision 1.33.des2000-12-201-4/+6
|
* revive_block: Don't go beyond the end of the stripe when revivinggrog2000-12-201-24/+8
| | | | | | | | | | | | 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.
* build_rq_buffer: Note which buffer headers we lock.grog2000-12-201-0/+9
| | | | | | sdio: Unlock the buffer if we fail. Submitted by: tegge
* Rearrange #includes to make more sense. This is still not the reformgrog2000-12-201-8/+10
| | | | that bde is waiting to see, but at least it works.
* Rename detached plexes and subdisks correctly (off by one error)grog2000-12-201-6/+16
| | | | Submitted by: Terry Glanfield <Terry.Glanfield@program-products.co.uk>
* open_drive: Add support for more than 32 devices of a particular kind.grog2000-12-201-6/+11
| | | | | | | | | | | | 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>
* give_plex_to_volume: Recalculate volume size after attaching.grog2000-12-202-5/+14
| | | | Cosmetics.
* Add flag XFR_BUFLOCKED to identify buffers which have been locked.grog2000-12-201-1/+2
| | | | | | Part of fix to ensure that we unlock buffers we lock. In principle submitted by: tegge
* Don't include system-specific header files for userland program.grog2000-11-281-4/+4
| | | | Discovered by default by: alfred
OpenPOWER on IntegriCloud