summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient
Commit message (Collapse)AuthorAgeFilesLines
* I believe that the following fix to nfs_vnops.c should do the trick w.r.t.dfr1995-07-131-10/+8
| | | | | | | | | | | | | | | the problem "when a file is truncated on the server after being written on a client under NFSv3, the client doesn't see the size drop to zero". (As you noted, the problem is that NMODIFIED wasn't being cleared by nfs_close when it flushed the buffers. After checking through the code, the only place where NMODIFIED was used to test for the possibility of dirty blocks was in nfs_setattr(). The two cases are safe to do when there aren't dirty blocks, so I just took out the tests. Unfortunately, testing for v_dirtyblkhd.lh_first being non-null is not sufficient, since there are times when the code moves blocks to the clean list and then back to the dirty list.) Submitted by: rick@snowhite.cis.uoguelph.ca
* NOTE: libkvm, w, ps, 'top', and any other utility which depends on structdg1995-07-132-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | proc or any VM system structure will have to be rebuilt!!! Much needed overhaul of the VM system. Included in this first round of changes: 1) Improved pager interfaces: init, alloc, dealloc, getpages, putpages, haspage, and sync operations are supported. The haspage interface now provides information about clusterability. All pager routines now take struct vm_object's instead of "pagers". 2) Improved data structures. In the previous paradigm, there is constant confusion caused by pagers being both a data structure ("allocate a pager") and a collection of routines. The idea of a pager structure has escentially been eliminated. Objects now have types, and this type is used to index the appropriate pager. In most cases, items in the pager structure were duplicated in the object data structure and thus were unnecessary. In the few cases that remained, a un_pager structure union was created in the object to contain these items. 3) Because of the cleanup of #1 & #2, a lot of unnecessary layering can now be removed. For instance, vm_object_enter(), vm_object_lookup(), vm_object_remove(), and the associated object hash list were some of the things that were removed. 4) simple_lock's removed. Discussion with several people reveals that the SMP locking primitives used in the VM system aren't likely the mechanism that we'll be adopting. Even if it were, the locking that was in the code was very inadequate and would have to be mostly re-done anyway. The locking in a uni-processor kernel was a no-op but went a long way toward making the code difficult to read and debug. 5) Places that attempted to kludge-up the fact that we don't have kernel thread support have been fixed to reflect the reality that we are really dealing with processes, not threads. The VM system didn't have complete thread support, so the comments and mis-named routines were just wrong. We now use tsleep and wakeup directly in the lock routines, for instance. 6) Where appropriate, the pagers have been improved, especially in the pager_alloc routines. Most of the pager_allocs have been rewritten and are now faster and easier to maintain. 7) The pagedaemon pageout clustering algorithm has been rewritten and now tries harder to output an even number of pages before and after the requested page. This is sort of the reverse of the ideal pagein algorithm and should provide better overall performance. 8) Unnecessary (incorrect) casts to caddr_t in calls to tsleep & wakeup have been removed. Some other unnecessary casts have also been removed. 9) Some almost useless debugging code removed. 10) Terminology of shadow objects vs. backing objects straightened out. The fact that the vm_object data structure escentially had this backwards really confused things. The use of "shadow" and "backing object" throughout the code is now internally consistent and correct in the Mach terminology. 11) Several minor bug fixes, including one in the vm daemon that caused 0 RSS objects to not get purged as intended. 12) A "default pager" has now been created which cleans up the transition of objects to the "swap" type. The previous checks throughout the code for swp->pg_data != NULL were really ugly. This change also provides the rudiments for future backing of "anonymous" memory by something other than the swap pager (via the vnode pager, for example), and it allows the decision about which of these pagers to use to be made dynamically (although will need some additional decision code to do this, of course). 13) (dyson) MAP_COPY has been deprecated and the corresponding "copy object" code has been removed. MAP_COPY was undocumented and non- standard. It was furthermore broken in several ways which caused its behavior to degrade to MAP_PRIVATE. Binaries that use MAP_COPY will continue to work correctly, but via the slightly different semantics of MAP_PRIVATE. 14) (dyson) Sharing maps have been removed. It's marginal usefulness in a threads design can be worked around in other ways. Both #12 and #13 were done to simplify the code and improve readability and maintain- ability. (As were most all of these changes) TODO: 1) Rewrite most of the vnode pager to use VOP_GETPAGES/PUTPAGES. Doing this will reduce the vnode pager to a mere fraction of its current size. 2) Rewrite vm_fault and the swap/vnode pagers to use the clustering information provided by the new haspage pager interface. This will substantially reduce the overhead by eliminating a large number of VOP_BMAP() calls. The VOP_BMAP() filesystem interface should be improved to provide both a "behind" and "ahead" indication of contiguousness. 3) Implement the extended features of pager_haspage in swap_pager_haspage(). It currently just says 0 pages ahead/behind. 4) Re-implement the swap device (swstrategy) in a more elegant way, perhaps via a much more general mechanism that could also be used for disk striping of regular filesystems. 5) Do something to improve the architecture of vm_object_collapse(). The fact that it makes calls into the swap pager and knows too much about how the swap pager operates really bothers me. It also doesn't allow for collapsing of non-swap pager objects ("unnamed" objects backed by other pagers).
* Moved call to VOP_GETATTR() out of vnode_pager_alloc() and into the placesdg1995-07-091-3/+10
| | | | | | that call vnode_pager_alloc() so that a failure return can be dealt with. This fixes a panic seen on NFS clients when a file being opened is deleted on the server before the open completes.
* Use a consistent blocksize for sizing bufs to avoid panicing the bio system.dfr1995-07-072-7/+23
|
* Use the correct cred for nfs_commit operations.dfr1995-06-281-2/+31
|
* 1) Converted v_vmdata to v_object.dg1995-06-281-25/+21
| | | | | | | 2) Removed unnecessary vm_object_lookup()/pager_cache(object, TRUE) pairs after vnode_pager_alloc() calls - the object is already guaranteed to be persistent. 3) Removed some gratuitous casts.
* Fixed VOP_LINK argument order botch.dg1995-06-281-2/+2
|
* Changes to support version 3 of the NFS protocol.dfr1995-06-2714-1782/+4661
| | | | | | | | | | | | | | | | | | 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>
* The duplicate information returned in fa_type and fa_modejoerg1995-06-141-2/+21
| | | | | | | | | | | | | | | | | | | | | | | is an ambiguity in the NFS version 2 protocol. VREG should be taken literally as a regular file. If a server intents to return some type information differently in the upper bits of the mode field (e.g. for sockets, or FIFOs), NFSv2 mandates fa_type to be VNON. Anyway, we leave the examination of the mode bits even in the VREG case to avoid breakage for bogus servers, but we make sure that there are actually type bits set in the upper part of fa_mode (and failing that, trust the va_type field). NFSv3 cleared the issue, and requires fa_mode to not contain any type information (while also introduing sockets and FIFOs for fa_type). The fix has been tested against a variety of NFS servers. It fixes problems with the ``Tropic'' NFS server for Windows, while apparently not breaking anything. Pointed-out by: scott@zorch.sf-bay.org (Scott Hazen Mueller)
* Merge RELENG_2_0_5 into HEADrgrimes1995-06-111-2/+9
|
* Remove trailing whitespace.rgrimes1995-05-307-29/+29
|
* Fixed some serious bugs that resulted in object reference counts not beingdg1995-05-291-2/+4
| | | | | | | | handled correctly. This would manifest itself as "object deallocated too many times" panics and perhaps other strange inconsistencies on NFS servers. Reviewed by: me, of course Submitted by: John Dyson
* Changes to fix the following bugs:dg1995-05-211-34/+64
| | | | | | | | | | | | | | | 1) Files weren't properly synced on filesystems other than UFS. In some cases, this lead to lost data. Most likely would be noticed on NFS. The fix is to make the VM page sync/object_clean general rather than in each filesystem. 2) Mixing regular and mmaped file I/O on NFS was very broken. It caused chunks of files to end up as zeroes rather than the intended contents. The fix was to fix several race conditions and to kludge up the "b_dirtyoff" and "b_dirtyend" that NFS relies upon - paying attention to page modifications that occurred via the mmapping. Reviewed by: David Greenman Submitted by: John Dyson
* Changed swap partition handling/allocation so that it doesn'tdg1995-05-141-20/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | require specific partitions be mentioned in the kernel config file ("swap on foo" is now obsolete). From Poul-Henning: The visible effect is this: As default, unless options "NSWAPDEV=23" is in your config, you will have four swap-devices. You can swapon(2) any block device you feel like, it doesn't have to be in the kernel config. There is a performance/resource win available by getting the NSWAPDEV right (but only if you have just one swap-device ??), but using that as default would be too restrictive. The invisible effect is that: Swap-handling disappears from the $arch part of the kernel. It gets a lot simpler (-145 lines) and cleaner. Reviewed by: John Dyson, David Greenman Submitted by: Poul-Henning Kamp, with minor changes by me.
* Slight re-ordering of the creation of a vmio object to fix a conditiondyson1995-04-211-2/+4
| | | | that can cause NFS I/O failures.
* Various fixes from John Dyson:dg1995-04-161-39/+19
| | | | | | | | 1) Rewrote screwy code that uses an incore buffer without making it busy. 2) Use B_CACHE instead of B_DONE in cases where it is appropriate. 3) Minor code optimization. This *might* fix kern/345 submitted by Heikki Suonsivu.
* Deleted bogus DIAGNOSTIC "nfs_fsync: dirty" message. This can and doesdg1995-03-231-4/+1
| | | | | | happen normally when there is heavy write activity to a file since the vnode isn't locked (NFS plays fast and loose with vnode locks). This change "fixes" PR#267.
* Add four more filesystem flags:wollman1995-03-161-2/+2
| | | | | | | | | | VFCF_NETWORK (this FS goes over the net) VFCF_READONLY (read-write mounts do not make any sense) VFCF_SYNTHETIC (data in this FS is not real) VFCF_LOOPBACK (this FS aliases something else) cd9660 is readonly; nullfs, umapfs, and union are loopback; NFS is netowkr; procfs, kernfs, and fdesc are synthetic.
* Add and move declarations to fix all of the warnings from `gcc -Wimplicit'bde1995-03-166-17/+12
| | | | | | (except in netccitt, netiso and netns) and most of the warnings from `gcc -Wnested-externs'. Fix all the bugs found. There were no serious ones.
* Removed obsolete vtrace() remnants.dg1995-03-041-2/+1
|
* YF fix.phk1995-02-151-3/+4
|
* Fixed two more bugs related to the merged cache changes.dg1995-02-151-2/+2
| | | | Submitted by: John Dyson
* YFfixphk1995-02-143-3/+15
| | | | | | +int nfsrv_vput __P(( struct vnode * )); +int nfsrv_vrele __P(( struct vnode * )); +int nfsrv_vmio __P(( struct vnode * ));
* Changed order of release of vnode/object to fix a problem where the vnodedg1995-02-061-4/+7
| | | | | | | is freed with an old object still attached (subsequently causing a panic). Fixes NFS server panic "object/pager mismatch". Submitted by: John Dyson
* Fixed bmap run-length brokeness.dg1995-02-031-1/+3
| | | | | | Use bmap run-length extension when doing clustered paging. Submitted by: John Dyson
* Removed a pile of vfs_unbusy_pages()...both unnecessary and wrong - resulteddg1995-02-031-6/+3
| | | | | | | in serious system instability. Changed a B_INVAL to a B_NOCACHE so that buffer data is properly disposed of. Submitted by: John Dyson, Rick Macklin, and ohki@gssm.otsuka.tsukuba.ac.jp
* Added two missing brelse() calls.dg1995-01-101-1/+5
| | | | Submitted by: rick@snowhite.cis.uoguelph.ca
* These changes embody the support of the fully coherent merged VM buffer cache,dg1995-01-093-20/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | much higher filesystem I/O performance, and much better paging performance. It represents the culmination of over 6 months of R&D. The majority of the merged VM/cache work is by John Dyson. The following highlights the most significant changes. Additionally, there are (mostly minor) changes to the various filesystem modules (nfs, msdosfs, etc) to support the new VM/buffer scheme. vfs_bio.c: Significant rewrite of most of vfs_bio to support the merged VM buffer cache scheme. The scheme is almost fully compatible with the old filesystem interface. Significant improvement in the number of opportunities for write clustering. vfs_cluster.c, vfs_subr.c Upgrade and performance enhancements in vfs layer code to support merged VM/buffer cache. Fixup of vfs_cluster to eliminate the bogus pagemove stuff. vm_object.c: Yet more improvements in the collapse code. Elimination of some windows that can cause list corruption. vm_pageout.c: Fixed it, it really works better now. Somehow in 2.0, some "enhancements" broke the code. This code has been reworked from the ground-up. vm_fault.c, vm_page.c, pmap.c, vm_object.c Support for small-block filesystems with merged VM/buffer cache scheme. pmap.c vm_map.c Dynamic kernel VM size, now we dont have to pre-allocate excessive numbers of kernel PTs. vm_glue.c Much simpler and more effective swapping code. No more gratuitous swapping. proc.h Fixed the problem that the p_lock flag was not being cleared on a fork. swap_pager.c, vnode_pager.c Removal of old vfs_bio cruft to support the past pseudo-coherency. Now the code doesn't need it anymore. machdep.c Changes to better support the parameter values for the merged VM/buffer cache scheme. machdep.c, kern_exec.c, vm_glue.c Implemented a seperate submap for temporary exec string space and another one to contain process upages. This eliminates all map fragmentation problems that previously existed. ffs_inode.c, ufs_inode.c, ufs_readwrite.c Changes for merged VM/buffer cache. Add "bypass" support for sneaking in on busy buffers. Submitted by: John Dyson and David Greenman
* From Gene Stark:jkh1995-01-031-1/+7
| | | | | | | | | If nd->swap_nblks is zero in nfs_mountroot(), then the system comes up without initializing swapdev_vp to an actual vnode pointer. The swap pager assumes a non-NULL value for swapdev_vp. The fix is to try initializing local swap if no NFS swap space is specified.
* Would you please correct nfs/nfs_vfsops.c so that the ip address of thephk1994-12-081-2/+2
| | | | | | | | root filesystem is printed out correctly? It's line 299 in nfs/nfs_vfsops.c. Reviewed by: phk Submitted by: Luigi Rizzo luigi@iet.unipi.it
* Forward-declare a few structures to avoid warning messages.wollman1994-11-023-3/+12
|
* Implement fs.nfs MIB variables.wollman1994-10-234-7/+86
|
* This is where the action is. I'm still not sure that swap is 100% OK, butphk1994-10-221-38/+56
| | | | it seems to work.
* This is a bunch of changes from NetBSD. There are a couple of bug-fixes.phk1994-10-1713-280/+305
| | | | | | | But mostly it is changes to use the list-maintenance macros instead of doing the pointer-gymnastics by hand. Obtained from: NetBSD
* Got rid of map.h. It's a leftover from the rmap code, and we use rlists.dg1994-10-091-2/+1
| | | | Changed swapmap into swaplist.
* Use tsleep() rather than sleep so that 'ps' is more informative aboutdg1994-10-061-2/+2
| | | | the wait.
* Prototyping and general gcc-shutting up. Gcc has one warning now which looksphk1994-10-0212-128/+387
| | | | bad, I will get to it eventually, unless somebody beats me to it.
* Make NFS loadable.wollman1994-09-221-0/+25
|
* More loadable VFS changes:wollman1994-09-223-19/+3
| | | | | | | | - Make a number of filesystems work again when they are statically compiled (blush) - FIFOs are no longer optional; ``options FIFO'' removed from distributed config files.
* Implemented loadable VFS modules, and made most existing filesystemswollman1994-09-212-2/+6
| | | | loadable. (NFS is a notable exception.)
* "bogus" fixes from 1.1.5 to work around some cache coherency problems.dg1994-08-291-12/+8
|
* More idempotency....... this is fun :-)paul1994-08-217-7/+41
|
* Implemented filesystem clean bit via:dg1994-08-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | machdep.c: Changed printf's a little and call vfs_unmountall() if the sync was successful. cd9660_vfsops.c, ffs_vfsops.c, nfs_vfsops.c, lfs_vfsops.c: Allow dismount of root FS. It is now disallowed at a higher level. vfs_conf.c: Removed unused rootfs global. vfs_subr.c: Added new routines vfs_unmountall and vfs_unmountroot. Filesystems are now dismounted if the machine is properly rebooted. ffs_vfsops.c: Toggle clean bit at the appropriate places. Print warning if an unclean FS is mounted. ffs_vfsops.c, lfs_vfsops.c: Fix bug in selecting proper flags for VOP_CLOSE(). vfs_syscalls.c: Disallow dismounting root FS via umount syscall.
* Fix up some sloppy coding practices:wollman1994-08-181-2/+2
| | | | | | | | | | | | - Delete redundant declarations. - Add -Wredundant-declarations to Makefile.i386 so they don't come back. - Delete sloppy COMMON-style declarations of uninitialized data in header files. - Add a few prototypes. - Clean up warnings resulting from the above. NB: ioconf.c will still generate a redundant-declaration warning, which is unavoidable unless somebody volunteers to make `config' smarter.
* Initialize lockf pointer. I missed this when I made NFS use the genericdg1994-08-101-1/+2
| | | | advlock mechanism, and not doing so results in random system crashes.
* Removed some padding bytes from the nfsnode struct to make the structuredg1994-08-091-2/+1
| | | | | size a power of 2 again. The system complains otherwise - probably because it wastes space with our malloc scheme otherwise.
* Made lockf advisory locking code generic (rather than ufs specific), anddg1994-08-082-3/+11
| | | | | | | use it in NFS. This is required both for diskless support and for POSIX compliance. Note: the support in NFS is only for the local node. Submitted by: based on work originally done by Yuval Yurom
* Changed B_AGE policy to work correctly in a world with relatively largedg1994-08-081-3/+1
| | | | buffer caches. The old policy generally ended up caching nothing.
* Converted 'vmunix' to 'kernel'.dg1994-08-051-2/+2
|
* Made NFS attribute cache timeouts kernel config file tunable viadg1994-08-043-3/+15
| | | | NFS_MINATTRTIMO and NFS_MAXATTRTIMO.
OpenPOWER on IntegriCloud