Commit Graph

457 Commits

Author SHA1 Message Date
chs f0b6149f57 change spec_{read,write}() to specify the device blkno in units of DEV_BSIZE
rather than the device's sector size.  this allows /dev/rcd0a and /dev/cd0a
to return the same data.  fixes PRs 3261 and 14026.
2001-09-23 04:39:25 +00:00
sommerfeld 181c4513dc Add fifo_putpages() placebo so that the vnode's uobj is unlocked. 2001-09-22 22:35:18 +00:00
chs d0b76cab5e use shared locks instead of exclusive for VOP_READ() and VOP_READDIR(). 2001-09-21 08:02:55 +00:00
chs 4111c37251 when zeroing pages past EOF, don't zero the page containing EOF if it
already contains valid data.  should fix PRs 13361 and 13436.
2001-09-21 07:52:25 +00:00
chs 5f5ac77eff add a forward decl for struct vm_page. 2001-09-15 22:38:40 +00:00
chs 099a6b5258 interfaces and structures used by new genfs_{get,put}pages(). 2001-09-15 21:33:05 +00:00
chs 64c6d1d2dc a whole bunch of changes to improve performance and robustness under load:
- remove special treatment of pager_map mappings in pmaps.  this is
   required now, since I've removed the globals that expose the address range.
   pager_map now uses pmap_kenter_pa() instead of pmap_enter(), so there's
   no longer any need to special-case it.
 - eliminate struct uvm_vnode by moving its fields into struct vnode.
 - rewrite the pageout path.  the pager is now responsible for handling the
   high-level requests instead of only getting control after a bunch of work
   has already been done on its behalf.  this will allow us to UBCify LFS,
   which needs tighter control over its pages than other filesystems do.
   writing a page to disk no longer requires making it read-only, which
   allows us to write wired pages without causing all kinds of havoc.
 - use a new PG_PAGEOUT flag to indicate that a page should be freed
   on behalf of the pagedaemon when it's unlocked.  this flag is very similar
   to PG_RELEASED, but unlike PG_RELEASED, PG_PAGEOUT can be cleared if the
   pageout fails due to eg. an indirect-block buffer being locked.
   this allows us to remove the "version" field from struct vm_page,
   and together with shrinking "loan_count" from 32 bits to 16,
   struct vm_page is now 4 bytes smaller.
 - no longer use PG_RELEASED for swap-backed pages.  if the page is busy
   because it's being paged out, we can't release the swap slot to be
   reallocated until that write is complete, but unlike with vnodes we
   don't keep a count of in-progress writes so there's no good way to
   know when the write is done.  instead, when we need to free a busy
   swap-backed page, just sleep until we can get it busy ourselves.
 - implement a fast-path for extending writes which allows us to avoid
   zeroing new pages.  this substantially reduces cpu usage.
 - encapsulate the data used by the genfs code in a struct genfs_node,
   which must be the first element of the filesystem-specific vnode data
   for filesystems which use genfs_{get,put}pages().
 - eliminate many of the UVM pagerops, since they aren't needed anymore
   now that the pager "put" operation is a higher-level operation.
 - enhance the genfs code to allow NFS to use the genfs_{get,put}pages
   instead of a modified copy.
 - clean up struct vnode by removing all the fields that used to be used by
   the vfs_cluster.c code (which we don't use anymore with UBC).
 - remove kmem_object and mb_object since they were useless.
   instead of allocating pages to these objects, we now just allocate
   pages with no object.  such pages are mapped in the kernel until they
   are freed, so we can use the mapping to find the page to free it.
   this allows us to remove splvm() protection in several places.

The sum of all these changes improves write throughput on my
decstation 5000/200 to within 1% of the rate of NetBSD 1.5
and reduces the elapsed time for "make release" of a NetBSD 1.5
source tree on my 128MB pc to 10% less than a 1.5 kernel took.
2001-09-15 20:36:31 +00:00
chs adf5d360a7 add a new VFS op, vfs_reinit, which is called when desiredvnodes is
adjusted via sysctl.  file systems that have hash tables which are
sized based on the value of this variable now resize those hash tables
using the new value.  the max number of FFS softdeps is also recalculated.

convert various file systems to use the <sys/queue.h> macros for
their hash tables.
2001-09-15 16:12:54 +00:00
assar 41f102fe0e install miscfs/syncfs/syncfs.h 2001-09-09 17:42:46 +00:00
chs 94d6f3ee95 map files are zero-length. 2001-08-31 04:56:26 +00:00
chs c60e896954 undo the part of the last revision that made user block device access
use the UBC interfaces.  too many problems with that yet.
2001-08-18 05:34:46 +00:00
chs f051fe3125 add definitions for UBCification of block devices. 2001-08-17 05:52:07 +00:00
chs 103d879bd7 initialize the UVM vnode size for block devices.
UBCify user access to block devices.
2001-08-17 05:51:53 +00:00
chs 5a4fdb6ddb make genfs get/put work for block devices as well:
- the "fs bshift" for block devices is always DEV_BSHIFT.
 - retrieve the device vnode from VOP_BMAP() and use that to set b_dev
   in page i/o buffers.
2001-08-17 05:51:29 +00:00
tv 57c096de20 KNF on previous. 2001-08-16 15:37:06 +00:00
jdolecek 332bb4894a bound check mount args more thoroughly 2001-08-03 06:00:13 +00:00
assar a9eb6b2c79 (*fs_mount): do not get the parent vnode back from namei to just release it 2001-08-02 22:40:58 +00:00
assar bec71dc090 change vop_symlink and vop_mknod to return vpp (the created node)
refed, so that the caller can actually use it.  update callers and
file systems that implement these vnode operations
2001-07-24 15:39:30 +00:00
chs 7ebc99879b don't set PG_RDONLY on the lower layer's pages,
the lower layer needs to have control over that flag.
that didn't solve the whole problem that it was trying to solve anyway.
(the issue is that if we have create mappings to the lower layer,
we need to get rid of those when we copy the file to the upper layer.)
we'll have to figure out some other way to handle this.
2001-07-04 21:38:00 +00:00
jdolecek c57b6d9ba4 Add DTYPE_PIPE (to be used by new pipe implementation) and handle
it accordingly.
2001-06-16 08:28:39 +00:00
thorpej 80cc38a1af Fix a partial construction problem that can cause race conditions
between creation of a file descriptor and close(2) when using kernel
assisted threads.  What we do is stick descriptors in the table, but
mark them as "larval".  This causes essentially everything to treat
it as a non-existent descriptor, except for fdalloc(), which sees a
filled slot so that it won't (incorrectly) allocate it again.  When
a descriptor is fully constructed, the code that has constructed it
marks it as "mature" (which actually clears the "larval" flag), and
things continue to work as normal.

While here, gather all the code that gets a descriptor from the table
into a fd_getfile() function, and call it, rather than having the
same (sometimes incorrect) code copied all over the place.
2001-06-14 20:32:41 +00:00
chs 766dfc9b6f be sure to allocate dirty zeroed pages to cover blocks we allocate
to resolve a write fault.  fixes PR 13201.
also, be sure to allocate blocks for write faults to holes even if
the page is already in memory.  fixes PR 13189.
2001-06-14 08:22:14 +00:00
wiz 09b77243bc Some more corrections by Michael K. Sanders. 2001-06-09 11:02:08 +00:00
wiz e265f98875 Typos and grammer fixes in comments (misc/13133 by Michael K. Sanders) 2001-06-07 13:44:46 +00:00
wiz fa87a2091d Typos in comments (misc/13133 by Michael K. Sanders) 2001-06-07 13:32:46 +00:00
chs c8642d34a1 let kernfs_mmap() use the default error method. 2001-06-03 02:23:31 +00:00
chs 27e388d697 let portalfs_mmap() use the default error method. 2001-06-03 02:22:40 +00:00
chs 6e2828061f procfs_bmap() should never be called, make it a "bad op".
let procfs_mmap() use the default error method.
2001-06-03 02:21:35 +00:00
chs 821ec03ed9 replace vm_map{,_entry}_t with struct vm_map{,_entry} *. 2001-06-02 18:09:08 +00:00
mrg 67afbd6270 use _KERNEL_OPT 2001-05-30 11:57:16 +00:00
chs 45701591c6 add a genfs_mmap() and change all of the disk-based filesystems
to implement VOP_MMAP() with the genfs version, in preparation for
actually using this VOP.
2001-05-28 02:50:51 +00:00
chs 11a9651c8f replace vm_page_t with struct vm_page *. 2001-05-26 21:27:10 +00:00
enami bb08989ba7 Since union_getpages may be called with PGO_LOCKED,
- We need to skip PGO_DONTCARE page also.
- ``npages'' returned by VOP_GETPAGES for lower vp doesn't count
  those pages in this case.  So, just loop ``npages'' times is
  insufficient.  Loop while there is real pages instead.
2001-04-26 05:25:14 +00:00
thorpej 13e5178e3d Don't hold vp->v_interlock when calling vcount(); vcount() calls
vgone(), which may sleep.
2001-04-17 18:49:26 +00:00
kleink 79283614b3 In procfs_readdir(), give /proc/# directories DT_DIR (rather than DT_REG). 2001-04-14 13:25:46 +00:00
jdolecek b6d1d4db02 Change the first arg to fileops fo_stat routine to struct file *, adjust
callers and appropriate routines to cope. This makes fo_stat more
consistent with rest of fileops routines and also makes the fo_stat
match FreeBSD as an added bonus.
Discussed with Luke Mewburn on tech-kern@.
2001-04-09 10:22:00 +00:00
jdolecek 3fc6fc58e6 Call file descriptor stat function via (*fp->f_ops->fo_stat) instead
of a switch statement and explicit call.
Sprinkle some FILE_USE()/FILE_UNUSE() as appropriate.
2001-04-09 09:39:09 +00:00
jdolecek bb8ceadfcc Adapt to struct fileops, soo_stat() changes.
Pointed out by Bernd Ernesti in private mail.
2001-04-07 17:37:09 +00:00
pk 3c425b682f Cast `field-width' arguments to type `int'. 2001-04-02 07:16:05 +00:00
fvdl 49b162566a Bump va_blocksize for the map files some more, so that programs with
quite a few mappings have a chance of being handled correctly if
st_blksize is looked at.
2001-03-30 20:25:11 +00:00
fvdl 2e64bebd3b For -o linux mounts, add some code to emulate /proc/#/maps.
Needs NAMECACHE_ENTER_REVERSE to include filenames.
2001-03-29 22:41:52 +00:00
chs dd82ad8e2c eliminate the VM_PAGER_* error codes in favor of the traditional E* codes.
the mapping is:

VM_PAGER_OK		        0
VM_PAGER_BAD		        <unused>
VM_PAGER_FAIL		        <unused>
VM_PAGER_PEND		        0 (see below)
VM_PAGER_ERROR		        EIO
VM_PAGER_AGAIN		        EAGAIN
VM_PAGER_UNLOCK		        EBUSY
VM_PAGER_REFAULT	        ERESTART

for async i/o requests, it used to be possible for the request to
be convert to sync, and the pager would return VM_PAGER_OK or VM_PAGER_PEND
to indicate whether the caller should perform post-i/o cleanup.
this is no longer allowed; pagers must now return 0 to indicate that
the async i/o was successfully started, and the caller never needs to
worry about doing the post-i/o cleanup.
2001-03-10 22:46:45 +00:00
jmc 1d6219e000 XXX: Temporary work around to fdesc truncating files when it shouldn't. Treat
setattr calls on underlying vnodes the same as sockets and just return 0.

This whole thing needs to be gutted and replaced with either fall throughs
to specfs (the attr forwarding is just bizarre and leads to weird crap like
the above truncation problems), or better yet a real cloning device node.
2001-03-06 01:23:42 +00:00
chs 667e1805e6 in genfs_getpages(), don't try to optimize zeroing past EOF.
fixes PR 12297.
2001-02-28 02:59:19 +00:00
lukem 4f9c98118a convert to ansi knf 2001-02-27 19:52:21 +00:00
chs f87a22a66b distinguish between a file's in-memory EOF (which marks the offset at
which we disallow creation of page cache pages) and its on-disk EOF
(which marks the offset at which there is not (yet) data on disk that
we need to read when creating pages).  for requests with PGO_PASTEOF,
the in-memory EOF maybe be much larger than the on-disk EOF.
2001-02-27 02:57:02 +00:00
jdolecek 522f569810 make some more constant arrays 'const' 2001-02-21 21:39:52 +00:00
chs 1a5818b05e fix a couple more bugs:
- in genfs_getpages(), unbusy any pages that we don't free in the error path.
 - in genfs_putpages(), if we get a bmap error, record that in the master buf.
2001-02-18 15:03:42 +00:00
fvdl f12c24a45c Oops, removal unintenionally commited debug code. 2001-02-12 19:12:10 +00:00
fvdl dd32618956 Format arg nit. 2001-02-12 17:41:49 +00:00