summaryrefslogtreecommitdiff
path: root/sys/dev/vnd.c
AgeCommit message (Collapse)Author
2013-12-29Modularize net/zlib so it can be used by the vnd module (and, eventually,pgoyette
by an opencrypto module).
2013-09-15Remove unused variablemartin
2013-06-09Never return ENXIO in ioctl anymore. We don't have a fixed number of vnd'schristos
configured.
2013-06-03widen the operation on the RHS as suggested in the PR.christos
2013-06-03PR/47879: Takahiro HAYASHI: vnd cannot handle disk image larger than 2TiBchristos
change size_t to uint64_t where needed.
2013-05-29phase 1 of disk geometry cleanup:christos
- centralize the geometry -> plist code so that we don't have n useless copies of it.
2012-06-09autodiscover wedgesmlelstv
2012-03-26When backed by a sparse file limit the number of pending requests.hannken
Should fix PR #45829: "writing to vnd on sparse file blocks on pager_map" where the pager_map gets exhausted by requests enqueued on a vnd device and the device worker thread blocks on putpages() needing the map. While here always sync the underlying vnode before calling biodone(). XXX: vnd should be converted to mutex/condvar.
2011-10-14Change the vnode locking protocol of VOP_GETATTR() to request at leasthannken
a shared lock. Make all calls outside of file systems respect it. The calls from file systems need review. No objections from tech-kern.
2011-06-29Make vnd(4) work on sparse files:hannken
- Make the strategy decision a device flag and set VNF_USE_VN_RDWR for files known to be sparse. - Change handle_with_rdwr() to use POSIX_FADV_NOREUSE advise to disable read ahead and keep the size of mapped pages below 1 MByte. No objections on tech-kern@.
2011-06-12Welcome to 5.99.53! Merge rmind-uvmplock branch:rmind
- Reorganize locking in UVM and provide extra serialisation for pmap(9). New lock order: [vmpage-owner-lock] -> pmap-lock. - Simplify locking in some pmap(9) modules by removing P->V locking. - Use lock object on vmobjlock (and thus vnode_t::v_interlock) to share the locks amongst UVM objects where necessary (tmpfs, layerfs, unionfs). - Rewrite and optimise x86 TLB shootdown code, make it simpler and cleaner. Add TLBSTATS option for x86 to collect statistics about TLB shootdowns. - Unify /dev/mem et al in MI code and provide required locking (removes kernel-lock on some ports). Also, avoid cache-aliasing issues. Thanks to Andrew Doran and Joerg Sonnenberger, as their initial patches formed the core changes of this branch.
2011-05-23Don't use the device name as format string.joerg
2011-02-08Remove clause 3 (UCB advertising clause) from the University of Utahrmind
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks! Also, merge UCB and Utah copyright texts back into one, as they originally were. Extra verification by snj@.
2010-11-19Introduce struct pathbuf. This is an abstraction to hold a pathnamedholland
and the metadata required to interpret it. Callers of namei must now create a pathbuf and pass it to NDINIT (instead of a string and a uio_seg), then destroy the pathbuf after the namei session is complete. Update all namei call sites accordingly. Add a pathbuf(9) man page and update namei(9). The pathbuf interface also now appears in a couple of related additional places that were passing string/uio_seg pairs that were later fed into NDINIT. Update other call sites accordingly.
2010-09-19actually, put the old definitions back into vndvar.h, under _KERNEL,mrg
as netbsd32 wants access to them.
2010-09-19fix the vnd_osize changes on 32 bit platforms with 64 bit alignment formrg
64 bit integers (eg, sparc). the problem was that the new 64 bit element on the end was used for the offsetof() (aka size) for the old structure, but this includes the padding required, thus the ioctl number was set wrongly. move all the supporting code for this inside COMPAT_50, with some renaming to suit, and kill all the external definitions related to it. tested on i386, amd64 and sparc.
2010-09-19add support for COMPAT_50 ioctls. struct vnd_user has a dev_t componentmrg
which grew since netbsd 5.0 (hi christos!) fix a few issues/problems: - the COMPAT_30 code wasn't used since opt_compat_netbsd.h wasn't included - move 'struct vnd_ouser' (for COMPAT_30) into vnd.c itself, and call it 'struct vnd_user30' - same for VNDIOOCGET -> VNDIOCGET30 now 'vnconfig -l' works on -current with a netbsd-5 binary, using i386. XXX: there is still a potential problem with the old VNDIOOCSET and VNDIOOCCLR macros on some platforms like sparc. there is padding between the old vnd_osize member and the new vnd_size member on platforms that want 64 bit values 64 bit aligned, but are 32 bit otherwise (like sparc.) 64 bit systems already end up with this member 64 bit aligned, and should be fine. this most likely results in the old ioctl numbers being wrong and the code won't match/run ever (ENOTTY.)
2010-06-24Add wedge (dk(4)) support to vnd(4) devices.riz
2010-06-24Clean up vnode lock operations pass 2:hannken
VOP_UNLOCK(vp, flags) -> VOP_UNLOCK(vp): Remove the unneeded flags argument. Welcome to 5.99.32. Discussed on tech-kern.
2010-03-02For the nfs throttling kludge, test against v_tag == VT_NFS insteadpooka
of v_op (the latter imposes linkage).
2010-01-31Properly register blocksize with disk(9) framework.mlelstv
2010-01-23struct buf::b_iodone is not called at splbio() any more.bouyer
Make sure non-MPsafe iodone callbacks raise the SPL as appropriate. Fix buffer corruption issue I noticed in dk(4), and probable similar issues in vnd(4) and cgd(4).
2009-12-06Make vnd_size (the returned size) 64 bit, keeping old field for ioctldsl
compatibility. Both fields are now unsigned. Add compatibility for the old ioctl size. Detect and error files which are definitely sparse (va_bytes < va_size). Part of fix for PR/41873.
2009-08-07Re-use DK_BUSY().dyoung
2009-07-07At the bottom of vndclear(), clear VNF_CLEARING: it is no longerdyoung
needed to exclude vndopen(), and it will prevent subsequent opens if we leave it.
2009-07-02In vndopen(), release the lock before returning ENXIO.dyoung
2009-05-07struct cfdata * -> cfdata_t, no functional changes intended.cegger
2009-05-06Unneeded LK_CANRECURSE.ad
2009-04-30Flesh out vnd_detach(). Let the system detach vnd(4) at shutdown. Stopdyoung
vnd_ioctl(VNDIOCCLR) from racing with vndopen() to call vndclear().
2009-04-30Fix spelling. if( -> if (. No functional change intended.dyoung
2009-04-30Use NULL instead of (type *)0. Delete extraneous parentheses. Nodyoung
functional change intended.
2009-03-18bzero -> memsetcegger
2009-03-14Add FSYNC_CACHE flag to the VOP_FSYNC() call for the DIOCCACHESYNC ioctl.apb
PR 41015.
2009-03-14PR/41015: Alan Barrett: vnd driver does not implement DIOCCACHESYNCchristos
2009-02-05Add support for the MODULAR framework to the vnd driver. Enable building ofhaad
vnd.kmod by default.
2009-01-13g/c BUFQ_FOO() macros and use bufq_foo() directly.yamt
2009-01-11make this compilecegger
2009-01-11merge christos-time_tchristos
2008-11-19Check that vnd is not NULL before using it, return ENXIO if it is.bouyer
Avoids a panic when vnconfig -uF is used on a busy vnd.
2008-11-12Remove LKMs and switch to the module framework, pass 1.ad
Proposed on tech-kern@.
2008-09-24PR kern/38872 vnconfig panics with rw lock errorad
Pass IO_NODELOCKED where needed.
2008-07-19buf_destroy() an embedded buffer before returning memory to poolkardel
issue detected by LOCKDEBUG panicing about "allocation contains active lock"
2008-06-17Disable the check introduced in rev. 1.184. It works in first place, but not ↵cegger
in second place. The new check is not enough to detect sparse files reliably. per discussion with bouyer
2008-06-14Checking if the underlying file system supports VOP_BMAP and VOP_STRATEGY ↵cegger
does not imply that works. Test if VOP_BMAP actually works before using bmap/strategy. When you create an image with dd if=/dev/zero of=./netbsd.img bs=1m count=1 seek=1000 then the current check actually determines the "file system" in the image supports VOP_BMAP and VOP_STRATEGY, but VOP_BMAP can't translate any logical block numbers which results in EIO failures. When you try to access the image in a Xen DomU you see all disk operations failing. Therefore test if VOP_BMAP actually works and fall back to VOP_READ/VOP_WRITE if it doesn't. This makes a Xen DomU installation working. When you boot your fresh installed Xen DomU with a valid disklabel and file system in the image, VOP_BMAP actually works and is used. This allows you to create an image with dd as above on the Dom0 and run a DomU installation or to quickly create another virtual disk for an existing DomU without having to create a disklabel and file system by hand.
2008-06-14add closing bracket in debug messagecegger
2008-06-10device_private(device_lookup()) -> device_lookup_private()cegger
ok cube@
2008-05-05Back out previous. It broke the build.ad
2008-05-04Move zlib out of net/ and into kern/. It would probably be better to usead
the reachover Makefiles and libz, but this is already here and it works.
2008-04-28Remove clause 3 and 4 from TNF licensesmartin
2008-04-09use aprint_*_dev and device_xnamecegger