Commit Graph

144 Commits

Author SHA1 Message Date
sommerfe 7ba7fbbb23 Always include fifos; "not an option any more". 1998-06-24 20:58:44 +00:00
sommerfe becaafeea0 defopt for options FIFO 1998-06-22 22:00:59 +00:00
kleink 382743ada3 Convert fsync vnode operator implementations and usage from the old `waitfor'
argument and MNT_WAIT/MNT_NOWAIT to `flags' and FSYNC_WAIT.
1998-06-05 19:53:00 +00:00
kleink fe2d01988e Fix some arithmetics lossage on typeless pointers. 1998-05-08 18:18:55 +00:00
fvdl 9329c1df98 Fix cookie handling I messed up totally when doing the Lite2 thing.
(Hello McFly? Anybody home?)
1998-03-03 00:17:04 +00:00
fvdl e5bc90f40c Merge with Lite2 + local changes 1998-03-01 02:20:01 +00:00
mrg d90485202c - add defopt's for UVM, UVMHIST and PMAP_NEW.
- remove unnecessary UVMHIST_DECL's.
1998-02-10 14:08:44 +00:00
mrg 1a8c7604f4 initial import of the new virtual memory system, UVM, into -current.
UVM was written by chuck cranor <chuck@maria.wustl.edu>, with some
minor portions derived from the old Mach code.  i provided some help
getting swap and paging working, and other bug fixes/ideas.  chuck
silvers <chuq@chuq.com> also provided some other fixes.

this is the rest of the MI portion changes.

this will be KNF'd shortly.  :-)
1998-02-05 07:59:28 +00:00
thorpej 98bb00f98f Fix alignment problems. From Frank van der Linden <fvdl@NetBSD.ORG>. 1997-10-20 22:08:44 +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 8b88b63c52 u_short -> mode_t 1997-10-17 00:00:41 +00:00
fvdl 8cc94a2371 Get rid of some MARKCACHED calls I thought better of. Make sure d_reclen
is aligned for off_t access, or things will break on the Alpha.
1997-10-13 08:35:53 +00:00
fvdl c3ce5f02ea Do negative lookup caching. Use a timestamp of the oldest negative cache
entry, so it can be checked against directory modification time for
validity.
1997-10-12 23:13:35 +00:00
fvdl 7f7d814e67 * New directory entry caching system. Provides full caching of any
directory cookie that may be thrown back at us from userspace, up
  to a size limit. Fixes double entry problem.
* Split flags for internal and external use in the NFS mount structure.
* Fix some buffer structure fields that weren're being used correctly.
* Fix missing directory cache inval call in nfs_open.
* Limit on NFS_DIRBLKSIZ no longer needed, bumped to the more reasonable
  value of 8k.
* Various other things that I forget, all related to the dir caching
  somehow, though.
1997-10-10 01:53:17 +00:00
fvdl 43e1b9384f * Deal with servers that don't give complete FSINFO (like NT)
From Olaf Seibert <rhialto@polder.ubc.kun.nl> (PR 3687)
* Make an attempt to check the maximum filesize before attempting
  a write to the server, as write RPCs will typically happen
  asynchronously, and the process will not see the error.
  Fixes problems with unexpectly truncated files at 4G
* Pass up errors in nfs_writerpc correctly
1997-07-17 23:54:27 +00:00
fvdl 2c5bca83ed Don't assume that pointers into mbuf data remain valid across nfsm_dissect.
In readdirplus, don't keep such pointers but store the file attributes
in a variable instead until they are needed. Change nfsm_loadattr*
a bit so it can accept a direct pointer to an nfs_fattr structure.
1997-07-14 20:46:20 +00:00
drochner 8c0a9bab00 Don't cast 64bit (off_t) file sizes to vm_offset_t (32bit on many
architectures), truncate them intelligently instead.
The truncation is done centralized in vnode_pager.c.
This prevents from wrap-over effects when parts of large (>2^32 byte) files
are mmapped.
Don't allow to mmap above the numerical range of vm_offset_t.
This is considered a temporary solution until the vm system handles the
object sizes/offsets more cleanly.
1997-07-04 20:22:09 +00:00
fvdl 1dfdc8999d Immediately return EPERM for a VOP_REMOVE on a directory. 1997-06-30 20:23:56 +00:00
fvdl f9d1ae2243 clear B_AGE for non-flush writes, buffers seem to be reused
too quickly, disturbing NFS performance (XXXX needs further analysis
and a _real_ fix)
1997-05-12 23:42:11 +00:00
mycroft 76ee747754 Need stat.h. 1997-05-08 17:17:29 +00:00
mycroft e3f99a9397 Pass the vnode type to vaccess(), and use it when checking VEXEC. Make sure
that the mode bits passed to vaccess() and returned by foo_getattr() contain
only permission bits.
1997-05-08 16:19:43 +00:00
mycroft 837a72363d VEXEC -> VLOOKUP, as appropriate. 1997-05-08 10:57:17 +00:00
mycroft bbb6842922 In nfs_link(), check for a cross-device mount *before* looking in the
v_data field.
1997-03-05 02:08:06 +00:00
fvdl 37986aa09a Fixes from BSDI (thanks go to Keith Bostic). Original RCS messages:
date: 1996/07/23 17:14:46;  author: donn;  state: Exp;  lines: +6 -4
Be sure to push out the last page of the file before truncating it.

date: 1996/10/14 22:41:20;  author: donn;  state: Exp;  lines: +2 -2
From Chris: Nfs_link() called vput() on the wrong vnode when aborting
from a cross-device link, which could (and did) lead to crashes.

date: 1996/10/24 16:43:43;  author: pjd;  state: Exp;  lines: +6 -2
Return EOPNOTSUPP when trying to do a setattr with flags.

===

Also (from BSDI too, but the RCS message did not quite describe the change
to this particular file well): move the EROFS a bit further down to
let VOP_ACCESS do it's work and return an 'expected' error value to
a possible layered filesystem.
1997-02-22 03:08:47 +00:00
fvdl be787cc073 * Fix some bugs in NQNFS (malformed RPC requests, no directory lease eviction)
* Avoid possible NULL ptr ref in nfs_reply
* Don't ever try to sillyrename directories (from FreeBSD)
1997-02-09 21:19:04 +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
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
fvdl 90b2034c7c Use the right time for v3 setattr operation. 1996-07-07 12:25:47 +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 ea39811fd8 Make these link in the absense of "options FIFO". 1996-04-03 23:25:36 +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
fvdl 5ac7df1caf Bring in a merge of Rick Macklem's NFSv3 code from Lite2 1996-02-18 11:53:36 +00:00
christos e4c93ec893 nfs prototype changes 1996-02-09 21:48:19 +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
jtc 2ea599d8f8 Rename struct timespec fields to conform to POSIX.1b 1996-02-01 00:41:19 +00:00
mycroft 59d1cce3ae Don't specify a uid or gid in create operations; let the server fill it in. 1996-01-31 05:13:33 +00:00
mycroft 85f2006f7a Correct some uses of -1 and VNOVAL. 1996-01-31 04:24:35 +00:00
cgd 3e0efb4d89 changes to make this work on systems where pointers & longs are 64 bits.
This is mostly just changes to make the stuff that goes over the wire
use fixed-size types.
1995-12-19 23:07:11 +00:00
ghudson d61f235615 Add cookie support. Stash cookies in the word prior to the end of
each entry, and read them out in nfs_readdir().

Caveat: our current caching method for directory blocks uses the
server offset of the first directory entry as an identifier, so a
Linux emulation getdirentries() will wind up retrieving one block from
the NFS server for each directory entry, unnecessarily thrashing the
cache.  The situation isn't as bad for other emulations.

Instead of getblk(), we need to write a routine to scan each cache
block associated with vp to find a cookie that matches at some
directory entry.  Some later time.
1995-10-14 00:56:07 +00:00
mycroft b12f4a4409 For now, return EINVAL if the client needs cookies. 1995-10-09 11:25:30 +00:00
gwr ca3ff7bdd8 Initialize fields in the RPC data where we were sending garbage. 1995-03-18 05:56:32 +00:00
mycroft 69eef46dd1 Make sure readdir requests are only truncated on block boundaries. 1995-01-10 06:50:03 +00:00
mycroft e16d63a4c0 Minor consistency nits. 1994-12-29 22:21:37 +00:00
mycroft d23d4ad181 Remove a bit of redundant code. 1994-12-29 22:16:19 +00:00
mycroft 609063ce2b Format police. 1994-12-27 19:05:12 +00:00
mycroft 34c8e07091 Fix typos in last change. 1994-12-27 19:00:20 +00:00
ws 2f0fb8ee09 Implement and use a common access checking routine 1994-12-24 16:44:12 +00:00
mycroft 527b796ff5 Turn lease_check() into a vnode op, per CSRG. 1994-12-13 20:14:30 +00:00
mycroft 6bd48aee2d Remove an old `#ifdef notyet'. 1994-12-13 16:18:48 +00:00
cgd 6f353db960 update for new syscall args description mechanism 1994-10-20 04:28:10 +00:00
pk cdf3d1ed89 mknod() must release its new vnode. 1994-08-30 19:42:22 +00:00
mycroft 27377e3e10 Don't attempt to use IO_APPEND for NQNFS, as suggested by Rick Macklem. 1994-08-21 15:10:44 +00:00
pk 4e501cd0bf Files with > 1 links can always be removed on the server, even if a
"silly name" exists.
1994-08-13 08:46:53 +00:00
deraadt 0e5ad5faf5 delete unused extern decl 1994-08-08 19:29:29 +00:00
mycroft a28c342dee Bug fix from Rick Macklem for a problem with linking to an open file. 1994-07-12 19:46:36 +00:00
mycroft c6d5fd7263 Fix problem with O_TRUNC and NFS device nodes. 1994-07-03 09:22:37 +00:00
cgd fccfa11af5 New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD' 1994-06-29 06:39:25 +00:00
pk bccc2c3c1b straighten out diskless swap code somewhat. 1994-06-22 14:01:45 +00:00
mycroft cde1d47595 Update to 4.4-Lite fs code, with local changes. 1994-06-08 11:33:09 +00:00
cgd 4da98bee08 stupidity for prototypes... 1994-05-19 05:04:07 +00:00
cgd d071d1cf05 some prototype cleanup, eliminate/replace bogus types (e.g. quad and
u_quad) -> use better types (e.g. quad_t & u_quad_t in inodes),
some cleanup.
1994-04-25 03:49:27 +00:00
cgd f7003b8eba blow away all vestiges of nfsnode locking.
(1) it's unnecessary
	(2) it causes machines to hang (yup!)
	(3) it'd be gone in a few days anyway (it'd been yanked out
		of 4.4-Lite by macklem long ago)
It was only there because macklem couldn't originally decide if things
should be locked, or not...
1994-04-21 23:23:29 +00:00
cgd 3dda0064a5 Convert mount, vnode, and buf structs to use <sys/queue.h>. Also,
some knf and structure frobbing to do along with it.
1994-04-21 07:47:31 +00:00
pk 092d94c85b Remove bogus type translation; in stead, use IFTOVT again to go from
`NFS mode bits' to `vnode type'.
Use aliased vnode consistently.
1994-04-14 10:27:46 +00:00
cgd d7ce0b81a2 expand uid_t/gid_t/off_t 1994-03-27 09:09:21 +00:00
ws ce516ff13d Make FFS optional 1994-03-09 21:21:37 +00:00
mycroft bc47f533d5 Macros bite again. 1994-02-15 21:43:09 +00:00
mycroft 28abb89625 Format police. 1994-02-15 21:26:01 +00:00
pk e85a637bca Update {a,m}time vnode attributes on special files a la ufs_vnode.c,
but make it a non-urgent operation, to leave us some performance.
1994-02-15 21:07:10 +00:00
mycroft 805c52eecb Eliminate some more uses of b_actl. 1994-02-06 11:28:37 +00:00
pk acc0f12ec0 reparations... 1994-01-10 13:29:26 +00:00
pk 36655da823 Don't deny unlink()s of files with the "silly" bit on, but still have > 1 links,
but avoid doing gratuitous (possibly expensive) get_attr() calls.
1994-01-10 09:37:05 +00:00
cgd 2c5c3a2774 add support for union and loopback mounts, from jsp 1994-01-04 14:10:48 +00:00
cgd 953dee1999 fix nfs_print, add cross-device link checking (From jsp) 1993-12-22 13:03:22 +00:00
mycroft 95b048b53a Canonicalize all #includes. 1993-12-18 00:40:47 +00:00
pk 011f7efb3a Avoid dereferencing NULL pointer in nfs_doio() when B_PHYS is on.
Remove comment talking about nfsiomaps that we don't have.
Always use credentials that are in the buffer header, in stead of trying
to get them from pageproc, which may once have been necessary to push pages
to swap (cannot imaging anyone having exercised this over NFS though).
1993-12-16 16:43:36 +00:00
cgd 5c50cb4631 fix a goof that i made; return *before* nfs_lock() is called... 1993-12-07 04:47:41 +00:00
cgd facd69a0ee do something better with lookup return values; suggested by BSDI's msdosfs mod 1993-11-20 09:40:32 +00:00
cgd 76dbc1192b new specfs.h and fifo.h locations 1993-11-12 05:54:12 +00:00
ws 053f138dae Changes to VFS readdir semantics
NFS changes for better cookie support
ISOFS changes for better Rockridge support and support for generation numbers
1993-09-07 15:40:14 +00:00
mycroft 781aeda1e7 Make return type of nfs_print be a void, not an int. 1993-08-02 23:12:31 +00:00
cgd 7ecbd4b92d get rid of some more bogus changes from a week ago 1993-07-13 10:50:04 +00:00
cgd c58c7e0a97 diskless changes made last time were hosed; were using NULL for
"no credentials" rather than NOCRED.
1993-07-13 10:04:26 +00:00
cgd 0b1df311fc changes from ws to support diskless booting... these are "OK" on inspection
and after testing...  (actually, currently, none of the changed
code is even used...)
1993-07-07 12:06:32 +00:00
cgd a92f51ffcb fix for macklem's bogus use of the va_flags field, supplied by
John Woods, jfwfrom: @ksr.com.  also, fixes the following problems:
the va_gen field is in a similar position
(Suns are going to be reporting the change-date microseconds as their
"generation"), I've supplied my own set of diffs below for your inspection.
Note these aren't even compiled, but they're pretty similar to what I had
to do to our older version of OSF/1 here.  (There's also an unrelated change
supplied for xdr_subs.h; the pointer types supplied to the fxdr_time() and
txdr_time() macros are not, in fact, both struct timevals.  That turns out
to be one of many tips-of-the-iceberg facing those porting the (old) Berkeley
NFS code to 64-bit machines...)
1993-06-03 01:12:44 +00:00
cgd d2ee066f71 add Yuval Yarom's changes (originally for BSD/386) for advisory record
locking on NFS files.  Note that this DOES NOT support network locking,
only local advisory locks.
1993-05-22 09:00:49 +00:00
cgd 769818382a add rcsid again; fix RCS+crash fuckup 1993-05-21 07:31:58 +00:00
glass 24e91b0789 migrated code to make split possible 1993-04-10 20:19:19 +00:00
cgd e541169ce2 after 0.2.2 "stable" patches applied 1993-03-21 18:04:42 +00:00
cgd 61f282557f initial import of 386bsd-0.1 sources 1993-03-21 09:45:37 +00:00