aboutsummaryrefslogtreecommitdiff
path: root/sys/nfsclient/nfsm_subs.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove advertising clause from University of California Regent'sWarner Losh2004-04-071-4/+0
| | | | | | | | | | license, per letter dated July 22, 1999 and email from Peter Wemm, Alan Cox and Robert Watson. Approved by: core, peter, alc, rwatson Notes: svn path=/head/; revision=127977
* University of Michigan's Citi NFSv4 kernel client code.Alfred Perlstein2003-11-141-0/+11
| | | | | | | Submitted by: Jim Rees <rees@umich.edu> Notes: svn path=/head/; revision=122698
* Avoid passing the variable `tl' to functions that just use it forIan Dowse2001-12-181-22/+22
| | | | | | | | | | | | | | | | temporary storage. In the old NFS code it wasn't at all clear if the value of `tl' was used across or after macro calls, but I'm fairly confident that the convention was to keep its use local. Each ex-macro function now uses a local version of this variable, so all of the double-indirection goes away. The only exception to the `local use' rule for `tl' is nfsm_clget(), which is left unchanged by this commit. Reviewed by: peter Notes: svn path=/head/; revision=88091
* Unwind some more macros. NFSMADV() was kinda silly since it was rightPeter Wemm2001-09-281-77/+63
| | | | | | | | | | | | | next to equivalent m_len adjustments. Move the nfsm_subs.h macros into groups depending on which phase they are used in, since that affects the error recovery requirements. Collect some of the common error checking into a single macro as preparation for unwinding some more. Have nfs_rephead return a value instead of secretly modifying args. Remove some unused function arguments that were being passed around. Clarify nfsm_reply()'s error handling (I hope). Notes: svn path=/head/; revision=84079
* Cleanup and split of nfs client and server code.Peter Wemm2001-09-181-459/+112
| | | | | | | This builds on the top of several repo-copies. Notes: svn path=/head/; revision=83651
* * Rename M_WAIT mbuf subsystem flag to M_TRYWAIT.Bosko Milekic2000-12-211-3/+3
| | | | | | | | | | | | | | | | | | | | | This is because calls with M_WAIT (now M_TRYWAIT) may not wait forever when nothing is available for allocation, and may end up returning NULL. Hopefully we now communicate more of the right thing to developers and make it very clear that it's necessary to check whether calls with M_(TRY)WAIT also resulted in a failed allocation. M_TRYWAIT basically means "try harder, block if necessary, but don't necessarily wait forever." The time spent blocking is tunable with the kern.ipc.mbuf_wait sysctl. M_WAIT is now deprecated but still defined for the next little while. * Fix a typo in a comment in mbuf.h * Fix some code that was actually passing the mbuf subsystem's M_WAIT to malloc(). Made it pass M_WAITOK instead. If we were ever to redefine the value of the M_WAIT flag, this could have became a big problem. Notes: svn path=/head/; revision=70254
* Problem to avoid processes getting stuck in "vmopar". From Ian'sDavid Malone2000-10-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mail: The problem seems to originate with NFS's postop_attr information that is returned with a read or write RPC. Within a vm_fault context, the code cannot deal with vnode_pager_setsize() shrinking a vnode. The workaround in the patch below stops the nfsm_postop_attr() macro from ever shrinking a vnode. If the new size in the postop_attr information is smaller, then it just sets the nfsnode n_attrstamp to 0 to stop the wrong size getting used in the future. This change only affects postop_attr attributes; the nfsm_loadattr() macro works as normal. The change is implemented by adding a new argument to nfs_loadattrcache() called 'dontshrink'. When this is non-zero, nfs_loadattrcache() will never reduce the vnode/nfsnode size; instead it zeros n_attrstamp. There remain other was processes can get stuck in vmopar. Submitted by: Ian Dowse <iedowse@maths.tcd.ie> Reviewed by: dillon Tested by: Vadim Belman <voland@lflat.org> Notes: svn path=/head/; revision=67486
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Convert all the nfs macros to do { blah } while (0) to ensure itPeter Wemm1999-08-191-111/+168
| | | | | | | | | works correctly in if/else etc. egcs had probably picked up most of the problems here before with "ambiguous braces" etc, but this should increase the robustness a bit. Based on an idea from Eivind Eklund. Notes: svn path=/head/; revision=50053
* Don't over-allocate and over-copy shorter NFSv2 filehandles and thenPeter Wemm1999-08-041-10/+11
| | | | | | | | | | | | | correct the pointers afterwards. It's kinda bogus that we generate a 24 (?) byte filehandle (2 x int32 fsid and 16 byte VFS fhandle) and pad it out to 64 bytes for NFSv3 with garbage. The whole point of NFSv3's variable filehandle length was to allow for shorter handles, both in memory and over the wire. I plan on taking a shot at fixing this shortly. Notes: svn path=/head/; revision=49405
* Matt's NFS fixes.Julian Elischer1999-06-231-4/+5
| | | | | | | | | Submitted by: Matt Dillon Reviewed by: David Cross, Julian Elischer, Mike Smith, Drew Gallatin 3.2 version to follow when tested Notes: svn path=/head/; revision=48125
* Various changes lifted from the OpenBSD cvs tree:Peter Wemm1999-06-051-3/+3
| | | | | | | | | | | | | | | | | | txdr_hyper and fxdr_hyper tweaks to avoid excessive CPU order knowledge. nfs_serv.c: don't call nfsm_adj() with negative values, windows clients could crash servers when doing a readdir of a large directory. nfs_socket.c: Use IP_PORTRANGE to get a priviliged port without a spin loop trying to bind(). Don't clobber a mbuf pointer or we get panics on a NFS3ERR_JUKEBOX error from a server when reusing a freed mbuf. nfs_subs.c: Don't loose st_blocks on NFSv2 mounts when > 2GB. Obtained from: OpenBSD Notes: svn path=/head/; revision=47751
* Fix for creating files on a Solaris 7 server with NFSv3 (the request wasDoug Rabson1998-12-251-11/+62
| | | | | | | | | slightly garbled but older servers seemed to understand it). Reviewed by: David O'Brien <obrien@nuxi.ucdavis.edu> Notes: svn path=/head/; revision=42060
* For the on-the-wire protocol, u_long -> u_int32_t; long -> int32_t;Peter Wemm1998-05-311-35/+35
| | | | | | | | | | int -> int32_t; u_short -> u_int16_t. Also, use mode_t instead of u_short for storing modes (mode_t is a u_int16_t). Obtained from: NetBSD Notes: svn path=/head/; revision=36541
* Don't pass a second copy of the uid/gid in with the v2/v3 sattr structures,Peter Wemm1998-05-311-6/+4
| | | | | | | | | | | it just makes more work. We pass a copy of the uid/gid with the credentials. (although, this may need to be revisited if a non AUTHUNIX authentication method (such as NFSKERB) ever gets implemented). Obtained from: NetBSD Notes: svn path=/head/; revision=36531
* Don't try and free mrep twice on some error conditions.Peter Wemm1998-05-311-2/+5
| | | | | | | Obtained from: NetBSD Notes: svn path=/head/; revision=36520
* Some const'sPeter Wemm1998-05-311-2/+2
| | | | | | | Obtained from: NetBSD Notes: svn path=/head/; revision=36511
* NFS Jumbo commit part 1. Cosmetic and structural changes only. The aimPeter Wemm1998-05-311-15/+16
| | | | | | | | | of this part of commits is to minimize unnecessary differences between the other NFS's of similar origin. Yes, there are gratuitous changes here that the style folks won't like, but it makes the catch-up less difficult. Notes: svn path=/head/; revision=36503
* Get timespecs directly instead of via timevals.Bruce Evans1998-05-161-13/+7
| | | | Notes: svn path=/head/; revision=36097
* Eradicate the variable "time" from the kernel, using various measures.Poul-Henning Kamp1998-03-301-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "time" wasn't a atomic variable, so splfoo() protection were needed around any access to it, unless you just wanted the seconds part. Most uses of time.tv_sec now uses the new variable time_second instead. gettime() changed to getmicrotime(0. Remove a couple of unneeded splfoo() protections, the new getmicrotime() is atomic, (until Bruce sets a breakpoint in it). A couple of places needed random data, so use read_random() instead of mucking about with time which isn't random. Add a new nfs_curusec() function. Mark a couple of bogosities involving the now disappeard time variable. Update ffs_update() to avoid the weird "== &time" checks, by fixing the one remaining call that passwd &time as args. Change profiling in ncr.c to use ticks instead of time. Resolution is the same. Add new function "tvtohz()" to avoid the bogus "splfoo(), add time, call hzto() which subtracts time" sequences. Reviewed by: bde Notes: svn path=/head/; revision=34961
* Forward declare some structs so that this file is more self-sufficient.Bruce Evans1998-02-031-1/+3
| | | | Notes: svn path=/head/; revision=33054
* Merge WebNFS changes from NetBSD.Doug Rabson1997-07-161-8/+14
| | | | | | | Obtained from: NetBSD Notes: svn path=/head/; revision=27446
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notPeter Wemm1997-02-221-1/+1
| | | | | | | ready for it yet. Notes: svn path=/head/; revision=22975
* This is the kernel Lite/2 commit. There are some requisite userlandJohn Dyson1997-02-101-1/+2
| | | | | | | | | | | | | | | | | | changes, so don't expect to be able to run the kernel as-is (very well) without the appropriate Lite/2 userland changes. The system boots and can mount UFS filesystems. Untested: ext2fs, msdosfs, NFS Known problems: Incorrect Berkeley ID strings in some files. Mount_std mounts will not work until the getfsent library routine is changed. Reviewed by: various people Submitted by: Jeffery Hsu <hsu@freebsd.org> Notes: svn path=/head/; revision=22521
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-141-1/+1
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673
* In sys/time.h, struct timespec is defined as:Nate Williams1996-09-191-5/+5
| | | | | | | | | | | | | | | | | /* * Structure defined by POSIX.4 to be like a timeval. */ struct timespec { time_t ts_sec; /* seconds */ long ts_nsec; /* and nanoseconds */ }; The correct names of the fields are tv_sec and tv_nsec. Reminded by: James Drobina <jdrobina@infinet.com> Notes: svn path=/head/; revision=18397
* Some fixes found using gcc -Wall:Doug Rabson1995-08-241-2/+8
| | | | | | | | | | | | | nfsm_rpchead() has been called with the wrong number of args and misplaced args since someone added new args in the middle for nfsv3. Here's another one that would be important on 64-bit systems. VOP_READDIR takes a `u_int **cookies' arg. Submitted by: Bruce Evans <bde@zeta.org.au> Notes: svn path=/head/; revision=10222
* Changes to support version 3 of the NFS protocol.Doug Rabson1995-06-271-90/+243
| | | | | | | | | | | | | | | | | | | | | The version 2 support has been tested (client+server) against FreeBSD-2.0, IRIX 5.3 and FreeBSD-current (using a loopback mount). The version 2 support is stable AFAIK. The version 3 support has been tested with a loopback mount and minimally against an IRIX 5.3 server. It needs more testing and may have problems. I have patched amd to support the new variable length filehandles although it will still only use version 2 of the protocol. Before booting a kernel with these changes, nfs clients will need to at least build and install /usr/sbin/mount_nfs. Servers will need to build and install /usr/sbin/mountd. NFS diskless support is untested. Obtained from: Rick Macklem <rick@snowhite.cis.uoguelph.ca> Notes: svn path=/head/; revision=9336
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-2/+2
| | | | Notes: svn path=/head/; revision=8876
* This is a bunch of changes from NetBSD. There are a couple of bug-fixes.Poul-Henning Kamp1994-10-171-3/+2
| | | | | | | | | | But mostly it is changes to use the list-maintenance macros instead of doing the pointer-gymnastics by hand. Obtained from: NetBSD Notes: svn path=/head/; revision=3664
* Prototyping and general gcc-shutting up. Gcc has one warning now which looksPoul-Henning Kamp1994-10-021-16/+29
| | | | | | | bad, I will get to it eventually, unless somebody beats me to it. Notes: svn path=/head/; revision=3305
* More idempotency....... this is fun :-)Paul Richards1994-08-211-1/+5
| | | | Notes: svn path=/head/; revision=2175
* Added $Id$David Greenman1994-08-021-0/+1
| | | | Notes: svn path=/head/; revision=1817
* BSD 4.4 Lite Kernel SourcesRodney W. Grimes1994-05-241-0/+269
Notes: svn path=/head/; revision=1541