Commit Graph

72 Commits

Author SHA1 Message Date
matt 19e6c76b2d Rename rb.h to rbtree.h, as it is more appropriate (c.f. ptree.h). Also
helps find code that hasn't been updated to use the new rbtree API.
2010-09-25 01:42:38 +00:00
dsl 02cdf4d2c8 Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
2009-03-14 14:45:51 +00:00
christos ed795a66a7 protect sillyrename with _KERNEL 2009-01-02 21:06:11 +00:00
ad 27bc6a2391 - Don't vput() a vnode that we do not hold locked.
- Eliminate one of the few remaining uses of LK_CANRECURSE.
2009-01-02 12:57:29 +00:00
matt a42078ef92 Change NFS to use a RB-tree for its FH->nfsnode lookups. 2008-10-22 11:36:06 +00:00
ad 1997a1e1f4 Remove VOP_LEASE. Discussed on tech-kern. 2008-01-25 14:32:11 +00:00
yamt c379ad6567 - instead of scanning an array of iods, maintain a list of idle iods.
- make nfs_getset_niothreads MP friendly.
2007-08-10 15:12:56 +00:00
yamt 8e473ee7cb push kernel_lock a little. 2007-08-08 12:27:56 +00:00
yamt 97c7bbe6b8 - fix decreasing of vfs.nfs.iothreads after the recent partial merge
of vmlocking.
- don't make nfsiod exit with requests left.
- make NFSSVC_BIOD a dummy so that nfsiod can be simplified.
2007-07-20 15:36:41 +00:00
yamt f14398066d include condvar.h. pointed by Kurt Schreiner. 2007-04-29 14:58:21 +00:00
yamt aca6764004 use mutex and condver. 2007-04-29 10:30:18 +00:00
yamt 6d6b5c51d6 use mutex and rwlock rather than lockmgr. 2007-02-15 16:01:51 +00:00
yamt a23a6ee6c6 remove several nqnfs definitions. 2006-12-28 00:39:03 +00:00
yamt ccfd2c0df0 remove nqnfs. 2006-12-27 12:10:09 +00:00
christos 3b347a3429 another variable should have been _KERNEL only. 2006-10-17 14:55:13 +00:00
christos 0a3d351aae don't expose kernel variables to userland. 2006-10-17 14:53:54 +00:00
elad fc9422c9d9 integrate kauth. 2006-05-14 21:31:52 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
yamt 72d6e88acf handle a really empty directory, which doesn't have even the dot entry. 2005-01-26 10:30:58 +00:00
yamt e5bd47dc3c invalidate cache if filesize is changed besides our activity
because it means that we're out of sync with the server.
2005-01-09 01:32:32 +00:00
yamt 68c071389c nfs_lookup: check n_nctime for positive entries as well to improve
cache consistency.
2005-01-08 03:12:30 +00:00
yamt ee344f939f redirect some VOPs which shouldn't be used for nfs
to genfs_badop (ie. panic).
2004-12-14 09:15:23 +00:00
yamt a9fa9f0745 since daddr_t is 64-bit these days, simply use nfs directory cookies
as buffer cache indexes.  regress/sys/fs/getdents is now supposed to work.
fix PR/27112.
2004-10-26 04:34:46 +00:00
yamt e11d5e7c46 fix access-after-free bugs in dircache code by refcounting nfsdircache.
PR/26864.
2004-09-15 09:50:56 +00:00
yamt 4fd5a025bf nfs_request: a workaround for servers doing "maproot".
for i/o requests which are expected not to fail due to permission
to mimic unix file open semantics (READ, WRITE, COMMIT),
try two credentials.  namely, the file owner's one and open time one.
remember which credential worked in per-file basis and try it first
next time to minimize number of retries.
ideas from Chuck Silvers.  PR/23716 and PR/24987.
2004-08-24 20:09:44 +00:00
yamt ee306471a7 remove an unused instance of VOP_UPDATE. 2004-05-27 12:55:07 +00:00
yamt c819fadc97 shrink sizeof struct nfsnode by putting exclusive members into union. 2004-03-12 16:52:37 +00:00
yamt a4cbf5b042 introduce a macro NFS_INVALIDATE_ATTRCACHE and use it
instead of "n_attrstamp = 0".
2004-03-12 16:52:14 +00:00
yamt c2025ab0ea change n_mtime from time_t to timespec in order to improve
cache consistency.
(1 second granularity is too loose these days.)
2003-09-26 11:51:53 +00:00
yamt 1e8ae1ddf3 change nctime to timespec from time_t.
there can be too many activities in a second.
2003-09-17 09:10:00 +00:00
agc aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
yamt 33164bffc6 vrecycle removed nfs vnodes.
not perfect, but enough for most cases.
2003-07-30 12:25:39 +00:00
yamt de31ef25cd simple lock for nfs iod. 2003-05-07 16:18:53 +00:00
yamt 2cca2b5641 update a comment to follow the previous change. 2003-04-09 14:24:32 +00:00
yamt 9b96b4ab78 make per-iod datas together. 2003-04-09 14:22:33 +00:00
matt 9bd0cc2bb9 Make sure these all agree on the same definitons of various variables. 2002-12-01 23:02:10 +00:00
jdolecek e0cc03a09b merge kqueue branch into -current
kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
2002-10-23 09:10:23 +00:00
yamt 005c29fafb fix a page locking deadlock problem for nfs.
add a flag that specify if the file can be truncated safely or not
to nfsm_loadattr and friends.  when it isn't safe, just mark the nfsnode
as "should be truncated later".

ok'ed by Frank van der Linden and Chuck Silvers.
close kern/18036.
2002-10-21 12:52:32 +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 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
fvdl d4e6a2c4e1 Do actual vnode locking for NFS. 2001-02-06 11:40:02 +00:00
chs aeda8d3b77 Initial integration of the Unified Buffer Cache project. 2000-11-27 08:39:39 +00:00
fvdl de98f0812b Add fields to deal with commit ranges. 2000-09-19 22:18:40 +00:00
simonb 19f0e3f6e8 Delete redundant decl of nfs_vget() - it's in <nfs/nfsmount.h>. 2000-03-30 02:46:36 +00:00
fvdl 5a7300902c Insert an extra VOP_ACCESS check in nfs_lookup, to avoid cached access
mishaps for lookup and getattr. Closes PR 8884.

While at it, cache access RPCs.
1999-11-29 23:34:00 +00:00
matthias 574106c52b create miscfs/genfs/genfs_vnops.c:genfs_enoioctl and make all the other
filesystems use it instead of a private version.
1998-08-10 08:11:10 +00:00
thorpej 961f0708b1 - Rename nqnfs_vop_lease_check() to genfs_lease_check(). If NFSSERVER is
not in the kernel, genfs_lease_check() is simply a no-op.  This allows
  LKM'd file systems to be exported (previously did not work properly
  due to a compile-time decision based on -DNFSSERVER).
- defopt NFSSERVER
1998-06-25 22:15:28 +00:00
fvdl e5bc90f40c Merge with Lite2 + local changes 1998-03-01 02:20:01 +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
christos 280d4b5839 Fix the location of the NFS_SMALLFH 1997-10-16 23:59:34 +00:00