summaryrefslogtreecommitdiffstats
path: root/sys/ufs/ffs
Commit message (Collapse)AuthorAgeFilesLines
* Tie up some loose ends in vnode/object management. Remove an unneededdyson1998-01-171-4/+1
| | | | | | | config option in pmap. Fix a problem with faulting in pages. Clean-up some loose ends in swap pager memory management. The system should be much more stable, but all subtile bugs aren't fixed yet.
* Make our v_usecount vnode reference count work identically to thedyson1998-01-064-20/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | original BSD code. The association between the vnode and the vm_object no longer includes reference counts. The major difference is that vm_object's are no longer freed gratuitiously from the vnode, and so once an object is created for the vnode, it will last as long as the vnode does. When a vnode object reference count is incremented, then the underlying vnode reference count is incremented also. The two "objects" are now more intimately related, and so the interactions are now much less complex. When vnodes are now normally placed onto the free queue with an object still attached. The rundown of the object happens at vnode rundown time, and happens with exactly the same filesystem semantics of the original VFS code. There is absolutely no need for vnode_pager_uncache and other travesties like that anymore. A side-effect of these changes is that SMP locking should be much simpler, the I/O copyin/copyout optimizations work, NFS should be more ponderable, and further work on layered filesystems should be less frustrating, because of the totally coherent management of the vnode objects and vnodes. Please be careful with your system while running this code, but I would greatly appreciate feedback as soon a reasonably possible.
* Lots of improvements, including restructring the caching and managementdyson1997-12-291-5/+1
| | | | | | | | | | | | | | of vnodes and objects. There are some metadata performance improvements that come along with this. There are also a few prototypes added when the need is noticed. Changes include: 1) Cleaning up vref, vget. 2) Removal of the object cache. 3) Nuke vnode_pager_uncache and friends, because they aren't needed anymore. 4) Correct some missing LK_RETRY's in vn_lock. 5) Correct the page range in the code for msync. Be gentle, and please give me feedback asap.
* Don't include <sys/lock.h> in headers when only `struct simplelock' isbde1997-12-052-2/+4
| | | | required. Fixed everything that depended on the pollution.
* Fix a small style bug in the generation number change (rev.1.33) beforebde1997-12-021-2/+2
| | | | copying the change to other fs's.
* Staticized.bde1997-11-223-11/+13
|
* Unremoved prtrealloc and the declaration of ffs_clusteralloc(). Thesebde1997-11-221-1/+9
| | | | | | are used in the `#ifdef notyet' case :-). This case is used except in the `#if !defined (not_yes)' case :-|. This has something to do with the `#ifdef notyet_block_reallocation_enabled' case in vfs_cluster.c :-(.
* Removed an unused #include in the `#ifdef KERNEL' case.bde1997-11-181-5/+3
| | | | | | Fixed a comment to match the code. The code is still wrong (ffs_checkoverlap() should be staticized and called from a ddb command).
* Reviewed by: various.julian1997-11-121-2/+2
| | | | | | | | | | | | | | | | Ever since I first say the way the mount flags were used I've hated the fact that modes, and events, internal and exported, and short-term and long term flags are all thrown together. Finally it's annoyed me enough.. This patch to the entire FreeBSD tree adds a second mount flag word to the mount struct. it is not exported to userspace. I have moved some of the non exported flags over to this word. this means that we now have 8 free bits in the mount flags. There are another two that might well move over, but which I'm not sure about. The only user visible change would have been in pstat -v, except that davidg has disabled it anyhow. I'd still like to move the state flags and the 'command' flags apart from each other.. e.g. MNT_FORCE really doesn't have the same semantics as MNT_RDONLY, but that's left for another day.
* Remove a bunch of variables which were unused both in GENERIC and LINT.phk1997-11-071-5/+1
| | | | Found by: -Wunused
* Removed unused #includes. The need for most of them went away withbde1997-10-271-5/+1
| | | | recent changes (docluster* and vfs improvements).
* Another VFS cleanup "kilo commit"phk1997-10-165-29/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Remove VOP_UPDATE, it is (also) an UFS/{FFS,LFS,EXT2FS,MFS} intereface function, and now lives in the ufsmount structure. 2. Remove VOP_SEEK, it was unused. 3. Add mode default vops: VOP_ADVLOCK vop_einval VOP_CLOSE vop_null VOP_FSYNC vop_null VOP_IOCTL vop_enotty VOP_MMAP vop_einval VOP_OPEN vop_null VOP_PATHCONF vop_einval VOP_READLINK vop_einval VOP_REALLOCBLKS vop_eopnotsupp And remove identical functionality from filesystems 4. Add vop_stdpathconf, which returns the canonical stuff. Use it in the filesystems. (XXX: It's probably wrong that specfs and fifofs sets this vop, shouldn't it come from the "host" filesystem, for instance ufs or cd9660 ?) 5. Try to make system wide VOP functions have vop_* names. 6. Initialize the um_* vectors in LFS. (Recompile your LKMS!!!)
* VFS mega cleanup commit (x/N)phk1997-10-166-68/+56
| | | | | | | | | | | | | | | | | | | | | | | 1. Add new file "sys/kern/vfs_default.c" where default actions for VOPs go. Implement proper defaults for ABORTOP, BWRITE, LEASE, POLL, REVOKE and STRATEGY. Various stuff spread over the entire tree belongs here. 2. Change VOP_BLKATOFF to a normal function in cd9660. 3. Kill VOP_BLKATOFF, VOP_TRUNCATE, VOP_VFREE, VOP_VALLOC. These are private interface functions between UFS and the underlying storage manager layer (FFS/LFS/MFS/EXT2FS). The functions now live in struct ufsmount instead. 4. Remove a kludge of VOP_ functions in all filesystems, that did nothing but obscure the simplicity and break the expandability. If a filesystem doesn't implement VOP_FOO, it shouldn't have an entry for it in its vnops table. The system will try to DTRT if it is not implemented. There are still some cruft left, but the bulk of it is done. 5. Fix another VCALL in vfs_cache.c (thanks Bruce!)
* vnops megacommitphk1997-10-151-121/+4
| | | | | | | | | | 1. Use the default function to access all the specfs operations. 2. Use the default function to access all the fifofs operations. 3. Use the default function to access all the ufs operations. 4. Fix VCALL usage in vfs_cache.c 5. Use VOCALL to access specfs functions in devfs_vnops.c 6. Staticize most of the spec and fifofs vnops functions. 7. Make UFS panic if it lacks bits of the underlying storage handling.
* Hmm, realign the vnops into two columns.phk1997-10-151-25/+25
|
* Stylistic overhaul of vnops tables.phk1997-10-151-145/+137
| | | | | | | 1. Remove comment stating the blatantly obvious. 2. Align in two columns. 3. Sort all but the default element alphabetically. 4. Remove XXX comments pointing out entries not needed.
* I think my previous change may have opened a race conditio.phk1997-10-141-4/+1
| | | | This patch does the same thing, with no change in semantics.
* ufs_ihashrem() should not be called from the UFS layer, but from thephk1997-10-141-1/+4
| | | | | | lower layer (LFS/FFS/?) like the rest of the ihash functions. Otherwise it is impossible to make a lower layer that doesn't use the ihash facility.
* Last major round (Unless Bruce thinks of somthing :-) of malloc changes.phk1997-10-121-2/+2
| | | | | | | | Distribute all but the most fundamental malloc types. This time I also remembered the trick to making things static: Put "static" in front of them. A couple of finer points by: bde
* Distribute and statizice a lot of the malloc M_* types.phk1997-10-111-1/+3
| | | | Substantial input from: bde
* Add type arg to ffs_mountfs and avoid examining v_tag to find outphk1997-10-103-35/+17
| | | | | | if MFS is getting a free ride. Use generic ufs_reclaim().
* Clustered read and write are switched at mount-option level.kato1997-09-273-20/+21
| | | | | | | | | | | | | | | | 1. Clustered I/O is switched by the MNT_NOCLUSTERR and MNT_NOCLUSTERW bits of the mnt_flag. The sysctl variables, vfs.foo.doclusterread and vfs.foo.doclusterwrite are deleted. Only mount option can control clustered I/O from userland. 2. When foofs_mount mounts block device, foofs_mount checks D_CLUSTERR and D_CLUSTERW bits of the d_flags member in the block device switch table. If D_NOCLUSTERR / D_NOCLUSTERW are set, MNT_NOCLUSTERR / MNT_NOCLUSTERW bits will be set. In this case, MNT_NOCLUSTERR and MNT_NOCLUSTERW cannot be cleared from userland. 3. Vnode driver disables both clustered read and write. 4. Union filesystem disables clutered write. Reviewed by: bde
* [Regarding the previous patch] This is completely wrong.phk1997-09-191-3/+5
| | | | | | | | | | | | | 1. ffs_alloc() actually allowed writing one block less one frag (normally 7 frags or 7/8 blocks) beyond the limit. 2. freebufspace() gives the free space in frags, but `size' is in bytes, so the change results in approximately `size' fragments too many being reserved. 3. ffs_realloccg() has the same bug but wasn't changed. PR: 3398 Submitted by: bde Eyeballed by: phk
* Ffs_alloc allow users to write one block beyond the limit.phk1997-09-181-2/+2
| | | | | | PR: 3398 Reviewed by: phk Submitted by: Wolfram Schneider <wosch@apfel.de>
* Convert select -> poll.peter1997-09-141-4/+12
| | | | | Delete 'always succeed' select/poll handlers, replaced with generic call. Flag missing vnode op table entries.
* Removed yet more vestiges of config-time swap configuration and/orbde1997-09-071-4/+3
| | | | cleaned up nearby cruft.
* Removed unused #includes.bde1997-09-024-21/+4
|
* Uncut&paste cache_lookup().phk1997-08-261-2/+3
| | | | | | | | | | | | | | | This unifies several times in theory indentical 50 lines of code. The filesystems have a new method: vop_cachedlookup, which is the meat of the lookup, and use vfs_cache_lookup() for their vop_lookup method. vfs_cache_lookup() will check the namecache and pass on to the vop_cachedlookup method in case of a miss. It's still the task of the individual filesystems to populate the namecache with cache_enter(). Filesystems that do not use the namecache will just provide the vop_lookup method as usual.
* Renamed doclusterread/write to unique names (ffs_doclusterread/write),kato1997-08-251-6/+8
| | | | | | | and staticize them. Move the #include of <sys/sysctl.h> to the top of the file. Pointed out by: Bruce Evans <bde@zeta.org.au>
* Fix all areas of the system (or at least all those in LINT) to avoid storingwollman1997-08-162-6/+5
| | | | | | | | 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.
* We got a couple of "map mismatch" panics from the followingphk1997-08-041-2/+2
| | | | | | | | | | | | | code. According to the crash dump, bpref is set to 445 and cgp->cg_nclusterblks is 444. Hence in the for loop, the test fails immediately but the following failure check (got == cgp->cg_nclusterblks) doesn't trigger because got > cgp->cg_nclusterblks. This wreaks havoc in the code after that. Fix: Move one source bit to the left :-) Noticed by: Mike Hibler <mike@fast.cs.utah.edu> Submitted by: Kirk McKusick <mckusick@McKusick.COM>
* Removed unused #includes.bde1997-08-021-5/+1
|
* Use smalllblktosize() instead of multiplying small block numbersbde1997-04-101-4/+4
| | | | | by fs->fs_bsize. The macro is usually faster and makes it clearer that the multiplication can't overflow.
* Don't include <sys/ioctl.h> in the kernel. Stage 1: don't includebde1997-03-241-2/+1
| | | | | it when it is not used. In most cases, the reasons for including it went away when the special ioctl headers became self-sufficient.
* Fixed corrupted newline and corrupted tab in previous commit.bde1997-03-241-2/+3
|
* Add generation number randomization. Newly created filesystems wil nowguido1997-03-233-16/+11
| | | | | | | | | automatically have random generation numbers. The kenel way of handling those also changed. Further it is advised to run fsirand on all your nfs exported filesystems. the code is mostly copied from OpenBSD, with the randomization chanegd to use /dev/urandom Reviewed by: Garrett Obtained from: OpenBSD
* Don't #include <sys/fcntl.h> in <sys/file.h> if KERNEL is defined.bde1997-03-231-2/+2
| | | | | Fixed everything that depended on getting fcntl.h stuff from the wrong place. Most things don't depend on file.h stuff at all.
* Fixed some invalid (non-atomic) accesses to `time', mostly ones of thebde1997-03-224-8/+8
| | | | | | form `tv = time'. Use a new function gettime(). The current version just forces atomicicity without fixing precision or efficiency bugs. Simplified some related valid accesses by using the central function.
* Restore the lost MNT_LOCAL flag twiddle. Lite2 has a different mechanismpeter1997-03-181-1/+3
| | | | | | | | | | | of setting it (compiled into vfs_conf.c), but we have a dynamic system in place. This could probably be better done via a runtime configure flag in the VFS_SET() VFS declaration, perhaps VFCF_LOCAL, and have the VFS code propagate this down into MNT_LOCAL at mount time. The other FS's would need to be updated, havinf UFS and MSDOSFS filesystems without MNT_LOCAL breaks a few things.. the man page rebuild scans for local filesystems and currently fails, I suspect that other tools like find and tar with their "local filesystem only" modes might be affected.
* Fix support for != 512 byte sector devices.sos1997-03-151-2/+2
| | | | | | | | | Restores the use of SBLOCK instead of the BSOFF/sectorsize calculation. Using SBLOCK is bogus however in that it uses DEV_BSIZE instead of the actual sector size, but that is taken care of in other places. Changing the SBLOCK would be better, but it affects the system in other places, and doing it this way makes it possible to use filesystems that was made before the lite2 merge.
* Update a number of panic messages to reflect the actual namempp1997-03-093-11/+11
| | | | of the routine that caused the panic.
* Fixed connection of vfs.ffs node to the sysctl tree.bde1997-03-041-2/+2
|
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-229-9/+9
| | | | ready for it yet.
* Add function prototypes for most of the new Lite2 functions.mpp1997-02-121-0/+2
| | | | | | Also made a few of the miscfs routines static to be consistent. Some modules simply required some additional #includes to remove -Wall warnings.
* Correct the new Lite2 #ifdef DIAGNOSTIC ffs_checkblk routinempp1997-02-101-11/+8
| | | | | | | | | | | | | to not return without setting a return value when it can't read a block error or detects a bad cylinder group, since the caller is expecting a return value. It will now panic at this point, since the thing to do in this case would be to return a "bad block" status to the caller, and the caller will panic anyways when that happens. Also updated to panic strings in this routine to read "ffs_checkblk: ..." instead of "checkblk: ...".
* Make ffs_subr.c compile when DIAGNOSTIC is defined.mpp1997-02-101-1/+1
| | | | | It looks like this was broken before the Lite2 merge :-(. VOP_BMAP was being called with the wrong number of arguments.
* This is the kernel Lite/2 commit. There are some requisite userlanddyson1997-02-108-425/+706
| | | | | | | | | | | | | | | 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>
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-149-9/+9
| | | | | | | | 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.
* Submitted by: Archie and me.julian1996-11-131-1/+3
| | | | | | | | | | | | | | | | We encountered an interesting situation where the superblock for a file system got written to disk with the "fs_fmod" flag set to one. It appears that this flag is normally supposed to be cleared during ffs_sync(), but we experienced a crash, or some other weird occurrence that left it on the disk set to 1. Later this partition was mounted read-only... and the fs_fmod field was never cleared, causing ffs_sync() to panic "rofs mod" when trying to unmount that filesystem (ffs_vfsops.c: line 790). fix: set this bit to 0 when you load the superblock from disk. (see more complete mail on this to hackers)
* Eliminate an unnecessary synchronous write (and an 8K bcopy+bzero) whendg1996-11-051-17/+22
| | | | | | | | truncating/deleting large files. Reviewed by: mckusick, dyson Submitted by: Kirk McKusick <mckusick@mckusick.com>, modified for FreeBSD by me.
OpenPOWER on IntegriCloud