summaryrefslogtreecommitdiffstats
path: root/sys/ufs
Commit message (Collapse)AuthorAgeFilesLines
* - Back out Luoqi's cdevsw stuff. It panics on my system and is not required.jb1999-05-241-7/+10
| | | | | | | - Fix an error message. - Do the MFS_ROOT setting of mountrootfsname in mfs_init() instead of cpu_rootconf(). - Set rootdev in mfs_init instead of later in mfs_mount() iff MFS_ROOT.
* Cosmetic changes to make it compile without errors in gcc -Walljulian1999-05-221-10/+17
|
* Legally acquire a major number for mfs.luoqi1999-05-141-2/+7
|
* Add a hook to ffs_fsync to allow soft updates to get first chance at doingmckusick1999-05-144-30/+113
| | | | | | a sync on the block device for the filesystem. That allows it to push the bitmap blocks before the inode blocks which greatly reduces the number of inode rollbacks that need to be done.
* Try and fix a dev_t/major/minor etc nit.peter1999-05-121-3/+3
|
* Divorce "dev_t" from the "major|minor" bitmap, which is now calledphk1999-05-113-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 disordering in previous 2 commits.bde1999-05-111-3/+3
|
* Move the mfs_getimage() prototype to mfs_extern.h duplicating itpeter1999-05-102-4/+3
| | | | everywhere.
* Put back changes that might be causing trouble on Alpha.mckusick1999-05-091-3/+5
|
* I got tired of seeing all the cdevsw[major(foo)] all over the place.phk1999-05-082-12/+12
| | | | | | | | Made a new (inline) function devsw(dev_t dev) and substituted it. Changed to the BDEV variant to this format as well: bdevsw(dev_t dev) DEVFS will eventually benefit from this change too.
* Continue where Julian left off in July 1998:phk1999-05-072-12/+12
| | | | | | | | | | | | | | Virtualize bdevsw[] from cdevsw. bdevsw() is now an (inline) function. Join CDEV_MODULE and BDEV_MODULE to DEV_MODULE (please pay attention to the order of the cmaj/bmaj arguments!) Join CDEV_DRIVER_MODULE and BDEV_DRIVER_MODULE to DEV_DRIVER_MODULE (ditto!) (Next step will be to convert all bdev dev_t's to cdev dev_t's before they get to do any damage^H^H^H^H^H^Hwork in the kernel.)
* Whitespace cleanup.mckusick1999-05-071-2/+2
|
* Get rid of random debugging cruft; sync up with latest version.mckusick1999-05-071-38/+10
|
* Severe slowdowns have been reported when creating or removing manymckusick1999-05-071-108/+290
| | | | | | | | | | | | | | | | | | | | | | files at once on a filesystem running soft updates. The root of the problem is that soft updates limits the amount of memory that may be allocated to dependency structures so as to avoid hogging kernel memory. The original algorithm just waited for the disk I/O to catch up and reduce the number of dependencies. This new code takes a much more aggressive approach. Basically there are two resources that routinely hit the limit. Inode dependencies during periods with a high file creation rate and file and block removal dependencies during periods with a high file removal rate. I have attacked these problems from two fronts. When the inode dependency limits are reached, I pick a random inode dependency, UFS_UPDATE it together with all the other dirty inodes contained within its disk block and then write that disk block. This trick usually clears 5-50 inode dependencies in a single disk I/O. For block and file removal dependencies, I pick a random directory page that has at least one remove pending and VOP_FSYNC its directory. That releases all its removal dependencies to the work queue. To further hasten things along, I also immediately start the work queue process rather than waiting for its next one second scheduled run.
* Add sufficient braces to keep egcs happy about potentially ambiguouspeter1999-05-061-2/+3
| | | | if/else nesting.
* The VFS/BIO subsystem contained a number of hacks in order to optimizealc1999-05-023-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | piecemeal, middle-of-file writes for NFS. These hacks have caused no end of trouble, especially when combined with mmap(). I've removed them. Instead, NFS will issue a read-before-write to fully instantiate the struct buf containing the write. NFS does, however, optimize piecemeal appends to files. For most common file operations, you will not notice the difference. The sole remaining fragment in the VFS/BIO system is b_dirtyoff/end, which NFS uses to avoid cache coherency issues with read-merge-write style operations. NFS also optimizes the write-covers-entire-buffer case by avoiding the read-before-write. There is quite a bit of room for further optimization in these areas. The VM system marks pages fully-valid (AKA vm_page_t->valid = VM_PAGE_BITS_ALL) in several places, most noteably in vm_fault. This is not correct operation. The vm_pager_get_pages() code is now responsible for marking VM pages all-valid. A number of VM helper routines have been added to aid in zeroing-out the invalid portions of a VM page prior to the page being marked all-valid. This operation is necessary to properly support mmap(). The zeroing occurs most often when dealing with file-EOF situations. Several bugs have been fixed in the NFS subsystem, including bits handling file and directory EOF situations and buf->b_flags consistancy issues relating to clearing B_ERROR & B_INVAL, and handling B_DONE. getblk() and allocbuf() have been rewritten. B_CACHE operation is now formally defined in comments and more straightforward in implementation. B_CACHE for VMIO buffers is based on the validity of the backing store. B_CACHE for non-VMIO buffers is based simply on whether the buffer is B_INVAL or not (B_CACHE set if B_INVAL clear, and vise-versa). biodone() is now responsible for setting B_CACHE when a successful read completes. B_CACHE is also set when a bdwrite() is initiated and when a bwrite() is initiated. VFS VOP_BWRITE routines (there are only two - nfs_bwrite() and bwrite()) are now expected to set B_CACHE. This means that bowrite() and bawrite() also set B_CACHE indirectly. There are a number of places in the code which were previously using buf->b_bufsize (which is DEV_BSIZE aligned) when they should have been using buf->b_bcount. These have been fixed. getblk() now clears B_DONE on return because the rest of the system is so bad about dealing with B_DONE. Major fixes to NFS/TCP have been made. A server-side bug could cause requests to be lost by the server due to nfs_realign() overwriting other rpc's in the same TCP mbuf chain. The server's kernel must be recompiled to get the benefit of the fixes. Submitted by: Matthew Dillon <dillon@apollo.backplane.com>
* This Implements the mumbled about "Jail" feature.phk1999-04-282-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a seriously beefed up chroot kind of thing. The process is jailed along the same lines as a chroot does it, but with additional tough restrictions imposed on what the superuser can do. For all I know, it is safe to hand over the root bit inside a prison to the customer living in that prison, this is what it was developed for in fact: "real virtual servers". Each prison has an ip number associated with it, which all IP communications will be coerced to use and each prison has its own hostname. Needless to say, you need more RAM this way, but the advantage is that each customer can run their own particular version of apache and not stomp on the toes of their neighbors. It generally does what one would expect, but setting up a jail still takes a little knowledge. A few notes: I have no scripts for setting up a jail, don't ask me for them. The IP number should be an alias on one of the interfaces. mount a /proc in each jail, it will make ps more useable. /proc/<pid>/status tells the hostname of the prison for jailed processes. Quotas are only sensible if you have a mountpoint per prison. There are no privisions for stopping resource-hogging. Some "#ifdef INET" and similar may be missing (send patches!) If somebody wants to take it from here and develop it into more of a "virtual machine" they should be most welcome! Tools, comments, patches & documentation most welcome. Have fun... Sponsored by: http://www.rndassociates.com/ Run for almost a year by: http://www.servetheweb.com/
* Simplify the tunefs example, since tunefs uses getfsfile(). Lots ofmsmith1999-04-271-3/+3
| | | | | people complain about working out what device their filesystems are mounted on.
* Suser() simplification:phk1999-04-272-8/+8
| | | | | | | | | | | | | | | | | | | 1: s/suser/suser_xxx/ 2: Add new function: suser(struct proc *), prototyped in <sys/proc.h>. 3: s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/ The remaining suser_xxx() calls will be scrutinized and dealt with later. There may be some unneeded #include <sys/cred.h>, but they are left as an exercise for Bruce. More changes to the suser() API will come along with the "jail" code.
* Change type of a variable from u_int to size_t, so that pointer to it may bedt1999-04-211-2/+2
| | | | used as a last argument to copyinstr().
* Correct typo in panic messageeivind1999-04-111-2/+2
|
* Hold the mfs process's upages in-core with PHOLD rather than P_NOSWAP.peter1999-04-061-3/+3
|
* Catch a case spotted by Tor where files mmapped could leave garbage in thejulian1999-04-051-6/+17
| | | | | | | | | | | | unallocated parts of the last page when the file ended on a frag but not a page boundary. Delimitted by tags PRE_MATT_MMAP_EOF and POST_MATT_MMAP_EOF, in files alpha/alpha/pmap.c i386/i386/pmap.c nfs/nfs_bio.c vm/pmap.h vm/vm_page.c vm/vm_page.h vm/vnode_pager.c miscfs/specfs/spec_vnops.c ufs/ufs/ufs_readwrite.c kern/vfs_bio.c Submitted by: Matt Dillon <dillon@freebsd.org> Reviewed by: Alan Cox <alc@freebsd.org>
* There's not much point in the EXPORTMFS #ifdef. I've had this sittingpeter1999-04-051-3/+1
| | | | | | in my tree for 12+ months, and I just noticed that NetBSD have (I think, I've just seen the commit, not the change) just zapped it there. It wasn't in the options files or LINT either.
* Stop the mfs from trying to swap out crucial bits of the mfsjulian1999-03-121-7/+7
| | | | | as this can lead to deadlock. Submitted by: Mat dillon <dillon@freebsd.org>
* Don't depend on <ufs/ufs/quota.h> or another (old) prerequisite includingbde1999-03-061-1/+2
| | | | | <sys/queue.h>. This fixes my recent breakage of biosboot by unpolluting <ufs/ufs/quota.h> in the !KERNEL case.
* Moved kernel declarations inside the KERNEL ifdef, and removedbde1999-03-051-7/+7
| | | | | | | | | | | | | | | include of <sys/queue.h> in the !KERNEL case. The prerequisites for <ufs/ufs/quota.h> were broken in Lite2 by converting some of the kernel declarations to use queue macros without including <sys/queue.h>. <sys/queue.h> was included in applications in /usr/src instead. We polluted this file instead of merging the changes in the applications. Include <sys/queue.h> in the KERNEL case, and forward-declare all structs that are used in prototypes, so that this file is almost self-sufficient even in the kernel. Obtained from: mostly from NetBSD
* Changed the type of quotactl()'s 4th arg from `char *' to `void *'bde1999-03-051-2/+2
| | | | | | | | | so that non-sloppy applications can call it without using disgusting casts to avoid warnings. The 4th arg is sort of varargs -- it must sometimes represent a filename, sometimes a struct pointer, and is sometimes unused. The arg type is still caddr_t in the kernel. Obtained from: mostly from NetBSD
* Reorganize locking to avoid holding the lock during calls to bdwritemckusick1999-03-021-3/+9
| | | | | | and brelse (which may sleep in some systems). Obtained from: Matthew Dillon <dillon@apollo.backplane.com>
* Merge patch to ufs_vnops.c's ufs_rename to the copy of ufs_rename thatimp1999-03-021-2/+2
| | | | | | lives in ext2_vnops.c for ext2fs. Also remove cast from comparision. Bruce pointed out that it was bogus since we'd force a signed comparision when we really wanted an unsigned comparison.
* When fsync'ing a file on a filesystem using soft updates, we first trymckusick1999-03-021-10/+18
| | | | | | | | | | | | | | | | to write all the dirty blocks. If some of those blocks have dependencies, they will be remarked dirty when the I/O completes. On systems with really fast I/O systems, it is possible to get in an infinite loop trying to flush the buffers, because the I/O finishes before we can get all the dirty buffers off the v_dirtyblkhd list and into the I/O queue. (The previous algorithm looped over the v_dirtyblkhd list writing out buffers until the list emptied.) So, now we mark each buffer that we try to write so that we can distinguish the ones that are being remarked dirty from those that we have not yet tried to flush. Once we have tried to push every buffer once, we then push any associated metadata that is causing the remaining buffers to be redirtied. Submitted by: Matthew Dillon <dillon@apollo.backplane.com>
* Ensure that softdep_sync_metadata can handle bmsafemap and mkdir entriesmckusick1999-03-022-5/+48
| | | | | if they ever arise (which should not happen as softdep_sync_metadata is currently used).
* Fix last commit based on feedback from Guido, Bruce and Terry.imp1999-02-261-5/+6
| | | | | | | | | | | | | | | | Specifically, the test was in the wrong place, lacked a cast, didn't unlock the node, and exited to bad rather than abortit. Now we don't allow renaming of a file with LINK_MAX references. Move the test to earlier in the code as it is closer to where ip is obtained, as that is the style of the rest of the function. Didn't fix the problems bruce pointed out in the rename man page to include EMLINK, nor address his complaints about how the whole idea of incrementing the link count during a rename is potentially asking for trouble. Also didn't try to correct potential problem Terry pointed out with decrements not being similarly protected against underflow.
* Add missing check for LINK_MAX in ufs_rename. Since ip->i_effnlink andimp1999-02-251-1/+5
| | | | | | ip->nlink were different types, there was a masked overflow. Reported by: Mark Slemco <marcs@znep.com>
* Update ufs_vnops code to use new specinfo fields rather then guess.dillon1999-02-251-7/+14
| | | | This is part of general specinfo / d_parms() commit.
* fix double LIST_REMOVE; other cosmetic changes to match version 9.32.mckusick1999-02-171-12/+13
| | | | Obtained from: Jeffrey Hsu <hsu@FreeBSD.ORG>
* Remove XXX comment in regarsd to why NFS doesn't use VOP_ABORT(). NFSdillon1999-02-131-3/+3
| | | | is being fixed now.
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-2810-54/+54
| | | | kernel compile
* Remove unintended trigraph sequences in comments for -Walldillon1999-01-271-2/+2
|
* Gutted softdep_deallocate_dependencies and replaced it with a panic. Itdg1999-01-221-41/+3
| | | | | | | | turns out to not be useful to unwind the dependencies and continue in the face of a fatal error. Also changed the log() to a printf() in softdep_error() so that it will be output in the case of a impending panic. Submitted by: Kirk McKusick <mckusick@mckusick.com>
* Added support for VOP_FREEBLKS(), reducing MFS's impact on swap anddillon1999-01-211-1/+1
| | | | | | | increasing performance by deallocating at least some of the backing store when files are removed. Protect mfsp->buf_queue access at splbio().
* Access to mfsp->buf_queue must be protected at splbio(). Other minordillon1999-01-211-1/+1
| | | | adjustments also made, such as passing mfsp to mfs_doio() directly.
* This is a rather large commit that encompasses the new swapper,dillon1999-01-215-23/+141
| | | | | | | | | | 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>
* Silence warning about unused debug function. (I'll turn this functioneivind1999-01-121-3/+3
| | | | into a DDB command in my next staticization sweep).
* Add a warning about the copyright restraints.eivind1999-01-081-0/+4
|
* Don't pass unused unused timestamp args to UFS_UPDATE() or wastebde1999-01-0711-84/+60
| | | | | time initializing them. This almost finishes centralizing (in-core) timestamp updates in ufs_itimes().
* UFS_UPDATE() takes a boolean `waitfor' arg, so don't pass it the valuebde1999-01-062-7/+7
| | | | | | MNT_WAIT when we mean boolean `true' or check for that value not being passed. There was no problem in practice because MNT_WAIT had the magic value of 1.
* Ifdefed the conditionally used variable `prtrealloc'. Declare itbde1999-01-061-2/+4
| | | | | as volatile so that there is no chance that the code that it controls is optimised away.
* Backed out rev.1.47. It just broke my optimisations for lazy syncingbde1999-01-061-5/+3
| | | | | | of timestamps in rev.1.45. The soft updates bug was elsewhere. Forgotten by: luoqi
* Remove the 'waslocked' parameter to vfs_object_create().eivind1999-01-051-3/+3
|
OpenPOWER on IntegriCloud