Commit Graph

161 Commits

Author SHA1 Message Date
chs 11703af575 don't print b_resid when it's not valid. 2007-01-28 21:33:24 +00:00
christos 168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
jmmv ea4fb88d87 Do not mess with B_VFLUSH in the read/write case. Requested by yamt@.
(I did this because the system could panic otherwise.  But this seemed to
be a side-effect of another mistake that was present in the code before it
was commited.  So effectively this simplification should have happened
before.)
2006-11-11 13:42:14 +00:00
martin 43ae9165b5 size_t is not always == int 2006-11-10 14:31:14 +00:00
jmmv b6714d04d8 Check if the underlying file system supports VOP_BMAP and VOP_STRATEGY and,
if not, fallback to VOP_READ and VOP_WRITE.  This makes vnd work with files
on, e.g. tmpfs and smbfs; all file systems should behave as before.
OK'ed by silence in tech-kern@.
2006-11-09 15:27:40 +00:00
dogcow 372e6ef309 now that we have -Wno-unused-parameter, back out all the tremendously ugly
code to gratuitously access said parameters.
2006-10-17 18:21:29 +00:00
dogcow 4c85d8a8d6 more super exciting fun unused arguments. 2006-10-14 01:49:20 +00:00
christos 4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
cube f6eef99476 Don't accept a compressed image that has 0 for the block size...
Fixes PR#34608.
2006-09-25 13:47:26 +00:00
elad 5425e24592 Use u_quad_t and not uint64_t (even though they might be the same),
pointed out by tsutsui@.
2006-09-23 07:54:17 +00:00
elad af7d9594a4 PR/34589: Cliff Wright: vnd(4) compress error with large files
Applied slightly different patch (u_int64_t -> uint64_t), thanks!
2006-09-23 00:53:46 +00:00
bouyer 2aee9a0f50 Back out rev 1.149.
From various discussion about vndstrategy (see
http://mail-index.netbsd.org/tech-kern/2005/03/29/0034.html
http://mail-index.netbsd.org/tech-kern/2005/03/23/0015.html)
it's not correct to tsleep() in a strategy routine, which may be called from
interrupt context.
Unfortunably this reopens PR/10731, PR/12189, PR/20296, PR/34293

As for what the correct fix it, this needs to be analysed deeper. I suspect
throttling the caller in vnd only hides the problem; the same caller writing
to some other device could exaust all buffers as well. If this driver doesn't
need to allocate buffer this won't cause a deadlock, but it's bad for
performances on systems with e.g. multiple drives. Also, others stacked
block device drivers may also have this issue.
2006-09-03 19:49:34 +00:00
christos b34c6cdc81 PR/34293: Michael van Elst: vnd deadlocks on I/O buffers
Also fixes: PR/10731, PR/12189, PR/20296
Sleep while there a buffer shortage.
2006-08-27 18:45:20 +00:00
ad 3029ac48c7 - Use the LWP cached credentials where sane.
- Minor cosmetic changes.
2006-07-21 16:48:45 +00:00
elad 2867b68bc3 integrate kauth. 2006-05-14 21:42:26 +00:00
cube 59e53df5fa Silence device creation and destruction. That means there won't be
spurious messages when doing "vnconfig -l", but it also means there won't
be a message when an actual device is created.  Oh, well.

PR#33116 by Izumi Tsutsui.
2006-03-30 15:19:45 +00:00
thorpej 2be6494fc9 Use device_cfdata(). 2006-03-29 04:16:44 +00:00
thorpej 39cd836ee1 Use device_unit(). 2006-03-28 17:38:24 +00:00
dogcow a3d114851f as yamt and bouyer pointed out, there are a few other cases where l should
be checked for NULL, if one's going to do it at all, and that the proper idiom
is KASSERT, not panic.
2006-03-21 10:22:59 +00:00
dogcow de119fc4bd in VNDIOCGET, make sure there's a valid lwp. coverity CID 837. 2006-03-18 01:13:24 +00:00
yamt ec5a93183a merge yamt-uio_vmspace branch.
- use vmspace rather than proc or lwp where appropriate.
  the latter is more natural to specify an address space.
  (and less likely to be abused for random purposes.)
- fix a swdmover race.
2006-03-01 12:38:10 +00:00
yamt e31143d772 vndthread: fix an integer overflow. fix a panic reported by Simon Burge. 2006-02-04 13:40:38 +00:00
yamt 9e261d2477 vndstrategy: do bounds_check_with_mediasize. 2006-02-04 13:38:04 +00:00
yamt 6e6449891d vndthread: play with b_vp and v_numoutput as it used to do,
for "strange" filesystems like nfs.  PR/32671 from Simon Burge.

although i'm not really happy with this "fix", i think that the code will
be replaced with direct i/o anyway, sooner or later...
2006-02-04 11:52:32 +00:00
yamt b38b1510eb vnd_cget: remove a wrong comment. 2006-02-04 11:19:59 +00:00
yamt fe1aa7db74 vnd_destroy: don't access freed memory. 2006-02-04 10:48:32 +00:00
cube 69a545f3ff Fix typo. 2006-02-02 06:57:35 +00:00
cube da9c97d43c Move the code that destroys the device to vndclose. That way it no longer
returns ENXIO when deconfiguring a vnd.
2006-02-02 06:56:30 +00:00
cube 9f02c7bd62 Free cfdata memory. The tap LKM might be wrong in that area, to...
Pointed out by Greg Oster.
2006-02-01 05:05:22 +00:00
cube aa933732c0 Free the bufq. Pointed out by yamt@. 2006-02-01 04:30:10 +00:00
cube 6527a45571 Have vnd(4) devices automatically created when the user tries to
configure one.  That removes the compile-time constant that limits the
number of vnds.

Thanks xtraeme@ for testing.
2006-02-01 03:15:33 +00:00
yamt c05dbefbea compstrategy: remove bogus handling of B_PHYS. 2006-01-15 12:14:52 +00:00
yamt 432eec05f5 use nestiobuf api for vnd. 2006-01-11 00:50:29 +00:00
yamt e86cc25701 don't set b_rawblkno unnecessarily.
it will be set by device strategy routine.
2006-01-11 00:49:59 +00:00
yamt fe3aca751f do b_blkno -> b_rawblkno translation earlier so that bufq can use it. 2006-01-08 09:09:00 +00:00
yamt 9c0e5c0db7 - do disk_busy/unbusy for requested i/o, rather than ones that we reuqest.
- on error, be conservative about b_resid.
- make vndthread static.
2006-01-07 13:25:50 +00:00
bouyer fc1d07dd69 Only VNDIOCSET needs a valid process context, so don't blindly
dereference l, test it l is NULL first.
Fix exporting a vnd device to a XENU domain.
2005-12-14 19:49:16 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
yamt aec75b1cc6 - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
  have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
  from sys/bufq.h to sys/bufq_impl.h.
  (is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c.  (not tested)
2005-10-15 17:29:10 +00:00
christos f9364a8936 Fix logic error in vndiocget. 2005-08-28 08:56:14 +00:00
yamt bc505ef8dd use pseudo_disk_{init,attach,detach} where appropriate. 2005-08-20 12:01:04 +00:00
christos 758a209d23 64 bit inode changes. 2005-08-19 02:03:49 +00:00
nathanw 9808119fea Call VOP_UNLOCK() in the case where VND_COMPRESSION isn't defined and
we're about to return EOPNOTSUPP. Prevents a "locking against myself"
panic in vn_close() in the error return path.

Addresses PR# kern/30958
2005-08-18 22:06:25 +00:00
drochner d6736d7a2e minor usability improvements:
-fabricate a trivial geometry also in the case of images <=1M
 (XXX I didn't add a check for >0 size -- this is generally harmless
  because there are enough boundary checks present, and it allows
  to test some corner cases in the disklabel handling code)
-ignore the VNF_KLABEL flag -- the vnd device is if limited (and
 well-defined!) lifetime anyway, and the implications of "keeplabel"
 are confusing at best
2005-07-25 13:25:08 +00:00
christos 2a249fb919 Fix typo in previous [thanks jukka] 2005-07-18 16:36:29 +00:00
christos 98d8ea8729 Fix whitespace issues and use ansi prototypes. 2005-07-18 16:09:37 +00:00
hubertf 673730506c Add support for reading cloop2 compressed filesystem image,
enable by putting VND_COMPRESSION into kernel config file.
Written by Cliff Wright, polished up slightly by me.
2005-07-17 00:08:27 +00:00
bouyer 78ea15ef7f Don't eventually leak vnx and bp on unconfigure, pointed out by YAMAMOTO
Takashi. Instead, let the current I/O complete before killing the thread.
2005-03-31 18:02:16 +00:00
yamt 99229e5d39 introduce a function to drain bufq and use it where appropriate. 2005-03-31 11:28:53 +00:00
bouyer 007f04c4a8 Make vnd do I/O to the underlying file from thread context. This
allows the strategy routine to be called from interrupt context, fixes
PR kern/29775 by Juan RP.
Now that pool_get() is only called from thread context, change PR_NOWAIT to
PR_WAITOK. Fix PR kern/26272 by Juergen Hannken-Illjes.
OK'd by thorpej@
2005-03-30 19:23:08 +00:00