Commit Graph

208 Commits

Author SHA1 Message Date
pooka
b6d93fa026 For the nfs throttling kludge, test against v_tag == VT_NFS instead
of v_op (the latter imposes linkage).
2010-03-02 21:32:29 +00:00
mlelstv
d2fd323d98 Properly register blocksize with disk(9) framework. 2010-01-31 15:40:08 +00:00
bouyer
5d530cfdab struct buf::b_iodone is not called at splbio() any more.
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).
2010-01-23 18:31:04 +00:00
dsl
b2df25db53 Make vnd_size (the returned size) 64 bit, keeping old field for ioctl
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-12-06 16:33:18 +00:00
dyoung
ec63b8722d Re-use DK_BUSY(). 2009-08-07 00:08:07 +00:00
dyoung
c88ea823f8 At the bottom of vndclear(), clear VNF_CLEARING: it is no longer
needed to exclude vndopen(), and it will prevent subsequent opens
if we leave it.
2009-07-07 19:51:22 +00:00
dyoung
ec3ba2c85b In vndopen(), release the lock before returning ENXIO. 2009-07-02 02:06:11 +00:00
cegger
ed4086f2eb struct cfdata * -> cfdata_t, no functional changes intended. 2009-05-07 09:13:13 +00:00
ad
b5dc34151d Unneeded LK_CANRECURSE. 2009-05-06 22:38:42 +00:00
dyoung
c968789de1 Flesh out vnd_detach(). Let the system detach vnd(4) at shutdown. Stop
vnd_ioctl(VNDIOCCLR) from racing with vndopen() to call vndclear().
2009-04-30 20:34:08 +00:00
dyoung
b44d7cdf40 Fix spelling. if( -> if (. No functional change intended. 2009-04-30 16:38:12 +00:00
dyoung
114a99200c Use NULL instead of (type *)0. Delete extraneous parentheses. No
functional change intended.
2009-04-30 16:07:50 +00:00
cegger
c363a9cb62 bzero -> memset 2009-03-18 16:00:08 +00:00
apb
2a86bfea6b Add FSYNC_CACHE flag to the VOP_FSYNC() call for the DIOCCACHESYNC ioctl.
PR 41015.
2009-03-14 18:00:37 +00:00
christos
19b058b35e PR/41015: Alan Barrett: vnd driver does not implement DIOCCACHESYNC 2009-03-14 16:33:25 +00:00
haad
7aa7bdd03c Add support for the MODULAR framework to the vnd driver. Enable building of
vnd.kmod by default.
2009-02-05 17:32:10 +00:00
yamt
70de973662 g/c BUFQ_FOO() macros and use bufq_foo() directly. 2009-01-13 13:33:58 +00:00
cegger
08ebead94e make this compile 2009-01-11 09:51:38 +00:00
christos
461a86f9bd merge christos-time_t 2009-01-11 02:45:45 +00:00
bouyer
fec31ce43e Check that vnd is not NULL before using it, return ENXIO if it is.
Avoids a panic when vnconfig -uF is used on a busy vnd.
2008-11-19 18:38:36 +00:00
ad
0efea177e3 Remove LKMs and switch to the module framework, pass 1.
Proposed on tech-kern@.
2008-11-12 12:35:50 +00:00
ad
3704b6874f PR kern/38872 vnconfig panics with rw lock error
Pass IO_NODELOCKED where needed.
2008-09-24 07:57:30 +00:00
kardel
b6ecf59844 buf_destroy() an embedded buffer before returning memory to pool
issue detected by LOCKDEBUG panicing about "allocation contains active lock"
2008-07-19 13:58:08 +00:00
cegger
d9fad28f12 Disable the check introduced in rev. 1.184. It works in first place, but not in second place.
The new check is not enough to detect sparse files reliably.
per discussion with bouyer
2008-06-17 09:01:56 +00:00
cegger
75946855ff Checking if the underlying file system supports VOP_BMAP and VOP_STRATEGY 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-14 11:44:57 +00:00
cegger
826cd7b39b add closing bracket in debug message 2008-06-14 07:52:36 +00:00
cegger
fc8fd752ef device_private(device_lookup()) -> device_lookup_private()
ok cube@
2008-06-10 22:53:08 +00:00
ad
2bbb14eaa4 Back out previous. It broke the build. 2008-05-05 13:41:29 +00:00
ad
b407147f14 Move zlib out of net/ and into kern/. It would probably be better to use
the reachover Makefiles and libz, but this is already here and it works.
2008-05-04 23:07:09 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
cegger
c1886a2781 use aprint_*_dev and device_xname 2008-04-09 05:47:19 +00:00
ad
a9ca7a3734 Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.
2008-03-21 21:54:58 +00:00
cube
e567de2f43 Split device_t/softc and other related cosmetic changes. 2008-03-04 23:03:29 +00:00
ad
4a780c9ae2 Merge vmlocking2 to head. 2008-01-02 11:48:20 +00:00
riz
0673bc57e4 Add disk-info properties to vnd(4), for use by userland tools
such as gpt(8).
2007-12-18 23:22:18 +00:00
smb
472e153a90 Add power management hooks 2007-12-12 03:54:27 +00:00
pooka
db06a930e6 Remove cn_lwp from struct componentname. curlwp should be used
from on.  The NDINIT() macro no longer takes the lwp parameter and
associates the credentials of the calling thread with the namei
structure.
2007-12-08 19:29:36 +00:00
pooka
61e8303e9d Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start.  In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern
2007-11-26 19:01:26 +00:00
ad
2af68666da Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.
2007-10-08 16:41:05 +00:00
ad
eb171eaaa7 It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
2007-07-29 12:50:17 +00:00
ad
88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
hannken
e956461048 Remove calls to now obsolete vn_start_write() and vn_finished_write(). 2007-04-07 15:06:53 +00:00
ad
59d979c5f1 Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.
2007-03-12 18:18:22 +00:00
yamt
073d78105b use b_bcount where appropriate rather than keeping b_resid sync with it.
no functional changes.
2007-03-09 05:28:37 +00:00
christos
15eacddccc Fix compression problem from Cliff Wright:
Break one: because b_cylinder, and b_resid are one and the same.
The work the routine was commented as being its primary function,
end of patition adjustment, is wiped out, as at the end of
the routine b_cylinder is set, splat, doing a wipe out of the adjustment
to b_resid.
  Break two: When doing the adjustment, a block count is created from a
byte count, a block calculation is done, then the results are compared to
the original byte count. i.e. apples to oranges, not blocks to blocks,
but blocks to bytes.
  Break three: since if all the other drivers that used this routine
would have broken as vnd compress did, I must assume they always ignored
the results of this routine. So if end of patition adjustment is
really required then all these other drivers have been broken for a
long time.
2007-03-05 02:55:32 +00:00
christos
53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
thorpej
712239e366 Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
2007-02-21 22:59:35 +00:00
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