aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/md
Commit message (Collapse)AuthorAgeFilesLines
* MFC rev. 1.129. (Attempt #2 to fix this problem without breakingColin Percival2004-09-021-0/+2
| | | | | | | | | | | | | anything else.) When creating a new md, g_waitidle() to make sure the /dev entry gets created before mdconfig(8) returns, *but only if it's not a preloaded md*. Approved by: re (kensmith) Notes: svn path=/stable/5/; revision=134653
* Back out the MFC done as rev 1.127.2.1. It seems to fix the problem ofKen Smith2004-08-281-1/+0
| | | | | | | | | | | | | | mdconfig returning before the device's name appears in /dev but it seems to cause a worse problem. When booting the installation media (CD or boot floppies) the system hangs after the device probes, at the point it should be trying to mount a MD-based filesystem as its root filesystem. Backing out this patch solves that problem, allowing it to proceed to the sysinstall menu. Approved by: re (rwatson) Notes: svn path=/stable/5/; revision=134452
* MFC rev. 1.128: Insert a g_waitidle() call in order to ensure that newColin Percival2004-08-251-0/+1
| | | | | | | | | memory disks appear in /dev before mdconfig(8) returns. Approved by: re (kensmith) Notes: svn path=/stable/5/; revision=134306
* Tag all geom classes in the tree with a version number.Poul-Henning Kamp2004-08-081-0/+1
| | | | Notes: svn path=/head/; revision=133318
* Use a ->fini() from the geom class to destroy the control device.Poul-Henning Kamp2004-08-081-40/+19
| | | | | | | Use default initialization of geom methods. Notes: svn path=/head/; revision=133313
* Do a pass over all modules in the kernel and make them return EOPNOTSUPPPoul-Henning Kamp2004-07-151-0/+1
| | | | | | | | | | | for unknown events. A number of modules return EINVAL in this instance, and I have left those alone for now and instead taught MOD_QUIESCE to accept this as "didn't do anything". Notes: svn path=/head/; revision=132199
* Do the dreaded s/dev_t/struct cdev */Poul-Henning Kamp2004-06-161-3/+3
| | | | | | | Bump __FreeBSD_version accordingly. Notes: svn path=/head/; revision=130585
* Fix panic which occurs when given sector size for memory-backed devicePawel Jakub Dawidek2004-05-181-2/+1
| | | | | | | | | | is less than DEV_BSIZE (512) bytes. Reported by: Mike Bristow <mike@urgle.com> Approved by: phk Notes: svn path=/head/; revision=129379
* Ooops, removed this acknowledgement bogusly.Warner Losh2004-04-091-0/+4
| | | | | | | Eagle Eyes: bde Notes: svn path=/head/; revision=128044
* Remove advertising clause from University of California Regent'sWarner Losh2004-04-071-8/+0
| | | | | | | | | | license, per letter dated July 22, 1999 and email from Peter Wemm, Alan Cox and Robert Watson. Approved by: core, peter, alc, rwatson Notes: svn path=/head/; revision=128019
* In some cases, sf_buf_alloc() should sleep with pri PCATCH; in others, itAlan Cox2004-04-031-1/+1
| | | | | | | | | | should not. Add a new parameter so that the caller can specify which is the case. Reported by: dillon Notes: svn path=/head/; revision=127788
* Fix a bug with preloaded image -- for some reason [that i don'tLuigi Rizzo2004-03-311-14/+3
| | | | | | | | | | | | completely understand], md_takeroot() runs before md_preloaded(), rendering both useless. As a fix, move the body (effectively one line!) of md_takeroot() into md_preloaded(), and get rid of the stuff that has become useless. Bug and fix reported 10 days ago on -current, no reply. Notes: svn path=/head/; revision=127691
* - Remove some unused #includes.Alan Cox2004-03-191-69/+55
| | | | | | | - Apply some style fixes to mdstart_swap(). Notes: svn path=/head/; revision=127211
* Utilize sf_buf_alloc() and sf_buf_free() to implement the ephemeralAlan Cox2004-03-181-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mappings required by mdstart_swap(). On i386, if the ephemeral mapping is already in the sf_buf mapping cache, a swap-backed md performs similarly to a malloc-backed md. Even if the ephemeral mapping is not cached, this implementation is still faster. On 64-bit platforms, this change has the effect of using the direct virtual-to-physical mapping, avoiding ephemeral mapping overheads, such as TLB shootdowns on SMPs. On a 2.4GHz, 400MHz FSB P4 Xeon configured with 64K sf_bufs and "mdmfs -S -o async -s 128m md /mnt" before: dd if=/dev/md0 of=/dev/null bs=64k 134217728 bytes transferred in 0.430923 secs (311465697 bytes/sec) after with cold sf_buf cache: dd if=/dev/md0 of=/dev/null bs=64k 134217728 bytes transferred in 0.367948 secs (364773576 bytes/sec) after with warm sf_buf cache: dd if=/dev/md0 of=/dev/null bs=64k 134217728 bytes transferred in 0.252826 secs (530870010 bytes/sec) malloc-backed md: dd if=/dev/md0 of=/dev/null bs=64k 134217728 bytes transferred in 0.253126 secs (530240978 bytes/sec) Notes: svn path=/head/; revision=127182
* Allow swap-backed devices to run without Giant.Alan Cox2004-03-141-3/+1
| | | | Notes: svn path=/head/; revision=126935
* Fix a long-standing deadlock issue with vnode backed md(4) devices:Poul-Henning Kamp2004-03-101-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | On vnode backed md(4) devices over a certain, currently undetermined size relative to the buffer cache our "lemming-syncer" can provoke a buffer starvation which puts the md thread to sleep on wdrain. This generally tends to grind the entire system to a stop because the event that is supposed to wake up the thread will not happen until a fair bit of the piled up I/O requests in the system finish, and since a lot of those are on a md(4) vnode backed device which is currently waiting on wdrain until a fair amount of the piled up ... you get the picture. The cure is to issue all VOP_WRITES on the vnode backing the device with IO_SYNC. In addition to more closely emulating a real disk device with a non-lying write-cache, this makes the writes exempt from rate-limited (there to avoid starving the buffer cache) and consequently prevents the deadlock. Unfortunately performance takes a hit. Add "async" option to give people who know what they are doing the old behaviour. Notes: svn path=/head/; revision=126821
* kthread_exit() no longer requires Giant, so don't force callers to acquireJohn Baldwin2004-03-051-2/+2
| | | | | | | | | Giant just to call kthread_exit(). Requested by: many Notes: svn path=/head/; revision=126674
* Make swapbacked md(4) devices respect the -x and -y emulation arguments.Poul-Henning Kamp2004-03-021-0/+4
| | | | Notes: svn path=/head/; revision=126507
* Use DEV_BSIZE byte sectors instead of PAGE_SIZE byte sectors forColin Percival2004-02-291-19/+49
| | | | | | | | | | | | | | | | swap-backed memory disks. This reduces filesystem allocation overhead and makes swap-backed memory disks compatible with broken code (dd, for example) which expects to see 512 byte sectors. The size of a swap-backed memory disk must still be a multiple of the page size. When performing page-aligned operations, this change has zero performance impact. Reviewed by: phk Approved by: rwatson (mentor) Notes: svn path=/head/; revision=126408
* Device megapatch 4/6:Poul-Henning Kamp2004-02-211-0/+2
| | | | | | | | | | | Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION. Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags. Notes: svn path=/head/; revision=126080
* Allow specification of a geometry for vnode backed devices as well asPoul-Henning Kamp2004-01-121-0/+4
| | | | | | | for malloc backed devices. Notes: svn path=/head/; revision=124421
* Fix a locking problem with MD_ROOT_SIZE.Poul-Henning Kamp2003-12-131-6/+3
| | | | | | | Retire md(4)'s static major number. Notes: svn path=/head/; revision=123521
* Use the class->init() to hitch up preload devices, rather than rely onPoul-Henning Kamp2003-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@ Notes: svn path=/head/; revision=122889
* Don't initialize unused bio_blkno field.Poul-Henning Kamp2003-10-181-1/+0
| | | | Notes: svn path=/head/; revision=121203
* The present defaults for the open and close for device drivers whichPoul-Henning Kamp2003-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. Notes: svn path=/head/; revision=120506
* Consistently use the BSD u_int and u_short instead of the SYSV uint andJohn Baldwin2003-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) Notes: svn path=/head/; revision=118607
* Change the implementation of swap backing to use the VM system in normalPoul-Henning Kamp2003-08-051-22/+58
| | | | | | | ways, and drop the need for vm_pager_strategy(). Notes: svn path=/head/; revision=118467
* Add fdidx argument to vn_open() and vn_open_cred() and pass -1 throughout.Poul-Henning Kamp2003-07-271-2/+2
| | | | Notes: svn path=/head/; revision=118094
* Remove 256 unit limit, there is no evil minor number encoding toPoul-Henning Kamp2003-06-221-2/+0
| | | | | | | | | deal with any more. Spotted by: "Darren Freestone" <df@cops.org> Notes: svn path=/head/; revision=116682
* Remove the G_CLASS_INITIALIZER, we do not need it anymore.Poul-Henning Kamp2003-05-311-1/+0
| | | | Notes: svn path=/head/; revision=115468
* The IO_NOWDRAIN and B_NOWDRAIN hacks are no longer needed to preventPoul-Henning Kamp2003-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. Notes: svn path=/head/; revision=115456
* Use vm_object_deallocate(), not vm_pager_deallocate(), to destroy aAlan Cox2003-05-161-2/+2
| | | | | | | | | | vm object. (vm_pager_deallocate() does not, in fact, destroy a vm object.) Approved by: re (scottl) Reviewed by: phk Notes: svn path=/head/; revision=115060
* Call g_wither_geom(), instead of just setting the flag.Poul-Henning Kamp2003-05-021-3/+13
| | | | Notes: svn path=/head/; revision=114497
* Add a couple of undocumented test options to MD(4) to aid in regressionPoul-Henning Kamp2003-04-091-22/+33
| | | | | | | testting of GEOM. Notes: svn path=/head/; revision=113289
* Remove all references to BIO_SETATTR. We will not be using it.Poul-Henning Kamp2003-04-031-1/+0
| | | | Notes: svn path=/head/; revision=113032
* Use bioq_flush() to drain a bio queue with a specific error code.Poul-Henning Kamp2003-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. Notes: svn path=/head/; revision=112946
* Don't include <sys/disk.h>.Poul-Henning Kamp2003-04-011-2/+0
| | | | Notes: svn path=/head/; revision=112944
* remove a blank line.Poul-Henning Kamp2003-03-291-1/+0
| | | | Notes: svn path=/head/; revision=112827
* Allocate the toplevel indir with M_WAITOK to avoid complicating thingsPoul-Henning Kamp2003-03-271-2/+6
| | | | | | | | | needlessly. Detected by: rwatsons EvilMalloc(9) Notes: svn path=/head/; revision=112702
* Change g_class initialization to sparse format.Poul-Henning Kamp2003-03-241-3/+1
| | | | Notes: svn path=/head/; revision=112555
* Including <sys/stdint.h> is (almost?) universally only to be able to usePoul-Henning Kamp2003-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. Notes: svn path=/head/; revision=112367
* Centralize the devstat handling for all GEOM disk device driversPoul-Henning Kamp2003-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. Notes: svn path=/head/; revision=111979
* Add a "-S sectorsize" option to enable Kirk to find a bug :-)Poul-Henning Kamp2003-03-031-1/+7
| | | | Notes: svn path=/head/; revision=111818
* Gigacommit to improve device-driver source compatibility betweenPoul-Henning Kamp2003-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) Notes: svn path=/head/; revision=111815
* Back out M_* changes, per decision of the TRB.Warner Losh2003-02-191-2/+2
| | | | | | | Approved by: trb Notes: svn path=/head/; revision=111119
* Mark our provider with G_PF_CANDELETE in the cases where this is actuallyPoul-Henning Kamp2003-02-111-8/+14
| | | | | | | the case. Notes: svn path=/head/; revision=110695
* NO_GEOM cleanup: unifdefPoul-Henning Kamp2003-01-301-111/+0
| | | | Notes: svn path=/head/; revision=110096
* Implement MDIOCLIST which returns the unit numbers of configured md(4)Poul-Henning Kamp2003-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. Notes: svn path=/head/; revision=109929
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.Alfred Perlstein2003-01-211-2/+2
| | | | | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. Notes: svn path=/head/; revision=109623
* OK Ok, so I didn't check the NO_GEOM case for the final version...Poul-Henning Kamp2003-01-131-3/+3
| | | | | | | Stumbled on by: bde Notes: svn path=/head/; revision=109192