Commit Graph

211 Commits

Author SHA1 Message Date
fvdl 6913afc057 Give permission to the owner of the file to preserve semantics only
in the relevant cases (read, write). Fixes PR 3017.
1996-12-11 00:01:56 +00:00
mycroft c1de76e30b Allocate real malloc types for NFS, rather than using M_TEMP. 1996-12-10 10:07:22 +00:00
fvdl 2914743038 Comment change in previous made for some bad english.. 1996-12-09 11:31:11 +00:00
fvdl 46795a244d Move '#ifdef NFSSERVER' back to the right spot; NQNFS datastructures need
to be initialized on both the client and the server side. Remove misleading
comment about this being just server stuff.
1996-12-09 10:46:20 +00:00
thorpej f02e8b3cf0 Make NFSSERVER work without NFSCLIENT. This is achieved by splitting
the client and server/shared data initialization into separate functions,
and calling the server/shared initialization directly from main().
Problem noted in PR #1308 (Kenneth Stailey) and PR #1780 (Chris Demetriou).
Fix suggested in PR #1780 by Chris Demetriou, and munged a bit by me,
and OK'd by Frank van der Linden <fvdl@netbsd.org>.
1996-12-03 00:22:43 +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
cgd ce53653783 make the namei struct members ni_dirp and ni_next, and the componentname
struct member cn_nameptr 'const', since they should never be used to
modify the path name.  (Only the pathname buffer, cn_pnbuf, should be
modified.)  Propagate the const poisoning to code that uses the namei
and componentname structs.
1996-10-25 23:13:58 +00:00
fvdl 735944405b Enhancements from Matthias Drochner:
- Try V3 first for diskless booting. Fall back to V2 if V3 fails.
	- optionally (option NFS_BOOT_TCP) try a TCP mount first
	  for diskless booting. Fall back to UDP if it fails.
	- Enable switching between UDP and TCP for remounts.
1996-10-20 13:13:22 +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
mycroft 2bc736661a Implement poll(2). 1996-09-07 12:40:22 +00:00
mycroft c52352c819 Add a set of generic file system operations that most file systems use.
Also, fix some time stamp bogosities.
1996-09-01 23:47:48 +00:00
thorpej 5404d54edb Another %lx -> %x for ntohl() 1996-08-14 03:47:42 +00:00
cgd 2af08e028e print result of ntohl/htonl as a long. 1996-07-10 18:43:23 +00:00
fvdl 90b2034c7c Use the right time for v3 setattr operation. 1996-07-07 12:25:47 +00:00
fvdl 88eff7ea92 Start XIDs at a value based on the current time, not 0. This avoids nasty
XID confusions with servers that cache them over a long period and
with clients that reboot quickly.

Problems: because of the sanity check that is done by comparing the system
time with filesystem time, XIDs will start at 0 until root is mounted,
which means it isn't completely safe for diskless setups. But it's clearly
better than it was. It would also be cleaner if all XID handling (more
generally, all RPC handling) within the kernel went through the
same functions.
1996-07-07 12:23:49 +00:00
fvdl 0f6afee9a7 Remove bogus check on record length < NFS_MINPACKET.
(From Guy Harris via Rick Macklem).
1996-07-02 23:21:15 +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 2f1b74d9f0 Always call vnode_pager_uncache when removing a file in the server
(same as in sys_unlink()).
1996-07-01 11:16:03 +00:00
fvdl b27bafebd5 We're only handling uio with iovcnt == 1, so don't ever attempt to increment
uio_iov, this will get us into nasty trouble. (Thanks to Matthias Drochner for
tracking this down).
1996-07-01 10:22:47 +00:00
pk 6e8ba625ef Ignore the mountpoint's `v_usecount' in nfs_unmount() if MNT_FORCE is on.
This takes care of two related problems:
	- `umount -f' wouldn't work if someone's working directory is
	  the filesystem root.
	- vfs_unmountall() would complain about a busy `/' on a
	  diskless setup.
1996-06-24 10:26:40 +00:00
cgd d73abf41aa avoid unnecessary checks of m_get/MGET/etc.'s return values. When
they're called with M_WAIT, they are defined to never return NULL.
1996-06-14 22:21:12 +00:00
cgd d9d0cc229c fix two bugs (the latter potentially fatal) in xdr_string_encode():
(1) if length needed was > MCLBYTES, an mbuf would be lost, and
(2) the wrong check was being used to determine if MCLGET succeeded.
1996-06-07 00:48:10 +00:00
fvdl e4145cb406 Align things right in NWDELAYHASH (for the Alpha). This fixes crashes in
the server code. From John Birell.
1996-05-27 11:22:31 +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
mycroft 49d52c9b1c Pass a proc pointer down to the usrreq and pcbbind functions for PRU_ATTACH, PRU_BIND and
PRU_CONTROL.  The usrreq interface really needs to be split up, but this will have to wait.
Remove SS_PRIV completely.
1996-05-22 13:54:55 +00:00
mycroft 261382c331 Change VOP_UPDATE() semantics:
* Make 2nd and 3rd args timespecs, not timevals.
* Consistently pass a Boolean as the 4th arg (except in LFS).
Also, fix ffs_update() and lfs_update() to actually change the nsec fields.
1996-05-11 18:26:27 +00:00
thorpej 3b8a528094 Changed struct ifnet to have a pointer to the softc of the underlying
device and a printable "external name" (name + unit number), thus eliminating
if_name and if_unit.  Updated interface to (*if_watchdog)() and (*if_reset)()
to take a struct ifnet *, rather than a unit number.
1996-05-07 02:51:25 +00:00
thorpej b417cc19fe Make this compile again on a SPARC if NFSCLIENT is defined without
NFSSERVER.  (-Wall unused variable lossage)
1996-04-15 20:20:00 +00:00
thorpej ea39811fd8 Make these link in the absense of "options FIFO". 1996-04-03 23:25:36 +00:00
fvdl fa29f1090f Return earlier on error in nfs_statfs. Should fix problem reported by
both mrg and cgd.
1996-03-24 23:58:10 +00:00
fvdl c0d2b279c6 Make sure not to free the reply mbuf twice. Should fix PR #2240 1996-03-20 21:59:56 +00:00
christos 3fac949f8f Fix printf format strings. 1996-03-17 02:38:20 +00:00
fvdl f5e6df1ed0 Disable invalidating of directory offsets cookies. Should fix one or two
directory problems.

XXX There is no clean solution to the cookie/cookieverifier validity mess.
    Together with the disabled strict cookie check, this puts us back at
    what v2 did in this case. Slightly better solution possible by
    consequently storing 64bit cookies in other places too.
1996-03-13 00:44:17 +00:00
fvdl 146f96c2ce Make readdirsize default to rsize if rsize is explicitly specified,
and readdirsize isn't.
1996-03-13 00:38:55 +00:00
jtk 6c62245a7b fix panic "leaf should be empty" on diagnostic kernels when unlinking on
a read-only file system.
1996-03-05 05:30:09 +00:00
jtk 115750720d Do not return whiteout directory entries in NFS readdir replies. (The
NFS protocol doesn't know how to deal with them properly, yet.)
1996-03-02 15:55:52 +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 3821dd940b Oops. Do previous fix on the right line this time.. (thanks Charles) 1996-02-25 17:47:26 +00:00
fvdl 1f20fc9fc2 Call soreserve() with the right size for receives (from pk). 1996-02-25 15:30:01 +00:00
cgd e98dc62664 Third argument to VOP_PATHCONF is a register_t *, and register_t may be
different than 'int'.  Do the right thing when declaring variables which
are used this way.
1996-02-20 23:45:10 +00:00
fvdl e9788cf246 Fix a missing 'error =' before 'if (error)'. 1996-02-18 14:06:50 +00:00
fvdl 5ac7df1caf Bring in a merge of Rick Macklem's NFSv3 code from Lite2 1996-02-18 11:53:36 +00:00
gwr 04ff35d122 Add stub for nfs_boot_getfh if NETHER==0 1996-02-16 15:18:19 +00:00
gwr b29ca3a272 Do the RPC to bootparamd a little later (just before the mountd call)
so that we do not ask for the "swap" path when swapping on disk.
1996-02-13 17:53:32 +00:00
christos 216907979a add 2 missing fwd struct declarations 1996-02-13 17:06:52 +00:00
pk b153275d13 Don't return EBADRPC if we have something else. 1996-02-10 22:55:16 +00:00
christos e4c93ec893 nfs prototype changes 1996-02-09 21:48:19 +00:00
mycroft c9c8301a91 Fix vop_link, vop_symlink, and vop_remove semantics in several ways:
* Change the argument names to vop_link so they actually make sense.
* Implement vop_link and vop_symlink for all file systems, so they do proper
  cleanup.
* Require the file system to decide whether or not linking and unlinking of
  directories is allowed, and disable it for all current file systems.
(Also, remove the cross-device link check, that was moved into the file
systems some time ago.)
1996-02-09 15:47:11 +00:00
mycroft 53fccab940 Fix vop_link, vop_symlink, and vop_remove semantics in several ways:
* Change the argument names to vop_link so they actually make sense.
* Implement vop_link and vop_symlink for all file systems, so they do proper
  cleanup.
* Require the file system to decide whether or not linking and unlinking of
  directories is allowed, and disable it for all current file systems.
1996-02-09 14:45:36 +00:00