summaryrefslogtreecommitdiffstats
path: root/sys/dev/ramdisk.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Eliminate ramdisk.c and ramdisk.h now that they're unused.matthew2011-06-231-633/+0
|
* Drop kernel support for the useless DIOCWLABEL ioctl and prune a lotmatthew2011-06-051-8/+1
| | | | | | | | | of silly flag twiddling code in various disk drivers. ok deraadt@, miod@ N.B., users will need a -current disklabel(8) to be able to write new disklabels to disk now.
* Get rid of the wlabel argument to bounds_check_with_label(). It'smatthew2011-06-031-2/+2
| | | | | | | | | never done anything in OpenBSD and just clutters disk drivers with silly flag handling. More cleanup to follow. ok deraadt@, millert@; no objections krw@
* Change a few of the more common disk drivers (sd, cd, wd, rd, and vnd)matthew2011-05-311-2/+2
| | | | | | | | | | | | | | | | | | | to return EBUSY if the user tries to modify an open partition's offset or size. Only sadness can result if a user tries this, and rejecting it prevents a race between sdstart() and sdstrategy(). Curiously, there was already code in the kernel and in disklabel(8) to detect/handle this, but it was effectively disabled because the disk drivers always used something like "/* sc->sc_dk.dk_openmask */ 0", and this commented out code has existed since even r1.1 in NetBSD. I had no problems building a release and messing around with disklabel(8) for a bit with this diff. Canarying the more common MI disk drivers until we gain confidence that there aren't any regressions, then we can switch the remaining drivers. "I am surprised you got me convinced that this stuff is safe" deraadt@ ok krw@
* All users of physio(9) now pass NULL as the buf pointer argument, somatthew2010-09-221-3/+3
| | | | | | | no point in keeping it around. "i like this" thib@ (a while back); ok krw@ and oga@; reminder to update the man page and tweaks jmc@
* Store a struct device pointer within struct disk and populate this whenjsing2010-09-081-2/+2
| | | | | | | disk_attach() is called by the device driver. We will be building on this shortly. ok deraadt@ krw@
* no need for an activate function if it just returns 0deraadt2010-09-071-9/+2
|
* Garbage collect struct dkdriver.matthew2010-08-281-3/+1
| | | | ok miod@; "please go ahead" jsing@
* Recycle unused disklabel fields in order to create a disklabel uniquejsing2010-04-231-3/+1
| | | | | | | identifier, allowing the disk to be identified without relying on the device name. ok deraadt@ krw@ beck@ marco@ todd@
* Get rid of devact enum, substitute it with an int and coresponding defines.pirofti2009-10-131-3/+3
| | | | | | This is needed for the addition of further suspend/resume actions. Okay deraadt@, marco@.
* ANSI and other cleanups; ok krwderaadt2008-08-221-118/+71
|
* Make sure the label is read in rdopen(), this isn't the case if youmiod2008-07-121-1/+6
| | | | | | boot bsd.rd -a and want to mount the ramdisk later on. ok otto@ krw@ millert@
* Don't bypass partition bounds check for RAW_PART. We now guarantee thatkrw2008-06-151-5/+3
| | | | | | | | | | | RAW_PART will always be 0 -> disksize, so the bounds check will always pass for i/o's to valid addresses. Now the i/o will be properly truncated if it goes past the end of the device. This prevents various adverse impacts of issuing i/o's for data past the end of the device. Repeatedly requested by todd@. ok weingart@ deraadt@
* Make rd act more like a 'normal' disk device, allowing the elimination ofkrw2008-05-231-3/+49
| | | | | | | | | | | 'fakerootdev' hackery. This allows us to bring back miod@'s r1.70 subr_disk.c change to avoid the GENERIC dance when rootdev has been initialized. This in turn re-enables raidframe root devices. Add a nice panic if rootdev can't be initialized, displaying the name of the device that didn't work rather than just blowing up by de-referencing NULL. ok deraadt@
* return with ENOTTY instead of EINVAL for unknown ioctl requests.brad2008-01-051-1/+4
| | | | ok krw@ deraadt@ dlg@
* KNFgilles2007-09-111-2/+2
| | | | prompted and "much better" by marco@, ok pyr@
* more M_ZERO changesgilles2007-09-081-3/+2
| | | | ok pyr@ and krw@
* b_cylinder does not need to be set on the callpath down into drivers.deraadt2007-06-201-25/+14
| | | | cpu_disklabel can go away, since nothing anymore needs to use it; ok miod
* avoid modification race in DIOCRLDINFO; ok krw miodderaadt2007-06-181-5/+7
|
* Implement DIOCRLDINFO, DIOCGPDINFO and DIOCGPART. Tweak DIOCGDINFO tokrw2007-06-181-12/+36
| | | | | | avoid unnecessary rdgetdisklabel() call. requested by & ok deraadt@
* all drivers should spoof version 1 labelsderaadt2007-06-081-1/+2
|
* now that all partition size/offsets are potentially 64-bit, change thederaadt2007-06-061-3/+3
| | | | | | | type of all variables to daddr64_t. this includes the APIs for XXsize() and XXdump(), all range checks inside bio drivers, internal variables for disklabel handling, and even uvm's swap offsets. re-read numerous times by otto, miod, krw, thib to look for errors
* use six new macros to access & store the 48-bit disklabel fields relatedderaadt2007-06-051-3/+3
| | | | | to size. tested on almost all machines, double checked by miod and krw next comes the type handling surrounding these values
* Don't initialize d_partitions[RAW_DISK] just before callingkrw2007-06-011-6/+1
| | | | | | readdisklabel(), since all readdisklabel()'s do that already. ok deraadt@
* Pass a real dev_t to readdisklabel(), not a unit number with lipstick.krw2007-04-241-7/+7
| | | | | | Suggestions from miod@, KNF nit from mk@ ok miod@ millert@
* Eliminate D_CHAIN, D_ECC and D_RAMDISK flags from disklabel. They werekrw2006-09-241-2/+1
| | | | | | | not being used in the tree for anything obviously useful. Get it done early so we can find if there are non-obvious uses out there. ok deraadt@ beck@
* Now that DEV_BSIZE is universally defined as 1 << DEV_BSHIFT, use it tokrw2006-08-141-2/+2
| | | | | | | set d_secsize instead of 1 << DEV_BSHIFT. Just for textual consistency in setting d_secsize. No functional change.
* Setting d_secsize to DEV_BSIZE (or 1 << DEV_BSHIFT, or 512) and thenkrw2006-08-121-3/+2
| | | | | | | | | | setting RAW_PART's p_size to d_secperunit * (d_secsize / DEV_BSIZE) is a waste of a few ops. And p_size should be in sectors anyway. Just set RAW_PART's p_size to d_secperunit to make usage consistant across the tree. Should be a no-op.
* Do not compile RAMDISK_SERVER functionnality by default if option SMALL_KERNEL;miod2005-06-301-2/+2
| | | | saves roughly 512 bytes.
* Complete 'lp.d_' to 'lp->d_' changes started with r1.24 so that ramdisk_cd andkrw2004-04-031-18/+18
| | | | | | friends compile again. ok tdeval@.
* Better bounds checking in strategy(), and kill the (unused) rd flagsmiod2004-04-011-67/+52
| | | | | | while there. ok tdeval@ (long ago)
* Do not fill more than the first three fields of cfdriver structures unlessmiod2004-01-141-2/+2
| | | | necessary. No functional change.
* typos from Tom Cosgrove;jmc2003-10-211-3/+3
|
* Some string cleanup: sprintf -> snprintf and magic numbers to sizeofkrw2003-04-191-5/+9
| | | | | | | | | (remember: d_[type|pack]name do not need terminating null). Take the opportunity to introduce some paranoia and check the device name lengths to make sure they fit, with appropriate errors if not. ok tedu@ tdeval@
* Provide a functional d_psize() function for ramdisk block devices.miod2003-03-031-16/+25
| | | | ok deraadt@
* Protect biodone calls with splbio.art2002-05-231-1/+7
|
* First round of __P removal in sysmillert2002-03-141-10/+10
|
* Replace inclusion of <vm/foo.h> with the correct <uvm/bar.h> when necessary.miod2001-11-061-2/+1
| | | | (Look ma, I might have broken the tree)
* Use macros from sys/disklabel.h instead of custom ones with slightlymillert2001-10-241-25/+16
| | | | different (and thus confusing) semantics.
* merge vm/vm_kern.h into uvm/uvm_extern.h; art@ okmickey2001-09-191-3/+1
|
* Add missing call to minor() in RDLABELDEV macro.millert2001-07-081-2/+2
| | | | | This only worked before by luck. Fixes floppy panic in -current. Thanks to krw@ for the DDB traceback, it helped ;-)
* zap old vmart2001-06-271-7/+1
|
* No need to check M_WAIT/M_WAITOK malloc return values. (art@ ok)ho2001-05-161-5/+1
|
* We don't need a prototype for kmem_alloc.art1999-11-161-4/+1
|
* vaddr_t/vsize_tmickey1999-09-141-7/+6
|
* compatibility with uvm kmem allocatorsart1999-02-261-1/+10
|
* Add a "spoofonly" argument to readdisklabel() which will be used tomillert1998-10-031-2/+2
| | | | | implement an ioctl to get a spoofed label even for disks that have a label on them.
* avoid "no disklabel" error messagesderaadt1997-10-181-2/+2
|
* Changes to ramdisk driver to support disklabels. Work done by Theo.rahnds1997-02-061-8/+110
| | | | | | | | | | | | | | | | | | | | | | | This will require changes for each machine type. changes to MAKEDEV, suggest treating rd like sd --- sd*|vnd*|ccd*|rd*) ... rd*) name=rd; blk=17; chr=17;; --- Make certain that majors and minors are correct conf.c add a entry in cdevsw for rd (previously was only in bdev) --- cdev_decl(rd); ... struct cdevsw cdevsw[] = { ... cdev_disk_init(NRD,rd), /* 17 ram disk driver*/ --- other changes to how rdconfig is called may be appropriate, it must now be configured using the "raw" parition typically 'c'.
* partial sync with netbsd 960418, more to comederaadt1996-04-211-44/+88
|