summaryrefslogtreecommitdiffstats
path: root/sys/ufs/ffs
Commit message (Collapse)AuthorAgeFilesLines
* Fix compiler warnings.phk1995-11-201-3/+3
|
* General fixes to the vfs clustring code:dyson1995-11-191-1/+5
| | | | | | | | | | | | | 1) Make cluster buffer list be a non-malloced chain. This eliminates yet another 'evil' M_WAITOK and generally cleans up the code. 2) Fix write clustering for ext2fs. It was just broken. Also, ffs clustering had an efficiency problem that more bawrites were happening than should have been. 3) Make changes to buf.h to support the above, plus remove b_pfcent at the request of David Greenman. Note that the reallocblocks code is disabled pending rewrite for the cluster buffer list changes.
* Get rid of the last debug sysctl variables of the old style.phk1995-11-142-5/+5
|
* Introduced a type `vop_t' for vnode operation functions and usedbde1995-11-092-139/+139
| | | | | | | | | | | | | | | it 1138 times (:-() in casts and a few more times in declarations. This change is null for the i386. The type has to be `typedef int vop_t(void *)' and not `typedef int vop_t()' because `gcc -Wstrict-prototypes' warns about the latter. Since vnode op functions are called with args of different (struct pointer) types, neither of these function types is any use for type checking of the arg, so it would be preferable not to use the complete function type, especially since using the complete type requires adding 1138 casts to avoid compiler warnings and another 40+ casts to reverse the function pointer conversions before calling the functions.
* Make MNT_ASYNC more effective for UFS. It should not be too much moredyson1995-11-051-1/+5
| | | | | | | dangerous than the original MNT_ASYNC. There might be some minor security considerations due to data writes not being posted as promptly as before. Meta-data operations are still not quite as fast as Linux, but streaming I/O is still higher.
* Finalize GETPAGES layering scheme. Move the device GETPAGESdyson1995-10-231-1/+2
| | | | | interface into specfs code. No need at this point to modify the PUTPAGES stuff except in the layered-type (NULL/UNION) filesystems.
* Re-enable read clustering.dyson1995-09-251-3/+3
|
* Shit! I changed the wrong doclusterread! ...Thanks to Steven Wallace anddg1995-09-221-2/+2
| | | | Poul-Henning for convincing me that I should look at my mistake! :-)
* Disable file read clustering until the bug(s) in vfs_cluster.c are fixed.dg1995-09-221-2/+2
| | | | | This should temporarily fix the sig 10/11 problems that people have been having for the past 3 weeks.
* Slight optimization for the standard case of rotdelay=0.dg1995-09-081-11/+11
|
* Added indirect pointer for ffs_getpages, and added external declaration.dyson1995-09-062-2/+4
|
* Added VOP_GETPAGES/VOP_PUTPAGES and also the "backwards" block countdyson1995-09-041-2/+2
| | | | for VOP_BMAP. Updated affected filesystems...
* Reviewed by: julian with quick glances by bruce and othersjulian1995-08-281-111/+213
| | | | | | | | | | | | | | | | | | | | | | Submitted by: terry (terry lambert) This is a composite of 3 patch sets submitted by terry. they are: New low-level init code that supports loadbal modules better some cleanups in the namei code to help terry in 16-bit character support some changes to the mount-root code to make it a little more modular.. NOTE: mounting root off cdrom or NFS MIGHT be broken as I haven't been able to test those cases.. certainly mounting root of disk still works just fine.. mfs should work but is untested. (tomorrows task) The low level init stuff includes a total rewrite of init_main.c to make it possible for new modules to have an init phase by simply adding an entry to a TEXT_SET (or is it DATA_SET) list. thus a new module can be added to the kernel without editing any other files other than the 'files' file.
* Don't call VOP_UPDATE() with volatile timestamps.bde1995-08-251-3/+6
|
* Honor -async mount option when doing the inode update.dg1995-08-161-2/+2
| | | | Obtained from: 4.4BSD-Lite2
* Converted mountlist to a CIRCLEQ.dg1995-08-111-2/+2
| | | | Partially obtained from: 4.4BSD-Lite2
* Use bdwrite() rather than brelse(). The cylinder group bitmap modificationdg1995-08-071-2/+2
| | | | | | | | is not preserved otherwise. Note that this is a no-op in FreeBSD, however, as we have doreallocblks disabled. Submitted by: Kirk McKusick
* Removed redundant call to vm_object_page_clean - this is already donedg1995-08-061-6/+1
| | | | in vfs_msync().
* Use the correct flags (IO_SYNC -> B_SYNC) when deciding to do a sync ordg1995-08-041-3/+3
| | | | | | | async write in the section that changes the filesize. The bug resulted in the updates always being async. Obtained from: 4.4BSD-Lite2
* Since ufs_ihashget can block, the lock must be checked for each timedg1995-07-211-14/+8
| | | | | | | the function returns. Also, moved lock into .bss and made minor cosmetic changes. Submitted by: Bruce Evans
* Implement a lock in ffs_vget to prevent a race condition where two processesdg1995-07-211-4/+34
| | | | | | try allocate the same inode/vnode, causing a duplicate. Submitted by: Matt Dillon, slightly reworked by me.
* NOTE: libkvm, w, ps, 'top', and any other utility which depends on structdg1995-07-131-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* 1) Converted v_vmdata to v_object.dg1995-06-281-4/+4
| | | | | | | 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.
* Remove trailing whitespace.rgrimes1995-05-307-36/+36
|
* Kill bogus vnode_pager_setsize(). It was being called at the wrong timedg1995-05-281-2/+1
| | | | | | | and resulted in the object size being too small. This caused bad things to happen later when the file was mapped. Reviewed by: John Dyson
* Changes to fix the following bugs:dg1995-05-211-9/+1
| | | | | | | | | | | | | | | 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
* NFS diskless operation was broken because swapdev_vp wasn't initialized.dg1995-05-191-4/+4
| | | | | | | These changes solve the problem in a general way by moving the initialization out of the individual fs_mountroot's and into swaponvp(). Submitted by: Poul-Henning Kamp
* Fixed incompleteness that would allow dirty filesystems to get mounteddg1995-05-151-5/+21
| | | | | | | | | when the single user shell was terminated. These changes disallow mounting or R/W upgrading filesystems that are dirty unless "-f" (force) option is used with mount. /etc/rc has been modified to abort the startup if one or more non-nfs partitions fail to mount. Reviewed by: Poul-Henning Kamp, Rod Grimes
* Fix -Wformat warnings from LINT kernel.rgrimes1995-05-111-3/+5
|
* Limit filesize to the amount that the VM system can currently handledyson1995-05-011-1/+16
| | | | | | (2GB). If this limit is not imposed, then filesystem corruption will ensue when files larger than 2GB are created. This is temporary, and the underlying limitation will be removed later.
* Handle the "syncing VCHR vnode hang" problem a little differently; justdg1995-04-111-8/+14
| | | | | | | don't lock the vnode - it doesn't appear to ever be necessary for VCHR vnode/inodes. This fixes a bug introduced in the previous commit that caused tty timestamps to act strange (causing 'w' and 'finger' to show the tty wasn't idle when it may have been for hours).
* Changes from John Dyson and myself:dg1995-04-093-15/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed remaining known bugs in the buffer IO and VM system. vfs_bio.c: Fixed some race conditions and locking bugs. Improved performance by removing some (now) unnecessary code and fixing some broken logic. Fixed process accounting of # of FS outputs. Properly handle NFS interrupts (B_EINTR). (various) Replaced calls to clrbuf() with calls to an optimized routine called vfs_bio_clrbuf(). (various FS sync) Sync out modified vnode_pager backed pages. ffs_vnops.c: Do two passes: Sync out file data first, then indirect blocks. vm_fault.c: Fixed deadly embrace caused by acquiring locks in the wrong order. vnode_pager.c: Changed to use buffer I/O system for writing out modified pages. This should fix the problem with the modification date previous not getting updated. Also dramatically simplifies the code. Note that this is going to change in the future and be implemented via VOP_PUTPAGES(). vm_object.c: Fixed a pile of bugs related to cleaning (vnode) objects. The performance of vm_object_page_clean() is terrible when dealing with huge objects, but this will change when we implement a binary tree to keep the object pages sorted. vm_pageout.c: Fixed broken clustering of pageouts. Fixed race conditions and other lockup style bugs in the scanning of pages. Improved performance.
* Add and move declarations to fix all of the warnings from `gcc -Wimplicit'bde1995-03-282-3/+3
| | | | | (except in netccitt, netiso and netns) that I didn't notice when I fixed "all" such warnings before.
* Removed third arg (vmio) to allocbuf() that was added with the originaldg1995-03-262-5/+5
| | | | | | | | merged cache changes, and figure it out based on the B_VMIO buffer flag. Fixes a problem where delayed write VMIO buffers would sometimes get recopied into kernel-alloced memory. Submitted by: John Dyson
* Removed redundant newlines that were in some panic strings.dg1995-03-192-6/+6
|
* Don't sync the inode date changes of character special devicesdg1995-03-181-3/+3
| | | | | | | | | | during the FS sync. The system would appear to hang momentarily if there was a large backlog of I/O. This is because the vnode remains locked during the output - preventing normal character I/O. The problem was exacerbated by the FFS contiguous block allocation fixes and a semi-broken disksort(). The inode/date will still be synced during a normal FS dismount and whenever the inode is changed for other reasons.
* Add and move declarations to fix all of the warnings from `gcc -Wimplicit'bde1995-03-161-4/+1
| | | | | | (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.
* Increased default minfree to 8%.dg1995-03-101-2/+2
|
* The threshold for switching from time-space and space-time is too smalldg1995-03-101-2/+2
| | | | | | when minfree is 5%...so make it stay at space in this case. Submitted by: Kirk McKusick
* Removed obsolete vtrace() remnants.dg1995-03-041-8/+2
|
* Fixes from John Dyson to work around vnode lock hang. Basically, removedg1995-03-032-3/+11
| | | | | | the VOP_BMAP calls, and add one to bdwrite. Submitted by: John Dyson
* Don't try to make use of useless rotational position optimisation,se1995-02-271-8/+8
| | | | | | | | if all free blocks are in the same bucket (i.e. NRPOS == 1). Else a free block is choosen, possibly from a different cylinder, even if the block succeeding bpref was free ... Submitted by: se
* YF fix.phk1995-02-141-11/+16
|
* These changes embody the support of the fully coherent merged VM buffer cache,dg1995-01-093-16/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Use the same current time throughout ffs_update().bde1994-12-271-11/+27
| | | | | | Update some macro names in comments. Don't use MNT_WAIT for something not related to mounting.
* Undo a previous change. <sys/disklabel.h> was broken, not these files.bde1994-11-141-2/+1
|
* From: fredriks@mcs.com (Lars Fredriksen)jkh1994-10-281-1/+2
| | | | | | | ... It turns out that these files do not include <sys/dkbad.h> before <sys/disklabel.h>. Submitted by: fredriks
* Restrict fs_maxfilesize to 2^40, and check against this in ffs_truncate().dg1994-10-222-5/+8
| | | | | | | | | This is part of a bug fix from Kirk McKusick to work around problems in FFS related to the blkno of a 64bit offset not fitting into an int. Note the proper solution would be to deal with 64bit block numbers, but doing this would require sweeping changes; some other day perhaps. Submitted by: Marshall Kirk McKusick
* Cosmetics. make gcc less noisy. Still some way to go here.phk1994-10-106-51/+73
|
* Cosmetics for gcc -Wall. A couple of unused "int i"'s removed and a couple ofphk1994-10-081-24/+46
| | | | prototypes added. And the usual () work.
OpenPOWER on IntegriCloud