Commit Graph

556 Commits

Author SHA1 Message Date
drochner 92ade669c9 increase IP TTL for BOOTP/DHCP request packets to avoid dumb
routers dropping the packet
(seems to be a problem with Cisco and its "helper-address" feature;
a Cabletron SSR I tested with didn't have this problem)
2002-06-10 17:45:54 +00:00
tls 92f8323be6 Fix client-side lockmgr: locking against myself panic immediately upon an
attempt to NFS-mount a filesystem with the -l (use ReaddirPlus RPC) option.

Fix from Bill Sommerfeld.
2002-05-19 20:51:04 +00:00
matt caf4b56c6f Eliminate commons 2002-05-12 23:04:35 +00:00
simonb 8cb3bbd37c In bootpcheck(), make sure we m_pullup() all the of bootp header that we
actually examine.
While here, toss out home-grown ofs() macro and use offsetof().
2002-05-12 12:52:58 +00:00
enami 59a79c7928 Remove wrong assertion in previous commit. 2002-05-06 03:20:54 +00:00
enami cfa571e2e2 The per nfsnode n_commitlock is a sleep lock, but we can't sleep if
PGO_LOCKED getpages request.  So, just make the lock fail and tell
the caller that there is no pages available if we can't acquire it.
The caller will call us again soon without PGO_LOCKED.  Reviewed by chuq.
2002-05-06 00:07:51 +00:00
thorpej 37dc008ca3 Cleanup how file system configuration information is declared, grouping
related information together, with the file system code itself.

This is just low-hanging fruit -- more to come.
2002-04-16 23:14:05 +00:00
chs a5838679d1 only use UBC_FAULTBUSY to access offsets past EOF,
otherwise we can deadlock trying to busy the same page in uiomove().
2002-04-10 03:06:57 +00:00
wrstuden a36c34f662 In the SETATTR code, if the changes to a & m time are exclusively
set via NFSV3SATTRTIME_TOSERVER and not NFSV3SATTRTIME_TOCLIENT,
add VA_UTIMES_NULL to the va_vflags. This reflects our policy
where we're much more liberal about who can set a & m times to 'now'
than we are about who can set them to a specific time.

Should close PR 15597 from Martin Husemann. Patch is based on the
one Matthias Drochner gave in the PR.
2002-04-03 00:20:15 +00:00
chs f80ed5892c remove PGO_WEAK, it isn't needed anymore. 2002-03-25 02:08:09 +00:00
chs 20a94bdf2d only do v3 stuff for v3 filesystems. 2002-03-23 05:00:57 +00:00
thorpej df292ba439 Add a NetBSD Vendor Class Identifier option as proposed on tech-net in
message <20020216172527.C23901@dr-evil.shagadelic.org>.
2002-03-20 23:07:37 +00:00
christos 14eaffb49d use the exithook mechanism to remove the exiting process from the list
of processes to be signalled in a soft mount.
2002-03-17 22:22:39 +00:00
chs b4b7853b08 make sure that if NMODIFIED is clear, all pages attached to the vnode are
clean and without writable mappings.  if we try to flush dirty pages past
EOF to the server when NMODIFIED is clear, we'll update the attrcache before
doing the write, which will try to free the pages past EOF and deadlock.
to deal with this, we write-protect pages before we send them to the server,
and restrict ourselves to creating read-only mappings if NMODIFIED isn't set.
score another one for enami.
2002-03-16 23:05:25 +00:00
jdolecek 86835ed7d1 Cosmetic change for nfs_enterdircache() - since 'blkno' is last arg,
define it's type last, too.
Noted in kern/14742 by John Franklin.
2002-03-11 22:56:47 +00:00
jdolecek 934735396a nfs_enterdircache() had last two parameter types swapped
Noted in kern/14742 by John Franklin.
2002-03-11 22:55:05 +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
fvdl a16656fe06 Invalidate the access cache when loading a new set of attributes into
the atribute cache. Fixes access cache problem seen by
Nathan Funk of the UofS, relayed by Greg Oster.
2002-02-28 21:38:08 +00:00
lukem 1119bfe6ea nfs_connect(): if NFSMNT_RESVPORT is set, set IP_PORTRANGE_LOW on the socket
rather than using home-grown code to find a free reserved socket.
this also results in nfs pcb's having the INP_ANONPORT and INP_LOWPORT flags
set, which is useful for netstat(1) to know.
2002-02-27 03:46:36 +00:00
chs 8a910799bb use curproc instead of b_proc for NFS. that's what we want for sync commits
and it doesn't cause any problems for async commits.
2002-01-31 05:56:57 +00:00
chs 2a8b52def1 re-enable NFSv3 commit RPCs by abandoning my new approach in favor of
frank's scheme, with one new twist:  don't wait until we've totally run
out of free pages before committing, but instead notice when we've built
up a largish range of uncommitted pages and commit only the older half of
the range, which is likely to already be on disk on the server.
2002-01-26 02:52:19 +00:00
minoura 1dded0f21b Back out the previous.
It was my misreading from the lack of mbuf usage...
Sorry for the mess.
2002-01-22 09:37:59 +00:00
fvdl e4701eef88 VOP_UNLOCK + vgone --> vput, since the vnode will already have
a reference.
2002-01-21 13:48:51 +00:00
minoura a2791dabb9 Correctly write back the updated value of the local variable to the
struct nfssvc_sock.
Affected only when a recordmark of RPC over TCP is fragmented to
multiple mbufs.  I do not know whether this code has ever been executed :)
2002-01-21 13:21:51 +00:00
fvdl 9e4014046f Unlock vnode before calling vgone() in case of getattr failure during
nfs_nget. Fixes problem reported by Chuck Cranor.
2002-01-18 18:59:24 +00:00
chs b4224d4d38 fix locking in nfs_getpages(). 2001-12-31 07:16:47 +00:00
fvdl e3e7b4bd55 Set np->n_size before calling nfs_vinvalbuf, to avoid recursion
and confusion about the actual filesize. From Matt Dillon's
similar change in FreeBSD.

XXX n_size is really redundant in -current and must die. This commit
XXX is more of a placeholder for a pullup into the 1.5 branch.
2001-12-15 00:32:49 +00:00
lukem 290cc55a28 - Implement
uint32_t namei_hash(const char *p, const char **ep)
  which determines the equivalent MI hash32_str() hash for p.
  If *ep != NULL, calculate the hash to the character before ep.
  If *ep == NULL, calculate the has to the first / or NUL found, and
  point *ep to that location.
- Use namei_hash() to calculate cn_hash in lookup() and relookup().
  Hash distribution goes from 35-40% to 55-70%, with similar profiled
  time spent in cache_lookup() and cache_enter() on my P3-600.
- Use namei_hash() to calculate cn_hash in nfs_readdirplusrpc(),
  insetad of homegrown code (that differed from that in lookup() !)
  namei_hash() has better spread and is faster than previous code
  (which used a non-constant multiplication).
2001-12-08 04:09:59 +00:00
lukem 1546835120 Replace nfs_hash() (with its extremely bad hash) with a macro to call
hash32_buf() to obtain a 32 bit hash.  On some tests I ran I obtained
a 30x improvement in hash distribution and a 6x reduction in time spent
in nfs_nget().
2001-12-06 01:26:36 +00:00
lukem 78fd77ad3f don't need nfs_hash prototype here 2001-12-05 23:58:14 +00:00
christos 10b6cdd540 PR/14817: Gregory McGarry: NFS_V2_ONLY doesn't seem to work. 2001-12-04 18:38:08 +00:00
chs 68b5980eb0 call VOP_PUTPAGES() directly instead of indirecting through
the UVM pager op vector.
2001-11-30 07:08:53 +00:00
christos 9caaf10ee6 PR/14776: Emmanuel Dreyfus: cross device hard link causes panic.
Call VOP_ABORTOP on the right vnode damnit!
2001-11-29 22:32:53 +00:00
christos a74164fa6e sprinkle crcvt() 2001-11-29 21:23:13 +00:00
christos b2cfd799a6 use struct uucred in nfsd_svcargs so that we don't break the sys_nfssvc() ABI. 2001-11-29 21:22:50 +00:00
lukem 0ffad69384 add RCSIDs 2001-11-10 10:59:08 +00:00
bjh21 ec2fc79a18 Diagnostic panics should be enabled when DIAGNOSTIC is defined, not undefined. 2001-11-07 20:04:52 +00:00
simonb 2d0469db06 Remove so variables that are only ever set and never referenced. 2001-10-13 23:25:58 +00:00
simonb aaaea89787 Don't initialise the 5th element of some 4 element arrays. 2001-10-13 22:59:16 +00:00
chs 640db3a7d0 revert a change that I accidentally included with ubcperf. 2001-10-08 00:22:13 +00:00
fvdl df8490a27a Always initialize ni_rootdir in nfs_namei. From Andrei Petrov. 2001-09-27 21:44:56 +00:00
chs 65752b4854 remove SAVESTART from the symlink, mknod and create operations.
it was unnecessary, and removing it also fixes a v_usecount leak
that was introduced in the previous revision.
2001-09-23 01:37:03 +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 cd31160db9 fix nfs_bmap() so that it works for both genfs_{get,put}pages() and swap/vnd. 2001-09-20 08:22:04 +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
chs f0af9f581b add getpages/putpages entries for spec vnodes. 2001-08-17 05:54:36 +00:00
itojun 974a4e79a0 don't panic on mknod(2) over NFS. PR 13705. 2001-08-14 05:31:55 +00:00
jdolecek 332bb4894a bound check mount args more thoroughly 2001-08-03 06:00:13 +00:00
jdolecek 50f76258ac Check the passed file handle length _before_, not _after_ copyin() 2001-07-30 22:51:06 +00:00