Commit Graph

573 Commits

Author SHA1 Message Date
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
chs 060e70db41 min() -> MIN(), max() -> MAX().
fixes more problems with file offsets > 4GB.
2001-02-27 04:37:44 +00:00
jdolecek 522f569810 make some more constant arrays 'const' 2001-02-21 21:39:52 +00:00
chs f6370c7a84 fix a couple more bugs:
- in nfs_getpages(), unbusy any pages that we don't free in the error path.
 - in nfs_putpages(), only call biowait() if we actually started any i/os.
2001-02-18 15:52:32 +00:00
fvdl 4c9b670931 Fix some possible locking errors in nfs_namei (XXX this function should die) 2001-02-14 15:36:45 +00:00
fvdl a008ea27c9 Instead of storing the filehandle in the mount structure, store the
vnode pointer. This avoids a locking problem with nfs_nget, and
can be done because we always have a reference on the root vnode
of the filesystem.
2001-02-12 20:02:30 +00:00
enami 6b949f72fb Unlock the rename target vnode after sillyrename'ing it. 2001-02-11 01:09:04 +00:00
tsutsui ec8b1c000e Fix nested extern declaration of prtactive. 2001-02-07 12:40:43 +00:00
fvdl c18aae5b9f In nfs_inactive there's no need anymore for an extra refcount around
nfs_vinvalbuf, since it has a real lock on the vnode now, so getnewvnode
will not hijack it.
2001-02-06 16:25:48 +00:00
fvdl 9f39c3a967 Get locking in rmdir right. Don't unlock a vnode when passing its
associated nfsnode to nfs_lookitup, it is not needed, and fixes
nfs_remove.
2001-02-06 15:26:25 +00:00
fvdl d4e6a2c4e1 Do actual vnode locking for NFS. 2001-02-06 11:40:02 +00:00
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
jdolecek d9466585b7 make filesystem vnodeop, specop, fifoop and vnodeopv_* arrays const 2001-01-22 12:17:35 +00:00
enami 07c60191e7 Use tsleep instead of dalay; since we're mounting root, we can sleep
and no reason to use delay.
2001-01-19 14:26:01 +00:00
jdolecek 34c8ae80da constify 2001-01-18 20:28:15 +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
jdolecek 7ec49a1f35 update commented out code to recent changes of signal structures 2000-12-27 22:01:43 +00:00
bjh21 47d4a4d009 Extra diagnostic assertion: subtle pmap bugs can ultimately lead to trying
to use NULL credentials for NFS ops, so spot them before we dereference them.
2000-12-27 16:35:37 +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 395f8c2177 initialize read creds in nfs_open() too. 2000-12-12 17:13:17 +00:00
fvdl 405b695086 Make sobind() take a struct proc *. It already took curproc and
passed it down to the appropriate usrreq function, and this
allows usage for contexts that need to be explicitly different
from curproc (like in the NFS code when binding to a reserved port).
2000-12-10 23:16:28 +00:00
chs 3a5e4f901b in *_sync(), don't skip vnodes which have (potentially dirty) pages. 2000-12-10 19:36:31 +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
drochner 8f6e088214 add a kernel configuration option to set the string passed in bp_file
in diskless BOOTP/DHCP configuration - good for booting different
userland versions depending on the kernel version
2000-12-05 17:59:43 +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 d324e2eb55 in nfs_open(), initialize the write creds if we're opening for writing.
otherwise we would never set them if we only modify the file via mmap().
2000-11-30 07:24:12 +00:00
chs aeda8d3b77 Initial integration of the Unified Buffer Cache project. 2000-11-27 08:39:39 +00:00
chs 8362134916 put more ISO bits under ifdef ISO. 2000-11-24 23:30:02 +00:00
ad 642267bcc7 Update for hashinit() change. 2000-11-08 14:28:12 +00:00
chs 51c256aa5a in nfs_flush(), only play games with B_NOCACHE for VREG vnodes.
if we do this for VBLK vnodes which are in use by softdep mounts,
brelse() will mark the buffer B_INVAL as well, which makes the
softdep code very unhappy.
2000-11-08 05:20:32 +00:00
fvdl dcf7889500 Do not accept vnode type changes to an active node. This may wreak
havoc if the server erroneously uses the same filehandle for
different files. This changes back revision 1.28; the PR that
that revision fixed doesn't apply anymore, it has been verified
not to be a problem with this change.
2000-10-24 12:02:04 +00:00
matt 04f534474c Change a DIAGNOSTIC panic slightly to print the locked vnodes and to just
print a diagnostic but not panic.
2000-10-24 07:08:48 +00:00
chs be0d1c56f1 fix nfs iod management so we don't lose i/os when iods die. 2000-10-23 07:18:27 +00:00
chs 65ab1f3650 include opt_inet.h, needed by previous check-in. 2000-10-03 17:18:15 +00:00
itojun b834fb62c3 check in_ifaddr only if INET is compiled 2000-10-02 04:28:13 +00:00
itojun 23bf957144 perform reverse ARP only if INET is compiled into the kernel 2000-10-02 04:27:57 +00:00
fvdl 06b8ac615d Avoid unused variables for V2_ONLY case. 2000-09-27 18:36:03 +00:00
enami 29d3e43df9 Don't bother to clear commit information for the vnode of type VNON.
It is not necessary since it is a vnode being initialized and it shouldn't
be done since filesystem private data may not be assigned yet.
2000-09-24 06:59:21 +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 874d41c959 "ENOBUF" on socket writes isn't really fatal; we may just be too fast
for the driver. Don't log the error, just try again. Could try to
be smart and do a backoff, but it's probably not worth the trouble.
2000-09-19 22:21:21 +00:00
fvdl 8d38a9fc8e Adapt some defaults/max values to be more realistic. 2000-09-19 22:19:12 +00:00
fvdl de98f0812b Add fields to deal with commit ranges. 2000-09-19 22:18:40 +00:00
fvdl 861339828d Update for VOP_FSYNC parameter change. Simplify nfs_flush. 2000-09-19 22:18:03 +00:00
fvdl ddf47f8f0d Update for VOP_FSYNC parameter change. 2000-09-19 22:15:41 +00:00
fvdl 45dc18d175 Add prototypes for commitrange functions. 2000-09-19 22:14:59 +00:00
fvdl 09f52ac6fc Don't do write gathering for v3; it makes no sense. Unless the client
is broken and does sync writes all the time, but that's the client's
fault.
2000-09-19 22:14:42 +00:00
fvdl 9ed021b771 Add functions to deal with keeping track of commit ranges. 2000-09-19 22:13:55 +00:00
fvdl 45460eabe0 Initialize the lock needed to serialize commits for one NFS node. 2000-09-19 22:13:01 +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
fvdl 7f432c74ab Bump some defaults and maximums to better values. 2000-09-19 22:05:55 +00:00
fvdl 8fd422dede Adapt for VOP_FSYNC parameter change. 2000-09-19 22:05:29 +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
fvdl 3ec253a800 Fix bug in access cache that might result in permission being denied
needlessly. From Matthias Drochner.
2000-09-19 00:00:18 +00:00
nathanw 7023c5166c Fix typo in comment. 2000-08-23 23:17:14 +00:00
enami d7236f8d44 Update nfs mount flags correctly. Fixes a bug introduced in rev. 1.65. 2000-08-23 09:59:22 +00:00
thorpej 7cc27a88c0 Convert namei pathname buffer allocation to use the pool allocator. 2000-08-03 20:41:05 +00:00