Commit Graph

530 Commits

Author SHA1 Message Date
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
fvdl 02e4c3348c Check the length of a passed in filehandle to the mount call before
doing a copyin. From Ken Ashcraft @ Stanford via Constantine Sapuntzakis.
2001-07-30 22:23:42 +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
gmcgarry 284f72b8c2 Introduce NFS_DEFAULT_NIOTHREADS to define the default number
of nfs_niothreads instead of hard-coding 4.

This change has the advantage that the default can be specified
at compile time.  If the root filesystem is mounted over NFS
we don't have an opportunity to use the syscall to limit the
number of threads.  Useful on small-memory machines.
2001-07-01 02:13:35 +00:00
thorpej 9cb2396749 Make sure to add NFS vnodes to the syncerd worklist. 2001-06-27 17:33:43 +00:00
wiz 0a600be867 receive, not recieve 2001-06-12 15:17:10 +00:00
lukem 7edbb27e74 delint lvalue cast abuse 2001-06-07 01:04:40 +00:00
kim 549a254824 It is misleading that the kernel outputs "DHCP server:" followed by
the value of "next-server" from the DHCP (or BOOTP) reply.  This is
not the DHCP server's IP address (except by chance), so instead of
"server" make it print "next-server".
2001-06-02 01:52:10 +00:00
mrg c13e3a6693 use _KERNEL_OPT 2001-05-30 11:40:35 +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
fvdl faa28e2580 Lock vp in nfs_link while we're busy with it (doing VOP_FSYNC, etc). 2001-05-14 18:51:33 +00:00
fvdl 0cc3c4a023 Suppress another case of a potentially noisy error message which
isn't fatal.
2001-05-09 20:02:32 +00:00
fvdl bf714cf896 Drop vnode lock before removing the sillyrename file, to avoid a
lock-o-death.
2001-05-03 15:53:04 +00:00
bjh21 1ca2839e35 When NFS_V2_ONLY is defined, refuse to mount NFSv3 and NQNFS filesystems,
rather than pretending they're NFSv2 and hoping for the best.  Fix based on
that supplied by Christian Groessler.
2001-04-28 16:11:47 +00:00
bjh21 4442920f51 In nfs_loadattrcache(), if checkalias() gives us a new vnode, lock it. This
prevents us losing the locked state of the old vnode.

fvdl thinks the old vnode is certain to be locked at this point.  I've put in
a KASSERT to be on the safe side.

This seems to fix PR kern/12661.
2001-04-21 21:35:53 +00:00
fvdl 9dc4bbb990 Don't forget to unlock the vnode returned by cache_lookup if the
subsequent access check fails. Don't overwrite the error code
returned by cache_lookup. Remove a piece of redundant code.

Should fix kern/12680.
2001-04-20 11:22:02 +00:00
fvdl a4c70394dc On VOP_GETATTR failure in nfs_nget, call vgone() to get rid
of the vnode that was just created. Suggested by Enami.
2001-04-20 11:19:16 +00:00
fvdl e5a7af16e9 Unlock the hash lock before returning an error in nfs_nget.
From IWAMOTO Toshihiro.
2001-04-20 07:58:04 +00:00
thorpej 5b35dc8136 When unmounting a file system, acquire the syncer_lock before
vfs_busy'ing just before the dounmount() call.  This is to avoid
sleeping with the mountlist_slock held -- but we must acquire
syncer_lock before vfs_busy because the syncer itself uses
syncer_lock -> vfs_busy locking order.
2001-04-16 22:41:09 +00:00
chs 88c05e77fe reads at or after EOF should "succeed". 2001-04-16 14:37:43 +00:00
chs e7a221b78f remove a temporary hack now that it's fixed for real. fixes PR 11731. 2001-04-03 15:08:38 +00:00
chs d8ed86a474 handle partially full directory buffers by only using (b_bcount - b_resid)
bytes of data from the buffer.
2001-04-03 15:07:23 +00:00
fvdl 8ec4ee98dd Set default NFS read and write sizes back to 8k, because a lot of
(old) hardware can't handle more.
2001-04-02 11:47:23 +00:00
matt 0abec5d217 Allow the default NFS_RSIZE and NFS_WSIZE to be overriden. 2001-03-25 02:22:30 +00:00
fvdl ad5dcb280f Same change as in the UFS code: unlock vnode before setting v_op
to spec_vnode_ops. From Bill Studenmund.
2001-03-23 21:10:48 +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