Commit Graph

61 Commits

Author SHA1 Message Date
chs 5706160195 fix several bugs:
- in the cases where we skip over the i/o loop, increment npages by ridx
   so that when the cleanup code starts processing the pgs array at index 0
   it'll actually process all of the pages.
 - process the PG_RELEASED flag when unbusying pages.
 - add some missing MP locking.
 - use MIN() and MAX() instead of min() and max() since the latter are
   functions which take arguments of type "int" but we call them with
   values of type "off_t", so the values could be truncated.
2001-02-05 12:27:18 +00:00
thorpej e4dc9e322e Make sure bp->b_proc is initialized. Should fix a deref-garbage-pointer
problem reported by msaitoh@netbsd.org.  NOTE: These are marked XXXUBC
since the code that allocates the bufs is new with UBC, but it may be
the case that bp->b_proc needs to be intialized to curproc (it's used
in a call to nfs_sigintr()).
2001-01-30 03:47:11 +00:00
enami 744c012068 Use uvm_aio_biodone instead of uvm_aio_aiodone for top-level buf
so that uvmexp.paging is updated if this i/o was initiated by
the pagedaemon.
2001-01-07 05:54:41 +00:00
chs 4e7404469d fix several bugs:
- fix math when skipping writing pages that just need a commit.
 - clear the needcommit stuff and PG_RDONLY flags on pages returned for
   overwrite requests as well as for normal write faults.
 - bail out of nfs_write() if we get an error.
 - remove a bogus attempt to clean up after failed uiomove()s.
 - bring over a workaround for a lock-ordering problem from the genfs code.
 - add some missing MP locking.
2000-12-27 05:15:43 +00:00
jdolecek c2cfcae955 <sys/trace.h> is not needed here 2000-12-13 18:15:56 +00:00
chs f5878a3362 only zero the part of the page after EOF if we're actually
initializing the page.
2000-12-09 22:38:23 +00:00
fvdl a0aebb0c36 Initialize 'error' to 0, so that nfs_putpages doesn't return garbage
when pages already have been committed and nothing needs to be done.
2000-12-04 12:12:20 +00:00
chs aeda8d3b77 Initial integration of the Unified Buffer Cache project. 2000-11-27 08:39:39 +00:00
bjh21 1f4240a461 Extend NFS_V2_ONLY to remove NQNFS lease support as well. Saves another 10k. 2000-09-19 23:26:25 +00:00
fvdl 899fb781e0 Move handling of B_NEEDCOMMIT buffers to nfs_doio, so that bawrite() calls
for them are actually done asynchronously. Idea taken from FreeBSD.

Do away with nfs_writebp completely, it's not needed anymore.

Keep an eye on the range of a file that needs to be committed, and
do it in heaps.
2000-09-19 22:11:47 +00:00
bjh21 33daa8de6b New kernel option, NFS_V2_ONLY, which aims to reduce the NFS client to just
that required to support NFSv2 mounts.  Not finished yet, but already
provides some 44k of saving in code size on arm26.  More savings, and some
documentation, are still to come.
2000-09-19 17:04:50 +00:00
mrg 6eeafef261 remove include of <vm/vm.h> 2000-06-27 17:52:28 +00:00
pk 72cadd83e4 Fix printf() format. 2000-05-18 08:34:26 +00:00
augustss 8529438fe6 Remove register declarations. 2000-03-30 12:51:13 +00:00
fvdl d901f6eae0 Be more careful to block bio interrupts for some data structures. There
were at least a few missed cases where vp->v_{clean,dirty}blkhd were
unprotected since the softdep/trickle sync merge.
1999-11-23 23:52:40 +00:00
fvdl 0b1963121a Add Kirk McKusick's soft updates code to the trunk. Not enabled by
default, as the copyright on the main file (ffs_softdep.c) is such
that is has been put into gnusrc. options SOFTDEP will pull this
in. This code also contains the trickle syncer.

Bump version number to 1.4O
1999-11-15 18:49:07 +00:00
mrg d2397ac5f7 completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
1999-03-24 05:50:49 +00:00
perry 4522c799a1 bzero->memset, bcopy->memcpy, bcmp->memcmp 1998-08-09 20:51:08 +00:00
fvdl 865838bfd7 Fix possible overflow problem in read size computation. 1998-06-21 22:18:16 +00:00
mrg d90485202c - add defopt's for UVM, UVMHIST and PMAP_NEW.
- remove unnecessary UVMHIST_DECL's.
1998-02-10 14:08:44 +00:00
mrg 1a8c7604f4 initial import of the new virtual memory system, UVM, into -current.
UVM was written by chuck cranor <chuck@maria.wustl.edu>, with some
minor portions derived from the old Mach code.  i provided some help
getting swap and paging working, and other bug fixes/ideas.  chuck
silvers <chuq@chuq.com> also provided some other fixes.

this is the rest of the MI portion changes.

this will be KNF'd shortly.  :-)
1998-02-05 07:59:28 +00:00
fvdl 26a975b107 Move the EOF check after getting a block out of the if() that determines
whether we get it off the wire. An nfsiod might have been busy with
it, and finished while we were waiting for it in nfs_getcacheblk, so
we need to check for EOF again no matter what.
1997-11-23 13:52:24 +00:00
fvdl aac8e91164 Oops. Fix goof in previous change. 1997-10-23 14:12:14 +00:00
fvdl 6b89492d21 Just return immediately in nfs_bioread if we got an empty buffer because
of EOF on a directory.
1997-10-22 01:45:16 +00:00
thorpej 98bb00f98f Fix alignment problems. From Frank van der Linden <fvdl@NetBSD.ORG>. 1997-10-20 22:08:44 +00:00
fvdl 6cdaaab885 Only do readaheads when reading sequential blocks; check v_lastr to
achieve this. Improves performance for demand paging. From Chris Demetriou.
1997-10-19 20:27:32 +00:00
fvdl 1cf3a3db94 * Implement optional 32 <-> 64 bit directory cookie translation. This uses
the directory cache as translation table. See nfs_subs.c for comments.
  Makes the code a bit more complex to look at than I would have liked,
  but doesn't affect the speed of the default behavior.
* Optimize caching behavior a bit when buffers are invalidated.
* Save some RPCs in readdir operations by not bothering if there is
  a small amount left to do to fill the buffer. It'll be done in the
  next RPC with a larger chunk anyway. Wastes a bit of buffer space
  but is faster.
* Make n_vattr an allocated vattr struct. This avoids nfsnode bloat,
  and is friendlier to the malloc routines.
1997-10-19 01:46:15 +00:00
fvdl 7f7d814e67 * New directory entry caching system. Provides full caching of any
directory cookie that may be thrown back at us from userspace, up
  to a size limit. Fixes double entry problem.
* Split flags for internal and external use in the NFS mount structure.
* Fix some buffer structure fields that weren're being used correctly.
* Fix missing directory cache inval call in nfs_open.
* Limit on NFS_DIRBLKSIZ no longer needed, bumped to the more reasonable
  value of 8k.
* Various other things that I forget, all related to the dir caching
  somehow, though.
1997-10-10 01:53:17 +00:00
fvdl 43e1b9384f * Deal with servers that don't give complete FSINFO (like NT)
From Olaf Seibert <rhialto@polder.ubc.kun.nl> (PR 3687)
* Make an attempt to check the maximum filesize before attempting
  a write to the server, as write RPCs will typically happen
  asynchronously, and the process will not see the error.
  Fixes problems with unexpectly truncated files at 4G
* Pass up errors in nfs_writerpc correctly
1997-07-17 23:54:27 +00:00
drochner 8c0a9bab00 Don't cast 64bit (off_t) file sizes to vm_offset_t (32bit on many
architectures), truncate them intelligently instead.
The truncation is done centralized in vnode_pager.c.
This prevents from wrap-over effects when parts of large (>2^32 byte) files
are mmapped.
Don't allow to mmap above the numerical range of vm_offset_t.
This is considered a temporary solution until the vm system handles the
object sizes/offsets more cleanly.
1997-07-04 20:22:09 +00:00
fvdl b9f22ef8f3 Only wake up one nfsiod when there is an async write to do. (from FreeBSD). 1997-04-20 16:24:44 +00:00
thorpej aa25de69d1 NFS performance improvement from Doug Rabson/FreeBSD:
Improve the queuing algorithms used by NFS' asynchronous i/o.  The
existing mechanism uses a global queue for some buffers and the
vp->b_dirtyblkhd queue for others.  This turns sequential writes into
randomly ordered writes to the server, affecting both read and write
performance.  The existing mechanism also copes badly with hung
servers, tending to block accesses to other servers when all the iods
are waiting for a hung server.

The new mechanism uses a queue for each mount point.  All asynchronous
i/o goes through this queue which preserves the ordering of requests.
A simple mechanism ensures that the iods are shared out fairly between
active mount points.

Reviewed/integrated/approved by Frank van der Linden <fvdl@netbsd.org>
1996-12-02 22:55:39 +00:00
christos bcf4552fb1 revert kprintf changes 1996-10-13 01:39:03 +00:00
christos 117a51c5a5 printf -> kprintf, sprintf -> ksprintf 1996-10-10 23:31:17 +00:00
fvdl 1e8262b3d6 Don't mistake a non-async block that needs to be commited for an
interrupted write.
1996-07-02 16:03:47 +00:00
fvdl 2847784948 * Make mounts with symlinks work (needed for direct mounts with amd). PR #1917
* Never change the NQNFS flag and/or version when just doing an update mount.
  Fixes a problem that made diskless booting impossible under some
  circumstances.
1996-05-23 22:47:27 +00:00
fvdl 52d04f3b3f Make sure to clear B_NEEDCOMMIT in the right spot. Fix 'officially blessed'
by Rick Macklem. Fixes PR kern/2128.
1996-02-29 20:26:16 +00:00
fvdl 5ac7df1caf Bring in a merge of Rick Macklem's NFSv3 code from Lite2 1996-02-18 11:53:36 +00:00
christos e4c93ec893 nfs prototype changes 1996-02-09 21:48:19 +00:00
jtc 299e1fe9df Rename struct timespec fields to conform to POSIX.1b 1996-02-01 00:31:05 +00:00
cgd e9d17d38b5 avoid unnecessary aging of buffers. This used to make sense, when buffer
caches were much smaller, but makes little sense now, and will become more
useless as RAM (and buffer cache) sizes grow.  Suggested by Bob Baron.
1995-07-24 21:19:27 +00:00
gwr 4b284ae4ba Make call to nfs_writerpc() consistent with others. 1995-03-18 05:49:51 +00:00
mycroft 775d061b43 Add two missing brelse() calls. From Rick Macklem. 1995-01-12 12:08:23 +00:00
mycroft 69eef46dd1 Make sure readdir requests are only truncated on block boundaries. 1995-01-10 06:50:03 +00:00
mycroft 24f8e9187d Fix a problem with write-behind causing processes to be killed occasionally.
From Rick Macklem.
1994-07-20 04:16:01 +00:00
cgd 65855280c7 minor cache consistency fix 1994-07-12 21:03:14 +00:00
cgd fccfa11af5 New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD' 1994-06-29 06:39:25 +00:00
pk bccc2c3c1b straighten out diskless swap code somewhat. 1994-06-22 14:01:45 +00:00
mycroft 0d8affb278 Turn P_NOSWAP and P_PHYSIO into a hold count, as suggested by a comment. 1994-06-15 19:59:21 +00:00
mycroft cde1d47595 Update to 4.4-Lite fs code, with local changes. 1994-06-08 11:33:09 +00:00