summaryrefslogtreecommitdiffstats
path: root/sys/dev/md/md.c
Commit message (Collapse)AuthorAgeFilesLines
* Allow specification of a geometry for vnode backed devices as well asphk2004-01-121-0/+4
| | | | for malloc backed devices.
* Fix a locking problem with MD_ROOT_SIZE.phk2003-12-131-6/+3
| | | | Retire md(4)'s static major number.
* Use the class->init() to hitch up preload devices, rather than rely onphk2003-11-181-2/+6
| | | | | | | | | the "old" SYSINIT. This makes sure things happen in the right order. XXX: md(4) needs to be fully geom-ified and in particluar /dev/md.ctl should be abandonded for the GEOM OaM api. Approved by: re@
* Don't initialize unused bio_blkno field.phk2003-10-181-1/+0
|
* The present defaults for the open and close for device drivers whichphk2003-09-271-2/+0
| | | | | | | | | | | | | | provide no methods does not make any sense, and is not used by any driver. It is a pretty hard to come up with even a theoretical concept of a device driver which would always fail open and close with ENODEV. Change the defaults to be nullopen() and nullclose() which simply does nothing. Remove explicit initializations to these from the drivers which already used them.
* Consistently use the BSD u_int and u_short instead of the SYSV uint andjhb2003-08-071-4/+4
| | | | | | | ushort. In most of these files, there was a mixture of both styles and this change just makes them self-consistent. Requested by: bde (kern_ktrace.c)
* Change the implementation of swap backing to use the VM system in normalphk2003-08-051-23/+59
| | | | ways, and drop the need for vm_pager_strategy().
* Add fdidx argument to vn_open() and vn_open_cred() and pass -1 throughout.phk2003-07-271-2/+2
|
* Remove 256 unit limit, there is no evil minor number encoding tophk2003-06-221-2/+0
| | | | | | deal with any more. Spotted by: "Darren Freestone" <df@cops.org>
* Remove the G_CLASS_INITIALIZER, we do not need it anymore.phk2003-05-311-1/+0
|
* The IO_NOWDRAIN and B_NOWDRAIN hacks are no longer needed to preventphk2003-05-311-3/+2
| | | | | | deadlocks with vnode backed md(4) devices because md now uses a kthread to run the bio requests instead of doing it directly from the bio down path.
* Use vm_object_deallocate(), not vm_pager_deallocate(), to destroy aalc2003-05-161-2/+2
| | | | | | | vm object. (vm_pager_deallocate() does not, in fact, destroy a vm object.) Approved by: re (scottl) Reviewed by: phk
* Call g_wither_geom(), instead of just setting the flag.phk2003-05-021-3/+13
|
* Add a couple of undocumented test options to MD(4) to aid in regressionphk2003-04-091-22/+33
| | | | testting of GEOM.
* Remove all references to BIO_SETATTR. We will not be using it.phk2003-04-031-1/+0
|
* Use bioq_flush() to drain a bio queue with a specific error code.phk2003-04-011-1/+1
| | | | | | | | Retain the mistake of not updating the devstat API for now. Spell bioq_disksort() consistently with the remaining bioq_*(). #include <geom/geom_disk.h> where this is more appropriate.
* Don't include <sys/disk.h>.phk2003-04-011-2/+0
|
* remove a blank line.phk2003-03-291-1/+0
|
* Allocate the toplevel indir with M_WAITOK to avoid complicating thingsphk2003-03-271-2/+6
| | | | | | needlessly. Detected by: rwatsons EvilMalloc(9)
* Change g_class initialization to sparse format.phk2003-03-241-3/+1
|
* Including <sys/stdint.h> is (almost?) universally only to be able to usephk2003-03-181-1/+0
| | | | | %j in printfs, so put a newsted include in <sys/systm.h> where the printf prototype lives and save everybody else the trouble.
* Centralize the devstat handling for all GEOM disk device driversphk2003-03-081-14/+0
| | | | | | | | in geom_disk.c. As a side effect this makes a lot of #include <sys/devicestat.h> lines not needed and some biofinish() calls can be reduced to biodone() again.
* Add a "-S sectorsize" option to enable Kirk to find a bug :-)phk2003-03-031-1/+7
|
* Gigacommit to improve device-driver source compatibility betweenphk2003-03-031-10/+5
| | | | | | | | | | | | | branches: Initialize struct cdevsw using C99 sparse initializtion and remove all initializations to default values. This patch is automatically generated and has been tested by compiling LINT with all the fields in struct cdevsw in reverse order on alpha, sparc64 and i386. Approved by: re(scottl)
* 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.
OpenPOWER on IntegriCloud