summaryrefslogtreecommitdiffstats
path: root/sys/dev/md
Commit message (Collapse)AuthorAgeFilesLines
* Back out M_* changes, per decision of the TRB.imp2003-02-191-2/+2
| | | | Approved by: trb
* Mark our provider with G_PF_CANDELETE in the cases where this is actuallyphk2003-02-111-8/+14
| | | | the case.
* NO_GEOM cleanup: unifdefphk2003-01-301-111/+0
|
* Implement MDIOCLIST which returns the unit numbers of configured md(4)phk2003-01-271-0/+11
| | | | | | | | devices. We use the md_pad[] array and if there are more units than its size the last returned unit number will be -1, but the number of units returned is correct.
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-2/+2
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* OK Ok, so I didn't check the NO_GEOM case for the final version...phk2003-01-131-3/+3
| | | | Stumbled on by: bde
* Enable the new h0h0magic code which on GEOM kernels make the md(4)phk2003-01-131-3/+0
| | | | driver a _real_ GEOM driver.
* Add a mutex around the per unit bioqueue.phk2003-01-131-12/+28
| | | | | | | | Only grab giant in the per unit kthread for SWAP and VNODE backed devices. Initialize the bioq before the kthread gets a chance to study it. Don't lock Giant in mddone_swap, we shouldn't need it.
* Remove the printf which announces the creation of malloc disks: it isphk2003-01-131-1/+0
| | | | | | | | inconsistent when we do not do it for swap or vnode. We still printf for preloaded disks because of the weak debugging options people have in embedded/tiny environments where this is usually used.
* Add code to make md(4) a GEOM device driver instead of relying inphk2003-01-121-4/+134
| | | | | | the disk mini-layer. This is currently not enabled.
* Shift things around a bit in preparation for future evilness.phk2003-01-121-43/+48
|
* Move the check for the MD_SHUTDOWN flag to before the tsleep() calliedowse2002-11-301-1/+1
| | | | | | | | | | in the per-device kthread. This ensures that synchronisation with mddestroy() succeeds even if the kthread was not waiting in tsleep() at the time of the wakeup(). Among other things, this fixes the problem of mdconfig getting stuck when an attempt is made to use a zero-length file as a vnode-type backing store. Approved by: re
* We want /dev/md0 for ramdisk roots, not /dev/md0c.phk2002-10-211-1/+1
| | | | Sponsored by: DARPA & NAI Labs
* Use ENOSPC error return, not ENOMEM.phk2002-10-201-3/+5
| | | | Use %jd rather than %lld.
* MODINFO_SIZE metadata has type size_t, not unsigned. This makes preloadedjake2002-10-131-1/+1
| | | | md root work on sparc64.
* Some kernel threads try to do significant work, and the default KSTACK_PAGESscottl2002-10-021-1/+1
| | | | | | | | | | | | | doesn't give them enough stack to do much before blowing away the pcb. This adds MI and MD code to allow the allocation of an alternate kstack who's size can be speficied when calling kthread_create. Passing the value 0 prevents the alternate kstack from being created. Note that the ia64 MD code is missing for now, and PowerPC was only partially written due to the pmap.c being incomplete there. Though this patch does not modify anything to make use of the alternate kstack, acpi and usb are good candidates. Reviewed by: jake, peter, jhb
* Put the casts on the right hand side of =.phk2002-09-281-1/+1
|
* Initialize fwsectors/fwheads to allow the DIOCGFWSECTORS andgrehan2002-09-221-2/+2
| | | | | | DIOCGFWHEADS ioctls to return meaningful values to disklabel/newfs Approved by: phk
* (This commit touches about 15 disk device drivers in a very consistentphk2002-09-201-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and predictable way, and I apologize if I have gotten it wrong anywhere, getting prior review on a patch like this is not feasible, considering the number of people involved and hardware availability etc.) If struct disklabel is the messenger: kill the messenger. Inside struct disk we had a struct disklabel which disk drivers used to communicate certain metrics to the disklayer above (GEOM or the disk mini-layer). This commit changes this communication to use four explicit fields instead. Amongst the benefits is that the fields do not get overwritten by wrong or bogus on-disk disklabels. Once that is clear, <sys/disk.h> which is included in the drivers no longer need to pull <sys/disklabel.h> and <sys/diskslice.h> in, the few places that needs them, have gotten explicit #includes for them. The disklabel inside struct disk is now only for internal use in the disk mini-layer, so instead of embedding it, we malloc it as we need it. This concludes (modulus any mistakes) the series of disklabel related commits. I belive it all amounts to a NOP for all the rest of you :-) Sponsored by: DARPA & NAI Labs.
* Replace (ab)uses of "NULL" where "0" is really meant.archie2002-08-221-1/+1
|
* Yet another warning fix for 64 bits platforms.mux2002-06-241-2/+3
| | | | Reviewed by: phk
* mdcreate_vnode() isn't correctly clearing things out of the linkedphk2002-06-151-2/+2
| | | | | | list if the file is of 0 size or mdsetcred() fails. Submitted by: Martin Faxer <gmh003532@brfmasthugget.se>
* - Whitespace only: use return statement consistentlt (return (foo), notsobomax2002-06-101-8/+6
| | | | | return(foo)), kill extra blank names between function names; - fix format string in printf(): devtoname() returns string, not pointer.
* Use a per-device worker thread to avoid blocking in mdstrategy()iedowse2002-06-031-11/+36
| | | | | | | until the I/O completes. This fixes some easily reproducable deadlocks that occur when using md(4) with GEOM. Reviewed by: phk
* Mis-edit in last commit.phk2002-05-261-0/+1
|
* Be a bit smarter about rewriting data so we don't loose too much performance.phk2002-05-261-21/+21
| | | | Sponsored by: DARPA & NAI Labs.
* Use an umazone per unit for allocating the sectors for malloc backing.phk2002-05-261-14/+32
| | | | | | Clean up things properly when we unconfigure malloc backed units. Sponsored by: DARPA & NAI Labs.
* Give the "malloc" backing of md(4) an adaptive multilevel index tree tophk2002-05-251-64/+225
| | | | | | | | | | | remove the need for a contiguous array with pointers to all the sectors. Try to make failure to malloc(9) memory a non-hang situation. Eventually this will allow us to test the 64bit cleanness of the disk I/O patch, but more work is outstanding here and elsewhere. Sponsored by: DARPA & NAI Labs.
* Fix a memory-leak when configuring a vnode backed md(4) device fails.phk2002-05-031-13/+16
| | | | | Submitted by: Martin Faxér <gmh003532@brfmasthugget.se> MFC after: 4 weeks
* Remove unused include.jeff2002-03-201-1/+0
|
* The previous commit missed fixing 2 old printf format errors andbde2002-03-191-3/+3
| | | | introduced a format printf error.
* Fix printf warning caused by recent changes in bio_pblkno's type.gallatin2002-03-191-1/+2
|
* Introduce the new 64-bit size disk block, daddr64_t. Changemckusick2002-03-151-1/+1
| | | | | | | | | | | | the bio and buffer structures to have daddr64_t bio_pblkno, b_blkno, and b_lblkno fields which allows access to disks larger than a Terabyte in size. This change also requires that the VOP_BMAP vnode operation accept and return daddr64_t blocks. This delta should not affect system operation in any way. It merely sets up the necessary interfaces to allow the development of disk drivers that work with these larger disk block addresses. It also allows for the development of UFS2 which will use 64-bit block addresses.
* Simple p_ucred -> td_ucred changes to start using the per-thread ucredjhb2002-02-271-7/+6
| | | | reference.
* Staticize the malloc definitions.phk2002-02-101-2/+2
| | | | Obtained from: ~bde/sys.dif.gz
* Gah! last commit botched indentation, fix indentation and some otherphk2002-01-211-122/+122
| | | | white-space nits while at it.
* Restructure slightly, eliminating some repetitive source lines andphk2002-01-211-77/+34
| | | | making GEOM patches simpler and more readable at the same time.
* Actually make use of the md_version field of 'struct mdio'. In orderdd2001-12-201-0/+13
| | | | | | not to needlessly break compatibility, decrement MDIOVERSION to 0. Approved by: phk
* Implement IO_NOWDRAIN and B_NOWDRAIN - prevents the buffer cache from blockingdillon2001-11-051-4/+7
| | | | | | | | | | | | | in wdrain during a write. This flag needs to be used in devices whos strategy routines turn-around and issue another high level I/O, such as when MD turns around and issues a VOP_WRITE to vnode backing store, in order to avoid deadlocking the dirty buffer draining code. Remove a vprintf() warning from MD when the backing vnode is found to be in-use. The syncer of buf_daemon could be flushing the backing vnode at the time of an MD operation so the warning is not correct. MFC after: 1 week
* Change the kernel's ucred API as follows:jhb2001-10-111-2/+1
| | | | | | | | - crhold() returns a reference to the ucred whose refcount it bumps. - crcopy() now simply copies the credentials from one credential to another and has no return value. - a new crshared() primitive is added which returns true if a ucred's refcount is > 1 and false (0) otherwise.
* Use crhold() instead of crdup(). The md(4) driver doesn't modify the ucredjhb2001-10-091-1/+2
| | | | | that it uses, so it merely needs to bump its refcount to make it immutable rather than obtain its own copy.
* KSE Milestone 2julian2001-09-121-35/+36
| | | | | | | | | | | | | | 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
* OOPS, remove local change that somehow slipped into a commit (I swear thatsobomax2001-08-271-1/+0
| | | | | | | I already deleted it some time ago). This should fix problem people have with unsefined reference to `MD_PRELOAD_COMPRESSED'. Submitted by: Manfred Antar <null@pozo.com>
* - On module unload try to detach all configured disks and let unload proceedsobomax2001-08-271-57/+69
| | | | | | | | | if all disks were detached sucessfully; - use consistent style for return statements and fix several others style inconsistencies. Reviewed by: ru Approved by: phk
* There is no MD_OBJET disk type, it's actually MD_SWAP. I guess thedd2001-08-161-1/+1
| | | | former was either a previous or proposed name that kind of snuck in.
* Introduce a force option, MD_FORCE, that instructs the driver todd2001-08-071-2/+5
| | | | | | | | | | | | | | | | bypass some extra anti-foot-shooting measures. Currently, its only effect is to allow detaching a device while it's still open (e.g., mounted). This is useful for testing how the system reacts to a disk suddenly going away, which can happen with some removeable media. At this point, the force option is only checked on detach, so it would've been possible to allow the option to be passed with the MDIOCDETACH operation. This was not done to allow the possibility of having the force flag influence other tests in the future, which may not necessarily deal with detaching the device. Reviewed by: sobomax Approved by: phk
* - Deny detaching requests until device is still open, otherwise it is possiblesobomax2001-08-021-3/+17
| | | | | | | | to hang or panic kernel by detaching disk from which fs is mounted; - replace "md" with MD_NAME in yet another place. Reviewed by: phk Approved by: phk
* Make sure the total number of sectors is not 0 for a vnode-type md totmm2001-07-261-0/+4
| | | | | | avoid a division by zero which would occur on open() in this case. Reviewed by: phk
* Use MD_NAME and MDCTL_NAME constants where appropriate.dd2001-07-181-2/+3
|
* With Alfred's permission, remove vm_mtx in favor of a fine-grained approachdillon2001-07-041-5/+4
| | | | | | | | | (this commit is just the first stage). Also add various GIANT_ macros to formalize the removal of Giant, making it easy to test in a more piecemeal fashion. These macros will allow us to test fine-grained locks to a degree before removing Giant, and also after, and to remove Giant in a piecemeal fashion via sysctl's on those subsystems which the authors believe can operate without Giant.
OpenPOWER on IntegriCloud