Commit Graph

461 Commits

Author SHA1 Message Date
pk 72cadd83e4 Fix printf() format. 2000-05-18 08:34:26 +00:00
tsarna 9bd6bb5e81 Auto-adjusting vfs.nfs.iothreads: when mounting the first nfs
filesystem, if the number of threads is "-1", meaning it's never been
set, then set it to 4.  You can override by setting this to some other
number (including 0) before or after mounting, of course.

Thanks to whoever it was that suggested this on ICB... sorry I don't
remember who.
2000-05-07 01:38:36 +00:00
tsarna a32696c2de Death to nfsiod!
It is replaced by kernel threads that do the same thing. The number of
kernel threads used is set with the vfs.nfs.iothreads sysctl.
2000-04-15 21:14:48 +00:00
augustss 13e9027f58 Remove more register declarations. 2000-03-30 13:44:53 +00:00
augustss 8529438fe6 Remove register declarations. 2000-03-30 12:51:13 +00:00
simonb 19f0e3f6e8 Delete redundant decl of nfs_vget() - it's in <nfs/nfsmount.h>. 2000-03-30 02:46:36 +00:00
simonb 3e3701895d Delete redundant decls of fifo_vnodeop_p - it's in <miscfs/fifofs/fifo.h>.
Don't need <sys/conf.h> here.
2000-03-30 02:45:19 +00:00
simonb b6c62dcaae Delete redundant decl of nfs_pub - it's in <sys/mount.h>.
Delete redundant decl of nfsrv_zapsock() - it's in <nfs/nfs_var.h>.
2000-03-30 02:43:58 +00:00
simonb 11bec2d6e1 Delete redundant decl of nfs_pub - it's in <sys/mount.h>.
Delete redundant decls of nfsv{2,3}_type - they're in <nfs/nfsproto.h>.
2000-03-30 02:43:13 +00:00
simonb 13e9e9754e Delete redundant decl of nfs_pub - it's in <sys/mount.h>. 2000-03-30 02:42:17 +00:00
simonb 515481f1ce Delete redundant decl of nfsv2_vnodeop_p, it's in <nfs/nfsnode.h>. 2000-03-30 02:40:37 +00:00
simonb 0fd09c8496 Don't need to include <sys/conf.h> here. 2000-03-29 03:43:33 +00:00
thorpej fc96443d15 New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
  resource allocation.
- Insertion and removal of callouts is constant time, important as
  this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
2000-03-23 07:01:25 +00:00
jdolecek 89015c4648 Add new VFS op routine - vfs_done and call it on filesystem detach
in vfs_detach(). vfs_done may free global filesystem's resources,
typically those allocated in respective filesystem's init function.
Needed so those filesystems which went in via LKM have a chance to
clean after themselves before unloading. This fixes random panics
when LKM for filesystem using pools was loaded and unloaded several
times.

For each leaf filesystem, add appropriate vfs_done routine.
2000-03-16 18:08:17 +00:00
enami 747ef6745c If server name field is overloaded for other purpose, or it just contains
NULL string, don't use it as server name.
2000-01-20 08:34:52 +00:00
fvdl 44ab379124 The length check for readdirplus entries wasn't right, causing troubles
with 32k readdir sizes. From FreeBSD.
1999-12-05 01:43:06 +00:00
fvdl 5a7300902c Insert an extra VOP_ACCESS check in nfs_lookup, to avoid cached access
mishaps for lookup and getattr. Closes PR 8884.

While at it, cache access RPCs.
1999-11-29 23:34:00 +00:00
fvdl d901f6eae0 Be more careful to block bio interrupts for some data structures. There
were at least a few missed cases where vp->v_{clean,dirty}blkhd were
unprotected since the softdep/trickle sync merge.
1999-11-23 23:52:40 +00:00
fvdl 0b1963121a Add Kirk McKusick's soft updates code to the trunk. Not enabled by
default, as the copyright on the main file (ffs_softdep.c) is such
that is has been put into gnusrc. options SOFTDEP will pull this
in. This code also contains the trickle syncer.

Bump version number to 1.4O
1999-11-15 18:49:07 +00:00
fvdl f39cfa5c7b Stuff values in va_blocksize that are closer to reality. 1999-11-01 21:32:41 +00:00
sommerfeld ff0b960398 Fix bug in error handling for NFSv3 + nqnfs.
With nfsv2, the nfsm_reply() macro always causes the service routine
to return if error was nonzero.

With nfsv3, we can keep going after nfsm_reply() without returning,
but nqnfsrv_getlease() didn't take this into account, so add a
return(0) after each error-case nfsm_reply(0).
1999-10-10 02:44:55 +00:00
is ee1ce1c15e Don't truncate minor numbers >= 256.
Problem reported by Saitoh Masanobu, fix by Frank van der Linden.
1999-09-06 09:27:18 +00:00
jdolecek 2ac419a152 Adapt to cache_lookup() changes.
XXX I had no chance to actually test the changes for nfs, but hopefully I got
it right.

Tested by: jdolecek
Rewieved by: wrstuden
1999-09-05 14:28:26 +00:00
drochner 6b4bfbbe10 Wait some seconds after the interface is brought up before packets
are sent. Needed at least for if_ti to get the link up.
1999-09-03 20:06:46 +00:00
sommerfeld 5493437dd8 Once the mount structure is definitely doomed, always set the
NFSMNT_DISMNT bit in it so that any waiters can go away cleanly.
(formerly, we did this only in the NQNFS/KERB cases).
1999-08-29 18:32:15 +00:00
sommerfeld 873713a5f7 Fix overzealous DIAGNOSTIC check in nfs_disconnect()
(fix pr8249, 8288)
1999-08-29 16:29:16 +00:00
wrstuden 3bf14d81e9 Add support for fcntl(2) to generate VOP_FCNTL calls. Any fcntl
call with F_FSCTL set and F_SETFL calls generate calls to a new
fileop fo_fcntl. Add genfs_fcntl() and soo_fcntl() which return 0
for F_SETFL and EOPNOTSUPP otherwise. Have all leaf filesystems
use genfs_fcntl().

Reviewed by: thorpej
Tested by: wrstuden
1999-08-03 20:19:16 +00:00
wrstuden 3954583ce7 Teach nfs_lookup() to set PDIRUNLOCK when appropriate. Should resolve
PR 8051 by Konrad Schroder.
1999-08-02 18:58:23 +00:00
fvdl 3c9ce57651 Don't try to copy an mbuf that may have been freed in case of an error. 1999-07-30 09:46:24 +00:00
thorpej d7f9efdafc In nfs_create(), make sure error is reset to 0 if we restart the operation. 1999-07-29 17:01:21 +00:00
enami 18a17d4777 Don't use the result of inet_ntoa after calling the another inet_ntoa,
since they share the same static storage.
1999-07-26 02:16:35 +00:00
wrstuden 5e77d9fec1 Teach nfs_lookup to clear PDIRUNLOCK. 1999-07-08 22:53:08 +00:00
wrstuden 379a26972f Modify file systems to deal with struct lock in struct vnode. All leaf
fs's other than nfs use genfs_lock() for locking.

Modify lookup routines to set PDIRUNLOCK when they unlock the parrent.
1999-07-08 01:05:58 +00:00
drochner c867601f9f mount diskless root with "NFSMNT_NOCONN" (which is default in "mount_nfs"
for quite a while) to allow certain servers (multihomed, as our DEC NSE
cluster) to be used as root filesystem without special tweaks
1999-07-07 21:29:29 +00:00
sommerfeld c1ecf66965 kern/5591: Fix race in the NFS socket code during umount -f and system
shutdown:

During an unmount, wake up all the processes which are waiting to lock
the socket for receive, and wait for them (and the process blocked in
soreceive, if any) to go away before blowing away the socket and the
mount structure.
1999-07-04 19:56:00 +00:00
wrstuden 6e06666498 Add fhopen, fhstat, fhstatfs syscalls. Also move getfh in from the nfs
syscall code.
1999-06-29 22:18:47 +00:00
fvdl 5958c68bc5 Be more correct with attribute structures for setattr RPCs and friends,
so that picky servers (e.g. Solaris 7) don't refuse our requests. Move
some code into a macro, and a bit of KNF. From OpenBSD.
1999-05-29 01:22:03 +00:00
drochner 16f2b4c6a9 -print diskless boot related IP addresses in dot notation
-arrange gateway code to fall back to the old method if the new "getfile"
 is not answered (and both are enabled -- allow to switch off the new
 method for symmetry)
-handle error if setting the netmask fails
1999-05-07 15:17:26 +00:00
drochner 41b78a54f1 print diskless boot related IP addresses in dot notation 1999-05-07 15:10:03 +00:00
thorpej e3669c3393 Add "use counting" to file entries. When closing a file, and it's reference
count is 0, wait for use count to drain before finishing the close.

This is necessary in order for multiple processes to safely share file
descriptor tables.
1999-05-05 20:01:01 +00:00
sommerfe 6f883a0b1c Include checks (under DIAGNOSTIC) to catch vnode lock leaks soon after
they happen (while we still know which remote op is to blame for it),
instead of later when we trip over the already-locked vnode.
1999-05-04 16:08:02 +00:00
sommerfe 623d43160b Fix vnode lock leak in nfsrv_mknod() if to-be-created vnode already existed. 1999-05-04 16:01:37 +00:00
ross 4634c0e3d4 libkern just got an inet_addr(), but it won't compile, no prototype. Cleanup...
* Add prototype to libkern.h.
* Remove the almost-identical-copy from libsa/net.[ch].
* Change its type back to the (wrong, but harmless) historical one. (u_long)
* Kill the XXX local prototype in nfs_bootparam.c
1999-04-12 01:05:01 +00:00
gwr 2c54ffdf02 Enable the code that gets our gateway+netmask from the
bootparam server using the "gateway" pseudo file.
(Compatible with sys/lib/libsa/dev_net.c)
1999-04-11 22:15:25 +00:00
mycroft afa07de60d Fix two problems with NFSV3CREATE_GUARDED:
* We shouldn't truncate the file.
* We were leaving the vnode locked (unless the truncate happened to fail).
Solaris clients may cause this under some conditions.
Problem reported by chopps, analysis and fix by me.
1999-03-30 12:01:18 +00:00
sommerfe e94a23c0ef Fix crash reported in PR7116 on shutdown 1999-03-25 04:07:33 +00:00
mrg d2397ac5f7 completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
1999-03-24 05:50:49 +00:00
kleink 9ee75a4fcc Add _PC_FILESIZEBITS to pathconf vnop. 1999-03-22 19:21:07 +00:00
fvdl 84c33581df ..JUKEBOX can happen on writes too. 1999-03-16 23:24:28 +00:00
fvdl df3c103b26 The JUKEBOX error may be returned by the read operation, so don't
filter it out.
1999-03-16 23:22:57 +00:00
fair d143754986 Snatch a patch from OpenBSD to fix PRs 6529 and 7074.
Adjust fxdr_hyper() and txdr_hyper() macros.
1999-03-06 05:34:40 +00:00
mycroft 4de576b025 Clean up some sign extension bogosity in statfs, so negative numbers are
actually negative on a LP64 client.
1999-03-05 07:27:58 +00:00
wrstuden bc94ad4c5e Rationalize the vfs_checkexp macro to be VFS_CHECKEXP. 1999-02-27 00:47:34 +00:00
wrstuden 862a56e88b Modify vfsops to seperate vfs_fhtovp() into two routines. vfs_fhtovp() now
only handles the file handle to vnode conversion, and a new call,
vfs_checkexp(), performs the export verification.
1999-02-26 23:44:43 +00:00
drochner 33ed457810 -call nfs_boot_cleanup() if mount failed
-g/c diskless swap initialization
1999-02-21 15:11:09 +00:00
drochner 27098b1199 restructure the diskless NFS boot code to keep track of the used
interface and the address allocated, to roll everything back if the
mount fails:
-put an interface pointer into "struct nfs_diskless" to have it
 available for cleanup, don't pass it around anymore where the
 "struct nfs_diskless" is already passed
-add a "cleanup" function which shuts the interface down
-in the protocol-specific parts, either return with "everything
 ready" or "completely shut down"
-use common functions for interface initialization and shutdown
-add a function to delete all routes associate to an interface
 (why is this necessary and not done by ~IFF_UP?)
g/c diskless swap stuff
general cleanup
1999-02-21 15:07:49 +00:00
thorpej a4376d6a58 Fix printf format problems on Alpha. 1999-02-12 01:38:38 +00:00
thorpej 1b97ad6910 Fix printf format warnings on Alpha. 1999-02-12 01:37:06 +00:00
mrg 1c93cc902d non-root users can mkfifo over NFS. 1999-01-31 09:24:10 +00:00
thorpej a3574d12b6 Clean up the NFS sysctl variables. 1998-11-13 20:09:54 +00:00
fvdl fb1a849339 Use different names for the "nfscon" label to tsleep(), so that it can
be seen in which one a process is sleeping.
1998-11-12 22:31:02 +00:00
mycroft 6957bd875c Do not permit the u area for nfsd or nfsiod to be swapped out. 1998-11-08 15:57:44 +00:00
drochner 864b7d54c6 Use the "atime" instead of "mtime" of the remote root directory as
base for inittodr() - it is closer to the current time.
1998-09-28 21:20:52 +00:00
christos d758aee3a9 Fix copyright spacing. 1998-09-13 13:49:29 +00:00
mycroft fb526e055c Substantial signal handling changes:
* Increase the size of sigset_t to accomodate 128 signals -- adding new
  versions of sys_setprocmask(), sys_sigaction(), sys_sigpending() and
  sys_sigsuspend() to handle the changed arguments.
* Abstract the guts of sys_sigaltstack(), sys_setprocmask(), sys_sigaction(),
  sys_sigpending() and sys_sigsuspend() into separate functions, and call them
  from all the emulations rather than hard-coding everything.  (Avoids uses
  the stackgap crap for these system calls.)
* Add a new flag (p_checksig) to indicate that a process may have signals
  pending and userret() needs to do the full (slow) check.
* Eliminate SAS_ALTSTACK; it's exactly the inverse of SS_DISABLE.
* Correct emulation bugs with restoring SS_ONSTACK.
* Make the signal mask in the sigcontext always use the emulated mask format.
* Store signals internally in sigaction structures, rather than maintaining a
  bunch of little sigsets for each SA_* bit.
* Keep track of where we put the signal trampoline, rather than figuring it out
  in *_sendsig().
* Issue a warning when a non-emulated sigaction bit is observed.
* Add missing emulated signals, and a native SIGPWR (currently not used).
* Implement the `not reset when caught' semantics for relevant signals.

Note: Only code touched by the i386 port has been modified.  Other ports and
emulations need to be updated.
1998-09-11 12:50:05 +00:00
christos 344ed1eaef Assign copyright to TNF. 1998-09-05 14:20:01 +00:00
thorpej 9a3664eccf Use the pool allocator and the "nointr" pool page allocator for NFS nodes
and vattr structures.
1998-09-01 03:11:36 +00:00
thorpej f19e987daa Add some braces to make egcs happy (ambiguous else warning). 1998-08-18 06:45:04 +00:00
matthias 574106c52b create miscfs/genfs/genfs_vnops.c:genfs_enoioctl and make all the other
filesystems use it instead of a private version.
1998-08-10 08:11:10 +00:00
perry 4522c799a1 bzero->memset, bcopy->memcpy, bcmp->memcmp 1998-08-09 20:51:08 +00:00
kleink 4d9c340f85 Pathconf: for V2 mounts, revert back to failing with EINVAL if an RPC would
be necessary to obtain the information, as this fits the pathconf semantics
of `no association supported' better than `no limit available.'
1998-08-08 11:39:20 +00:00
kleink e081a838b5 Add client pathconf support. 1998-08-07 11:02:39 +00:00
kleink 741d372539 Like for NFSv2, add a pointer to the NFSv3 RFC, too. 1998-08-06 19:44:28 +00:00
fvdl 2db169eb1f Avoid possibly overflowing an mbuf. From Dan S. Decasper, via Chuck Cranor. 1998-07-20 16:41:05 +00:00
jonathan d275e56dee * defopt COMPAT_{09,10,11,12,13} and COMPAT_NOMID.
TODO: revisit interaction between native compat and emul compat usage.
1998-07-05 08:49:30 +00:00
jonathan 5c0c5dd0b4 defopt ISO TPIP. 1998-07-05 04:37:35 +00:00
thorpej 6b781d156f defopt NFSSERVER 1998-06-25 22:17:36 +00:00
thorpej 961f0708b1 - Rename nqnfs_vop_lease_check() to genfs_lease_check(). If NFSSERVER is
not in the kernel, genfs_lease_check() is simply a no-op.  This allows
  LKM'd file systems to be exported (previously did not work properly
  due to a compile-time decision based on -DNFSSERVER).
- defopt NFSSERVER
1998-06-25 22:15:28 +00:00
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
fvdl 865838bfd7 Fix possible overflow problem in read size computation. 1998-06-21 22:18:16 +00:00
drochner d9088c141e Fix last change: If BOOTP/DHCP was successful, don't try RARP/BOOTPARAM. 1998-06-13 14:13:25 +00:00
tv dc8a6b4a21 Fix boogered gcc warning workaround the right way. 1998-06-13 04:33:40 +00:00
tv ffc503dc80 Clean up boogered gcc warning workaround (remove goto completely) and remove
a redundant `if'.
1998-06-13 04:28:46 +00:00
cgd 651b44e211 Rework the way kernel include files are installed. In the new method,
as with user-land programs, include files are installed by each directory
in the tree that has includes to install.  (This allows more flexibility
as to what gets installed, makes 'partial installs' easier, and gives us
more options as to which machines' includes get installed at any given
time.)  The old SYS_INCLUDES={symlinks,copies} behaviours are _both_
still supported, though at least one bug in the 'symlinks' case is
fixed by this change.  Include files can't be build before installation,
so directories that have includes as targets (e.g. dev/pci) have to move
those targets into a different Makefile.
1998-06-12 23:22:30 +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
matt bd055c0318 Adapt to new sosend/soreceive and upcall (now down in sowakeup) 1998-04-25 17:41:01 +00:00
drochner bb2aeabe8a -catch zero and broadcast IP addresses sent by a DHCP server
-warn about them (and other invalid replies)
-print address of BOOTP/DHCP server for better problem tracking
-KNF
1998-04-24 18:38:30 +00:00
mrg 02c05e3fd8 add forward decl for union nethostaddr. 1998-03-29 05:13:00 +00:00
fvdl 092f0654fe Re-instate call to "safe" disconnect function that got lost during the
Lite2 merge.
1998-03-24 13:49:21 +00:00
thorpej 40b5fe66e7 Historical practice assumes that NFS root mounts are initially read/write. 1998-03-03 19:07:20 +00:00
fvdl 05acb550be Only free cookies on error when they were actually allocated by the readdir vop. 1998-03-03 13:38:32 +00:00
fvdl 4f0f4cecdb Don't try to apply the cookie endian heuristic on a mounted file (e.g.
a swapfile). From Matthias Drochner.
1998-03-03 13:32:28 +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
veego 190f3ca410 Add two includes for the 'struct nfs_args' so it compiles again. 1998-03-01 17:37:32 +00:00
ross 331fee623e Sweep up some miscellaneous leftover lite2 integration shrapnel. 1998-03-01 07:15:39 +00:00
fvdl e5bc90f40c Merge with Lite2 + local changes 1998-03-01 02:20:01 +00:00
cgd 4ae42be026 be a bit more clear about what protocols will be tried in the
BOOTP/DHCP case.
1998-02-28 01:45:01 +00:00
thorpej 2146a2ed29 Include the NFS option header. 1998-02-19 00:54:13 +00:00