summaryrefslogtreecommitdiffstats
path: root/sys/nfs/nfs_subs.c
Commit message (Collapse)AuthorAgeFilesLines
* The alpha build cuases the 'nfsuid bloated' warning to occur. Well,dillon2000-01-131-11/+0
| | | | | | | | there is nothing we can do about it. In fact, after further review there simply are not very many instances of the two structures NFS checks for 'bloat' so I've decided to simply rip the checks out entirely. Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
* make getfh a standard syscall instead of dependant on havingalfred1999-12-211-14/+0
| | | | | | | | NFSSERVER defined, useful for userland fileservers that want to use a filehandle type interface to the filesystem. Submitted by: Assar Westerlund assar@stacken.kth.se PR: kern/15452
* Fix a number of server-side issues related to aborting badly formeddillon1999-12-121-0/+3
| | | | | | | | NFS packets, mainly initializing structure pointers to NULL which are conditionally freed prior to return. PR: kern/15249 Submitted by: Ian Dowse <iedowse@maths.tcd.ie>
* Synopsis of problem being fixed: Dan Nelson originally reported thatdillon1999-12-121-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | blocks of zeros could wind up in a file written to over NFS by a client. The problem only occurs a few times per several gigabytes of data. This problem turned out to be bug #3 below. bug #1: B_CLUSTEROK must be cleared when an NFS buffer is reverted from stage 2 (ready for commit rpc) to stage 1 (ready for write). Reversions can occur when a dirty NFS buffer is redirtied with new data. Otherwise the VFS/BIO system may end up thinking that a stage 1 NFS buffer is clusterable. Stage 1 NFS buffers are not clusterable. bug #2: B_CLUSTEROK was inappropriately set for a 'short' NFS buffer (short buffers only occur near the EOF of the file). Change to only set when the buffer is a full biosize (usually 8K). This bug has no effect but should be fixed in -current anyway. It need not be backported. bug #3: B_NEEDCOMMIT was inappropriately set in nfs_flush() (which is typically only called by the update daemon). nfs_flush() does a multi-pass loop but due to the lack of vnode locking it is possible for new buffers to be added to the dirtyblkhd list while a flush operation is going on. This may result in nfs_flush() setting B_NEEDCOMMIT on a buffer which has *NOT* yet gone through its stage 1 write, causing only the commit rpc to be made and thus causing the contents of the buffer to be thrown away (never sent to the server). The patch also contains some cleanup, which only applies to the commit into -current. Reviewed by: dg, julian Originally Reported by: Dan Nelson <dnelson@emsphone.com>
* Before we start to mess with the VFS name-cache clean things up a little bit:phk1999-10-031-2/+0
| | | | Isolate the namecache in its own file, and give it a dedicated malloc type.
* Seperate the export check in VFS_FHTOVP, exports are now checked viaalfred1999-09-111-1/+4
| | | | | | | | | VFS_CHECKEXP. Add fh(open|stat|stafs) syscalls to allow userland to query filesystems based on (network) filehandle. Obtained from: NetBSD
* remove unused variables.phk1999-08-281-1/+0
|
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Simplify the handling of VCHR and VBLK vnodes using the new dev_t:phk1999-08-261-21/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Make the alias list a SLIST. Drop the "fast recycling" optimization of vnodes (including the returning of a prexisting but stale vnode from checkalias). It doesn't buy us anything now that we don't hardlimit vnodes anymore. Rename checkalias2() and checkalias() to addalias() and addaliasu() - which takes dev_t and udev_t arg respectively. Make the revoke syscalls use vcount() instead of VALIASED. Remove VALIASED flag, we don't need it now and it is faster to traverse the much shorter lists than to maintain the flag. vfs_mountedon() can check the dev_t directly, all the vnodes point to the same one. Print the devicename in specfs/vprint(). Remove a couple of stale LFS vnode flags. Remove unimplemented/unused LK_DRAINED;
* Decommision miscfs/specfs/specdev.h. Most of it goes into <sys/conf.h>,phk1999-08-081-3/+2
| | | | | | a few lines into <sys/vnode.h>. Add a few fields to struct specinfo, paving the way for the fun part.
* I have not one single time remembered the name of this function correctlyphk1999-07-171-2/+2
| | | | so obviously I gave it the wrong name. s/umakedev/makeudev/g
* Minor tweaks to make sure (new) prerequisites for <sys/buf.h> (mostlypeter1999-06-271-3/+3
| | | | splbio()/splx()) are #included in time.
* Convert buffer locking from using the B_BUSY and B_WANTED flags to usingmckusick1999-06-261-2/+3
| | | | | | | lockmgr locks. This commit should be functionally equivalent to the old semantics. That is, all buffer locking is done with LK_EXCLUSIVE requests. Changes to take advantage of LK_SHARED and LK_RECURSIVE will be done in future commits.
* Matt's NFS fixes.julian1999-06-231-36/+89
| | | | | | Submitted by: Matt Dillon Reviewed by: David Cross, Julian Elischer, Mike Smith, Drew Gallatin 3.2 version to follow when tested
* Various changes lifted from the OpenBSD cvs tree:peter1999-06-051-7/+7
| | | | | | | | | | | | | | | 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
* Divorce "dev_t" from the "major|minor" bitmap, which is now calledphk1999-05-111-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | udev_t in the kernel but still called dev_t in userland. Provide functions to manipulate both types: major() umajor() minor() uminor() makedev() umakedev() dev2udev() udev2dev() For now they're functions, they will become in-line functions after one of the next two steps in this process. Return major/minor/makedev to macro-hood for userland. Register a name in cdevsw[] for the "filedescriptor" driver. In the kernel the udev_t appears in places where we have the major/minor number combination, (ie: a potential device: we may not have the driver nor the device), like in inodes, vattr, cdevsw registration and so on, whereas the dev_t appears where we carry around a reference to a actual device. In the future the cdevsw and the aliased-from vnode will be hung directly from the dev_t, along with up to two softc pointers for the device driver and a few houskeeping bits. This will essentially replace the current "alias" check code (same buck, bigger bang). A little stunt has been provided to try to catch places where the wrong type is being used (dev_t vs udev_t), if you see something not working, #undef DEVT_FASCIST in kern/kern_conf.c and see if it makes a difference. If it does, please try to track it down (many hands make light work) or at least try to reproduce it as simply as possible, and describe how to do that. Without DEVT_FASCIST I belive this patch is a no-op. Stylistic/posixoid comments about the userland view of the <sys/*.h> files welcome now, from userland they now contain the end result. Next planned step: make all dev_t's refer to the same devsw[] which means convert BLK's to CHR's at the perimeter of the vnodes and other places where they enter the game (bootdev, mknod, sysctl).
* Fixed bitrot in NFS_ACDEBUG option.bde1999-02-171-1/+2
|
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-271-3/+3
| | | | kernel compile
* This is a rather large commit that encompasses the new swapper,dillon1999-01-211-1/+4
| | | | | | | | | | changes to the VM system to support the new swapper, VM bug fixes, several VM optimizations, and some additional revamping of the VM code. The specific bug fixes will be documented with additional forced commits. This commit is somewhat rough in regards to code cleanup issues. Reviewed by: "John S. Dyson" <root@dyson.iquest.net>, "David Greenman" <dg@root.com>
* Remove the 'waslocked' parameter to vfs_object_create().eivind1999-01-051-2/+2
|
* Added 3 new errno values, requred by various standards: EOVERFLOW,dt1998-12-141-2/+3
| | | | | | | ECANCELED, EILSEQ. Fixed ibcs2 and especially linux EIDRM and ENOMSG errno mapping. Reviewed by: Dan Nelson <dnelson@emsphone.com>
* The "easy" fixes for compiling the kernel -Wunused: remove unreferenced staticarchie1998-12-071-2/+1
| | | | and local variables, goto labels, and functions declared but not defined.
* Remove [apparently] bogus casts to u_long for the vnode_pager_setsize()peter1998-11-091-3/+3
| | | | | | | second argument. np_size is a 64 bit int, so is the second arg. This might have caused needless 2G/4G file size problems. I believe it was Bruce who queried this.
* Use TAILQ macros for clean/dirty block list processing. Set b_xflagspeter1998-10-311-3/+3
| | | | rather than abusing the list next pointer with a magic number.
* Made unloading of the nfs LKM sort of work. This is mainly to testbde1998-09-071-3/+36
| | | | | | detachment of vfs sysctls. Unloading of vfs LKMs doesn't actually work for any vfs, since it leaves garbage pointers to memory allocation control structures.
* Instantiate `nfs_mount_type' in a standard file so that it is presentbde1998-09-051-2/+1
| | | | | | | | when nfs is an LKM. Declare it in a header file. Don't forget to use it in non-Lite2 code. Initialize it to -1 instead of to 0, since 0 will soon be the mount type number for the first vfs loaded. NetBSD uses strcmp() to avoid this ugly global.
* Fixed typo in ifdefed code. (NFS_ACDEBUG is not in LINT. Therefore,bde1998-06-211-2/+2
| | | | code controlled by it did not even compile.)
* Avoid an egcs pessimization for 64-bit signed division on i386's.bde1998-06-141-4/+4
| | | | | | | | | Pre-2.8 versions of gcc generate a call to __divdi3() for all 64-bit signed divisions, but egcs optimizes them to a shift and fixup when the divisor is a constant power of 2. Unfortunately, it generates a call to __cmpdi2() for the fixup, although all except possibly ancient versions of gcc and egcs do ordinary 64-bit comparisons inline.
* For the on-the-wire protocol, u_long -> u_int32_t; long -> int32_t;peter1998-05-311-32/+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
* Prototype support for selectively allowing non-reserved ports on a perpeter1998-05-311-1/+14
| | | | | | export basis. Needs userland support yet. Obtained from: NetBSD
* #ifdef a diagnostic panic, plus another missed costmetic change.peter1998-05-311-2/+4
| | | | Obtained from: NetBSD
* We have gained 2 more errno's, add them to the NFSv2 mapping table.peter1998-05-311-2/+2
|
* Some const'speter1998-05-311-2/+2
| | | | Obtained from: NetBSD
* NFS Jumbo commit part 1. Cosmetic and structural changes only. The aimpeter1998-05-311-2/+43
| | | | | | 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.
* Convert a couple of large allocations to use zones rather than mallocpeter1998-05-241-9/+3
| | | | | | for better packing. This means that we can choose better values for the various hash entries without having to try and get it all to fit within an artificial power of two limit for malloc's sake.
* Allow control of the attribute cache timeouts at mount time.peter1998-05-191-4/+45
| | | | | | We had run out of bits in the nfs mount flags, I have moved the internal state flags into a seperate variable. These are no longer visible via statfs(), but I don't know of anything that looks at them.
* Use random() to find our initial xid.phk1998-04-061-11/+4
|
* Eradicate the variable "time" from the kernel, using various measures.phk1998-03-301-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "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
* Back out DIAGNOSTIC changes.eivind1998-02-061-4/+1
|
* Turn DIAGNOSTIC into a new-style option.eivind1998-02-041-1/+4
|
* Unspammed nested include of <vm/vm_zone.h>.bde1997-12-271-1/+2
|
* Added a used include.bde1997-12-201-6/+9
| | | | Fixed a gratuitous ANSIism and nearby KNF violations.
* Remove a bunch of variables which were unused both in GENERIC and LINT.phk1997-11-071-2/+1
| | | | Found by: -Wunused
* Removed unused #includes.bde1997-10-281-4/+1
|
* Don't #include <nfs/nfs.h> in <nfs/nfs_node.h> if KERNEL is defined.bde1997-10-281-2/+2
| | | | Fixed everything that depended on the nested include.
* Always initialize the syscall vectors for our "private" syscalls (notphk1997-10-261-10/+4
| | | | | just in the LKM case). Plug nqnfs_vop_lease_check directly into the default_vnodeop_p table.
* Change the M_NAMEI allocations to use the zone allocator. This changedyson1997-09-211-10/+11
| | | | | | | | plus the previous changes to use the zone allocator decrease the useage of malloc by half. The Zone allocator will be upgradeable to be able to use per CPU-pools, and has more intelligent usage of SPLs. Additionally, it has reasonable stats gathering capabilities, while making most calls inline.
* unifdef -U__NetBSD__ -D__FreeBSD__phk1997-09-101-9/+1
|
* Fix all areas of the system (or at least all those in LINT) to avoid storingwollman1997-08-161-7/+7
| | | | | | | | socket addresses in mbufs. (Socket buffers are the one exception.) A number of kernel APIs needed to get fixed in order to make this happen. Also, fix three protocol families which kept PCBs in mbufs to not malloc them instead. Delete some old compatibility cruft while we're at it, and add some new routines in the in_cksum family.
* Correct some dumb mistakes in the WebNFS stuff.dfr1997-07-221-8/+16
| | | | Submitted by: bde
OpenPOWER on IntegriCloud