Commit Graph

79 Commits

Author SHA1 Message Date
briggs cf294f8f84 Ensure that b_bufsize is set to a range covering the buffer in vndstrategy().
This addresses kern/16570 where using the raw vnd device with a file backed by
NFS was failing due to bp->b_bufsize being 0.
2002-05-02 16:25:23 +00:00
thorpej a180cee23b Pool deals fairly well with physical memory shortage, but it doesn't
deal with shortages of the VM maps where the backing pages are mapped
(usually kmem_map).  Try to deal with this:

* Group all information about the backend allocator for a pool in a
  separate structure.  The pool references this structure, rather than
  the individual fields.
* Change the pool_init() API accordingly, and adjust all callers.
* Link all pools using the same backend allocator on a list.
* The backend allocator is responsible for waiting for physical memory
  to become available, but will still fail if it cannot callocate KVA
  space for the pages.  If this happens, carefully drain all pools using
  the same backend allocator, so that some KVA space can be freed.
* Change pool_reclaim() to indicate if it actually succeeded in freeing
  some pages, and use that information to make draining easier and more
  efficient.
* Get rid of PR_URGENT.  There was only one use of it, and it could be
  dealt with by the caller.

From art@openbsd.org.
2002-03-08 20:48:27 +00:00
tsutsui cf839323de Call malloc(9) with M_ZERO flag instead of memset() after malloc(). 2002-01-13 19:28:06 +00:00
mrg 3ccb704762 add a vnddetach: it just free()s the vnd_softc. useful for LKM. 2002-01-04 06:31:08 +00:00
lukem 2bbe2de647 add RCSIDs 2001-11-13 05:32:49 +00:00
mrg 1578242c1a use _KERNEL_OPT so this can be built as an LKM. 2001-10-22 16:43:55 +00:00
chs 30e122c6f1 in vndstrategy(), handle the underlying file being force-unmounted. 2001-09-30 12:32:09 +00:00
thorpej c8b4ac1b17 bcopy -> memcpy
bzero -> memset
2001-07-07 17:04:01 +00:00
fvdl d040bd5908 Return error in the case of using ODIOCGDINFO or ODIOCGDEFLABEL when
the number of partitions is > OLDMAXPARTITIONS. This is better
than silently truncating the label (don't want to silently throw
away partitions when using an old disklabel binary on a label with
> 8 partitions). From Enami Tsugutomo.
2001-01-08 02:03:45 +00:00
fvdl e2d1c1f926 Adapt all disk devices in MI directories to handle ODIOC* calls
for ports that have bumped MAXPARTITIONS (and thus define
__HAVE_OLD_DISKLABEL).
2001-01-07 18:09:01 +00:00
chs aeda8d3b77 Initial integration of the Unified Buffer Cache project. 2000-11-27 08:39:39 +00:00
enami 9466b8d07e Define an auto variable `bn' as off_t instead of int since it is finally
converted to byte offset.
2000-09-12 08:03:24 +00:00
pk b369b979ae Remove duplicate `flags' from printf format string. 2000-08-20 11:51:52 +00:00
pk 0c448da29b When breaking up a transfer in vndstrategy(), only inherit B_READ and
B_ASYNC from the original buffer's flags.
2000-08-19 10:44:02 +00:00
augustss 169ac5b3c1 Remove register declarations. 2000-03-30 12:41:09 +00:00
thorpej fe551f0e64 Fix a bug in disksort_*() which caused non-optimal ordering when multiple
active partitions were on a single spindle.  Add a b_rawblkno member to
struct buf which contains the non-partition-relative block number to sort
by.
2000-02-07 20:16:47 +00:00
thorpej dc59bc1db3 Update for sys/buf.h/disksort_*() changes. 2000-01-21 23:39:55 +00:00
fvdl ba7e45647d Initialize buffer dependencies list for soft updates when initializing
a new buffer.
1999-11-17 09:34:03 +00:00
thorpej 81eb5b98aa Add a couple of missing splbio()/splx() pairs that caused pool corruption. 1999-04-21 22:14:15 +00:00
thorpej b6ac7c9b6b Must use PR_NOWAIT when allocating component buffers. 1998-11-12 22:39:57 +00:00
thorpej 6056af462f Use the pool allocator for vndxfer and vndbuf structures. 1998-07-31 02:24:26 +00:00
bouyer 44650d03a6 Better fix for PR 5113, per discussion with fvdl: now that the vnode locking
interface allow recusive locks, use it instead of the local hack to avoid
recursive locking.
1998-03-12 16:51:41 +00:00
fvdl ad83e1aac8 Fix vn_lock argument botch. From Manuel Bouyer (PR 5113). 1998-03-04 15:34:41 +00:00
fvdl e5bc90f40c Merge with Lite2 + local changes 1998-03-01 02:20:01 +00:00
thorpej b0b3787d14 Include the NFS option header. 1998-02-19 00:47:02 +00:00
bad e73453eaf8 In vndsetcred(): after establishing credentials, flush all buffers
associated with the vnode from the buffer cache.  This obviates the
need to flush the buffer cache manually after ``vnconfig -u''.
1998-01-26 23:30:44 +00:00
enami d6eb3246bf Fix a typo in panic string. 1997-12-31 02:46:51 +00:00
enami e4aca18342 When building fake disklabel, if a partition type is other than FS_UNUSED
don't override it so that port specific hack takes effect.
1997-12-31 02:38:24 +00:00
pk 1743d97bd7 Pull over fixes from vm_swap.c:
- guard against synchronous I/O completion
	- avoid race conditions
	- use bgetvp/brelvp to properly maintain the vnode holdcount
	  and clean/dirty buffer lists.
1997-12-02 13:54:48 +00:00
fvdl 9e76627586 Do hack around VOP_BMAP call to avoid recursive locks. The locking
interface doesn't allow currently to specify recursive locks.
Should fix vnd device locking panics.
1997-10-20 00:11:03 +00:00
mycroft 7bbb69534f Add a missing splx(). From augustss. 1997-10-10 02:05:36 +00:00
jtc d6ae2cd7fd Fix tipo inherited from old version of TNF copyright template. 1997-10-09 08:03:42 +00:00
thorpej 939e074dcc Implement DIOCGDEFLABEL. 1997-10-08 23:05:22 +00:00
thorpej f26fad2f33 Add missing call to vndunlock(), per PR #3811, enami tsugutomo. 1997-08-26 18:12:58 +00:00
fair c27c286843 %x -> 0x%x 1997-08-04 10:00:11 +00:00
kleink d72a3b2da1 Leftover from last commit: require us to be initialized when a DIOCGDINFO
ioctl(2) is issued; the uninitialized disklabel pointer might get dereferenced
otherwise.
1997-06-26 16:28:34 +00:00
thorpej 8ad2b19321 In vndioctl(), consolidate checks for "open for writes" and "initialized",
and cover all of the cases we're supposed to cover.
1997-06-26 04:16:31 +00:00
thorpej d69ef9b761 Remove an outdated comment that is not true with the Mach VM system. 1997-06-26 04:06:57 +00:00
thorpej 5029dd336b Add full disklabel and partition support to the vnd driver, allowing much
greater flexibility in its use.  Additionally, add support for "geometry
emulation".  This allows the "geometry" of the "disk" to be specified
at config time, providing near-perfect emulation of disklabel-less floppies,
CD-ROMs, etc., including non-512-byte sectors.  If a geometry is not
specified at config time, a default based on 1M cylinders will be used.
1997-06-23 21:03:55 +00:00
pk 5521477455 Remove attempt to use files with holes; it's prone to deadlocks. 1997-06-08 15:59:41 +00:00
pk 6c88c4ca23 Avoid race for residual count and pending requests count. 1997-06-08 15:55:34 +00:00
pk f959841d17 Pass correct offset to vn_rdwr(). 1997-05-26 20:28:38 +00:00
pk e571ff8ba8 Add code (#ifdef'ed VND_FILLHOLES for now) to fall back on vn_rdwr()
if VOP_BMAP() does not produce a translation.

IO_SYNC is used to prevent dirty file cache buffers. On a ffs filesystem,
once a hole is filled, subsequent vnd accesses find will find valid
VOP_BMAP() translations.

Concerns:
	* is the assumed semantics correct for all filesystems?
	* do we actually want the automagic extension on the VND
	  backing store..
1997-05-25 22:27:16 +00:00
pk 740da4fa88 Use an additional structure to keep information on a set of transfers
initiated by vnd_strategy(). This allows for more natural error handling
and solves two bugs:
	* vnd can disk_unbusy without disk_busy (PR#2657)
	* b_resid is set correctly on the external at the end
	  of a transfer in case of an error.
1997-05-25 19:37:36 +00:00
pk 317703b784 Pass correct transfer count to disk_unbusy(). 1997-05-25 16:21:45 +00:00
pk 0dae2eb53d Avoid negative values for `b_dirtyend' and `b_validend'. 1997-05-19 22:08:56 +00:00
pk 7a45e8a551 Fill in b_dirtyoff/b_dirtyend and b_validoff/b_validend appropriately
in each auxiliary buffer; the strategy routines (esp. NFS's) like that.
1997-05-19 14:41:54 +00:00
mycroft 8f8b0d91e5 Remove bogus use of splhigh(), and apparently unneeded bzero(). 1997-03-12 22:31:37 +00:00
thorpej e0145dbc88 NFSCLIENT -> NFS 1997-01-31 05:18:51 +00:00
christos 86373f8cf9 backout kprintf changes 1996-10-13 01:37:04 +00:00