summaryrefslogtreecommitdiffstats
path: root/sys/dev/vnd.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* A vnd buf doesn't only go through the vnd bufq but also the bufqthib2011-02-151-1/+7
| | | | | | | | | | | | | | for the device on which the vnd image resides on, this has the effect that a bufq_done call is done in the context of the underlaying bufq, setting b_bq to NULL, meaning there is never a bufq_done call done for the vnd bufq so the outstanding count never decreses. Add one in vndiodone. This fixes the suspsend issues krw@ was running into. ok tedu@, krw@ nod from miod@ on the commit.
* init and destory the bufq in the ioctl handler, asthib2011-01-061-2/+3
| | | | | | | | the softc is zero'ed when the vnd is unconfigured; otherwise we blow up when configuring a vnd the second time since the bufq structure is kaputt. found by and OK krw@
* cut vnd over to using bufq's again.thib2011-01-051-22/+15
| | | | OK dlg@, beck@, krw@.
* When configuring a vnd(4) disk, populate the disk name based on the modejsing2010-12-221-2/+14
| | | | | | | in which it was configured. If this is a "safe" vnd disk the name should be "svndX" whereas a standard vnd disk should be named "vndX". ok deraadt@ todd@ thib@
* 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@
* Garbage collect struct dkdriver.matthew2010-08-281-4/+1
| | | | ok miod@; "please go ahead" jsing@
* Instead of trying to biowait on a buf that has errored, do thethib2010-07-221-10/+15
| | | | | | | | | | | | right thing, throw it away by marking it as B_INVAL and setting the B_ERROR flag and b_error to the errno that was returned. B_RAW doesn't matter there. Issue report my mlarkin@, this diff tested and confirmed to fix the issue by mlarkin also, thanks! OK krw@, beck@, deraadt@
* leases have expired. (remove a comment).thib2010-07-011-2/+1
|
* for the allocated buf, set the b_bq flag to NULL so we do notthib2010-07-011-1/+2
| | | | call bufq_done in biodone.
* dont let sys/ioctl.h imply that you get the ioctls in dkio.h. thisdlg2010-05-181-1/+2
| | | | | | | | | | | gets rid of #include <sys/dkio.h> in sys/ioctl.h and adds #include <sys/dkio.h> to the places that actually want and use the disk ioctls. this became an issue when krw@'s X build failed when he was testing a change to dkio.h. tested by krw@ help from and ok miod@
* 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@
* - fix format strings for values that are daddr64_tjasper2009-08-241-4/+4
| | | | ok otto@, agreed by deraadt@
* Replace the error strings that were being passed around with much simplerderaadt2009-08-131-11/+4
| | | | | | | | | errnos. Note that the error strings are being ignored, since we long ago decided to not spam the console, and there is no other nice way to use the errors (without changing the ioctls to pass it back) The errno is now useful, since we can pass b_error from failing IO up, and the drive can decide how to use that ok miod
* Revert bufq's. this is inline with the major midlayer reverts thatthib2009-06-171-14/+14
| | | | | | have been going on. this appears to bring us back to stable state. lots of testing by oga and ariane and my self.
* Add DIOCRLDINFO to those drivers previously deprived.krw2009-06-041-1/+11
| | | | Noticed by & ok deraadt@
* add a flexible buffer queue (bufq) api, based on the never usedthib2009-06-031-14/+14
| | | | | | | | | one by tedu@. It doesn't do anything smart yet, it just uses plain old disksort. we also keep the old method of queueing bufs since some miods have crazy MD drivers that need some love. ok beck@, art@ tested by many on many archs.
* Replace -s (sector size) option with more general -t (disktype)krw2008-09-031-12/+11
| | | | | | | | | | | option which makes the vnd device emulate the geometry of the specified disktab(5) entry. No change in behaviour or geometry unless -t is used. API for vnd configuration ioctl (VNDIOCSET) changes, so mount_vnd must be in sync with kernel. Tested & ok jsing@ 'Lovely' deraadt@
* Allow the sector size to be specified by the user when configuring ajsing2008-08-141-16/+37
| | | | | | | | | | vnd(4) device, via a new -s option to vnconfig/mount_vnd. This allows us to create disklabels and file systems that are suitable for use on devices that have a non-512 byte sector size (eg. CDROMs). With help from krw@ and feedback from pedro@. ok krw@, pedro@
* Correct cases of mishandling of pending reads and writes to preventbeck2008-07-231-1/+3
| | | | | | | | | | | | | them going negative - this consists of identifying a number of cases of IO not going through the buffer cache and marking those buffers with B_RAW - as well as fixing nfs_bio to show pending writes and reads through the buffer cache via NFS still has a problem with mishandling the counters I believe in the async/sync fallback case where counters stay positive which will be addressed seperately. ok tedu@ deraadt@
* Add DIOCGPDINFO support. 'disklabel -d svnd0' now works.krw2008-07-201-1/+7
|
* Use DEV_BSIZE (defined as 512) instead of 512 when initializing thekrw2008-06-291-2/+2
| | | | | | disklabel's d_secsize. ok millert@ marco@
* Change XXgetdisklabel() to the 'normal' four parameter model tokrw2008-03-241-6/+6
| | | | | | prepare for adding missing DIOC* ioctl's. No functional change.
* more remove unneeded declarations that shadows existing vars; ok by many.fgsch2007-10-151-2/+2
|
* make safe vnds work on block devices.fkr2007-09-291-6/+53
| | | | | from Piotr Durlej, tested by henning@, krw@, thib@ and myself ok thib@, grunk@, krw@
* There is no such word as `detatch'.mk2007-09-121-2/+2
| | | | ok mglocker
* 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-10/+5
| | | | cpu_disklabel can go away, since nothing anymore needs to use it; ok miod
* 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-6/+6
| | | | | | | 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-4/+4
| | | | | 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@
* Use VNDLABELDEV() and not DISKLABELDEV() in writedisklabel() sincekrw2007-05-121-2/+2
| | | | | VNDLABELDEV() is used in readdisklabel(). VNDLABELDEV() preserves the vndsimple() property encoded in the device.
* Replace expansions of DISKLABELDEV() with DISKLABELDEV(). Shorter, andkrw2007-04-291-3/+2
| | | | | | more consistant. No change to code. ok miod@
* include rwlock.h ourselves, better than depending on it getting pickedtedu2007-03-251-1/+2
| | | | up elsewhere
* use a rwlock instead of the homegrown approachtedu2007-03-251-39/+8
| | | | ok art pedro thib
* Don't enforce RLIMIT_FSIZE on vnd(4) I/O operations, okay deraadt@pedro2007-02-261-3/+7
|
* Don't use arbitrary 128 bytes as size of the blf key array if we know exactlygrunk2007-02-211-2/+2
| | | | | | | how much blowfish takes at max, which is 72 bytes. Also define a constant for this in the include file, suggested by ray@. ok pedro@ thib@ tedu@
* Don't throttle and serialize I/O operations, okay miod@ krw@pedro2007-02-011-53/+5
| | | | Fixes kern/5347
* Touch of clean up:thib2007-01-131-79/+46
| | | | | | | | | | | s/DEBUG/VNDDEBUG/ and introduce DNPRINTF, fold all the #ifdef DEBUG <stuff> #endif into DNPRINTFs. Use DTYPE_VND for the disklabel d_type member, dont calcluate d_secpercyl from d_ntrack * d_nsectors, just set it too 100 directly since we set d_ntrack and d_nsectors to 1 and 100 respectivly. testing and OK krw@
* ansify, no binary change, from Bret Lambertpedro2006-12-241-63/+24
|
* Always allow read-only opens on (s)vnd devices, despite thethib2006-10-051-3/+3
| | | | | | type of the first open (svnd vs vnd). ok pedro@
* Introduce daddr64_t and use it for physical block numberspedro2006-10-031-2/+2
| | | | Okay weingart@, "I'm game with putting my name on it" dlg@
* Make vnd(4) work on read-only file systems, from Paul Stoeber, okay tedu@pedro2006-09-201-10/+24
|
* fix a panic when trying to fdisk vnd devices (not svnd) wichthib2006-08-131-1/+6
| | | | | | | | are back by weird images (such as the ones qemu creates). proplem found the hard way by msf@ ok mickey@, pedro@
* 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.
* Nuke dk_establish(), no longer used.miod2006-03-151-2/+1
|
* Disk interrupts can cause buffers to be returned to the vnd pool, sopedro2006-03-041-1/+3
| | | | splbio() is required when allocating. Fixes PR kern/5041, okay tedu@.
* b_cylin -> b_cylinder; no functional change.miod2006-01-221-4/+2
|