summaryrefslogtreecommitdiffstats
path: root/sys/gnu/fs/ext2fs/ext2_readwrite.c
Commit message (Collapse)AuthorAgeFilesLines
* Bring in the ext2fs work done by Aditya Sarawgi during and after Google Summerlulf2010-01-141-304/+0
| | | | | | | | | | | | | | | of Code 2009: - BSDL block and inode allocation policies for ext2fs. This involves the use FFS1 style block and inode allocation for ext2fs. Preallocation was removed since it was GPL'd. - Make ext2fs MPSAFE by introducing locks to per-mount datastructures. - Fixes for kern/122047 PR. - Various small bugfixes. - Move out of gnu/ directory. Sponsored by: Google Inc. Submitted by: Aditya Sarawgi <sarawgi.aditya AT SPAMFREE gmail DOT com>
* /* -> /*- for copyright notices, minor format tweaks as necessaryimp2005-01-061-2/+2
|
* Give cluster_write() an explicit vnode argument.phk2004-09-271-1/+1
| | | | In the future a struct buf will not automatically point out a vnode for us.
* Remove advertising clause from University of California Regent'simp2004-04-071-4/+0
| | | | | | | license, per letter dated July 22, 1999 and email from Peter Wemm, Alan Cox and Robert Watson. Approved by: core, peter, alc, rwatson
* Enforce the file size limit in VOP_WRITE() as well as VOP_TRUNCATE();tjr2004-02-191-6/+2
| | | | pointed out by bde.
* Locking for the per-process resource limits structure.jhb2004-02-041-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - struct plimit includes a mutex to protect a reference count. The plimit structure is treated similarly to struct ucred in that is is always copy on write, so having a reference to a structure is sufficient to read from it without needing a further lock. - The proc lock protects the p_limit pointer and must be held while reading limits from a process to keep the limit structure from changing out from under you while reading from it. - Various global limits that are ints are not protected by a lock since int writes are atomic on all the archs we support and thus a lock wouldn't buy us anything. - All accesses to individual resource limits from a process are abstracted behind a simple lim_rlimit(), lim_max(), and lim_cur() API that return either an rlimit, or the current or max individual limit of the specified resource from a process. - dosetrlimit() was renamed to kern_setrlimit() to match existing style of other similar syscall helper functions. - The alpha OSF/1 compat layer no longer calls getrlimit() and setrlimit() (it didn't used the stackgap when it should have) but uses lim_rlimit() and kern_setrlimit() instead. - The svr4 compat no longer uses the stackgap for resource limits calls, but uses lim_rlimit() and kern_setrlimit() instead. - The ibcs2 compat no longer uses the stackgap for resource limits. It also no longer uses the stackgap for accessing sysctl's for the ibcs2_sysconf() syscall but uses kernel_sysctl() instead. As a result, ibcs2_sysconf() no longer needs Giant. - The p_rlimit macro no longer exists. Submitted by: mtm (mostly, I only did a few cleanups and catchups) Tested on: i386 Compiled on: alpha, amd64
* Spell magic '16' number as IO_SEQSHIFT.kan2004-01-191-3/+3
|
* Remove register keyword.iedowse2002-05-161-8/+8
|
* Complete the separation of ext2fs from ufs by copying the remainingiedowse2002-05-161-2/+2
| | | | | | | | | | shared code and converting all ufs references. Originally it may have made sense to share common features between the two filesystems, but recently it has only caused problems, the UFS2 work being the final straw. All UFS_* indirect calls are now direct calls to ext2_* functions, and ext2fs-specific mount and inode structures have been introduced.
* KSE Milestone 2julian2001-09-121-8/+8
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* Grab the process lock while calling psignal and before calling psignal.jhb2001-03-071-0/+2
|
* Proc locking, mostly protecting p_ucred while obtaining additionaljhb2001-01-231-0/+2
| | | | references.
* Avoid a data-consistency race between write() and mmap()dillon2000-12-171-0/+9
| | | | | | | | by ensuring that newly allocated blocks are zerod. The race can occur even in the case where the write covers the entire block. Reported by: Sven Berkvens <sven@berkvens.net>, Marc Olzheim <zlo@zlo.nu>
* Change the write-behind code to take more care when startingdillon2000-04-021-1/+3
| | | | | | | | | | | | | | async I/O's. The sequential read heuristic has been extended to cover writes as well. We continue to call cluster_write() normally, thus blocks in the file will still be reallocated for large (but still random) I/O's, but I/O will only be initiated for truely sequential writes. This solves a number of annoying situations, especially with DBM (hash method) writes, and also has the side effect of fixing a number of (stupid) benchmarks. Reviewed-by: mckusick
* More removals of vnode->v_lastr, replaced by preexisting seqcountdillon1999-09-201-2/+3
| | | | | | | | | heuristic to detect sequential operation. VM-related forced clustering code removed from ufs in preparation for a commit to vm/vm_fault.c that does it more generally. Reviewed by: David Greenman <dg@root.com>, Alan Cox <alc@cs.rice.edu>
* Don't set IN_ACCESS for requests to read 0 bytes or for unsuccessful reads.bde1999-07-251-2/+4
| | | | | | Translated from: similar fixes in ufs_readwrite.c rev.1.61. Things are simpler (but annoyingly different) here because there are no vm optimisations.
* Don't pass unused unused timestamp args to UFS_UPDATE() or wastebde1999-01-071-5/+2
| | | | | time initializing them. This almost finishes centralizing (in-core) timestamp updates in ufs_itimes().
* Catch a few corner cases where FreeBSD differs enough from BSD 4.4 tojulian1998-07-081-1/+2
| | | | | confuse Soft updates.. Should solve several "dangling deps" panics.
* Eradicate the variable "time" from the kernel, using various measures.phk1998-03-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "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
* Removed __FreeBSD__ ifdefs.bde1997-12-021-24/+0
|
* Another VFS cleanup "kilo commit"phk1997-10-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | 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!)
* Clustered read and write are switched at mount-option level.kato1997-09-271-2/+2
| | | | | | | | | | | | | | | | 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
* Code cleanup. Removed !FreeBSD code arround sysctl stuff. Renamedkato1997-08-241-2/+2
| | | | | | | | doclusterread/doclusterwrite into ext2_doclusterread and ext2_doclusterwrite, which are unique names. Moved #include of <sys/sysctl.h> to the top of the file. Pointed out by: Bruce Evans <bde@zeta.org.au>
* Fixed some invalid (non-atomic) accesses to `time', mostly ones of thebde1997-03-221-5/+1
| | | | | | 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.
* Removed useless setting of IN_RECURSE. The (anti) locking for this needsbde1997-03-031-8/+0
| | | | to be done in a different way, if at all.
* This commit is the embodiment of some VFS read clustering improvements.dyson1996-12-291-1/+2
| | | | | | | | | | Firstly, now our read-ahead clustering is on a file descriptor basis and not on a per-vnode basis. This will allow multiple processes reading the same file to take advantage of read-ahead clustering. Secondly, there previously was a problem with large reads still using the ramp-up algorithm. Of course, that was bogus, and now we read the entire "chunk" off of the disk in one operation. The read-ahead clustering algorithm should use less CPU than the previous also (I hope :-)).
* Removed gratuitous differences between ext2_readwrite.c and ufs_readwrite.c.bde1996-11-081-12/+17
| | | | | | | | | | | | | | | | | This fixes several bugs and one missing feature: - cluster_read() was needlessly used for reading files of size exactly 1 block. - EFAULT errors for read didn't terminate the loop. This was probably harmless. - IO_VMIO handling was missing near line 275. I don't know what this does. - B_CLUSTEROK was only set if (doclusterwrite) nead line 293. This was harmless, if only because another bug prevents doclusterwrite from being 0. - MNT_NOATIME wasn't implemented. This should be in 2.2, of course. Reviewed by: davidg
* Eliminated many redundant vm_map_lookup operations for vm_mmap.dyson1996-01-191-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Speed up for vfs_bio -- addition of a routine bqrelse to greatly diminish overhead for merged cache. Efficiency improvement for vfs_cluster. It used to do alot of redundant calls to cluster_rbuild. Correct the ordering for vrele of .text and release of credentials. Use the selective tlb update for 486/586/P6. Numerous fixes to the size of objects allocated for files. Additionally, fixes in the various pagers. Fixes for proper positioning of vnode_pager_setsize in msdosfs and ext2fs. Fixes in the swap pager for exhausted resources. The pageout code will not as readily thrash. Change the page queue flags (PG_ACTIVE, PG_INACTIVE, PG_FREE, PG_CACHE) into page queue indices (PQ_ACTIVE, PQ_INACTIVE, PQ_FREE, PQ_CACHE), thereby improving efficiency of several routines. Eliminate even more unnecessary vm_page_protect operations. Significantly speed up process forks. Make vm_object_page_clean more efficient, thereby eliminating the pause that happens every 30seconds. Make sequential clustered writes B_ASYNC instead of B_DELWRI even in the case of filesystems mounted async. Fix a panic with busy pages when write clustering is done for non-VMIO buffers.
* Staticize.phk1995-12-171-2/+2
|
* Correct some serious porting errors. The worst one was that thedyson1995-11-191-5/+12
| | | | vnode was being placed upon the mount point twice!!!
* Main code for the ext2fs filesystem. Please refer to the COPYRIGHT.INFOdyson1995-11-051-0/+316
file for GPL restrictions. This code was ported to the BSD platform by Godmar Back <gback@facility.cs.utah.edu> and specifically to FreeBSD by John Dyson. This code is still green and should be used with caution. Additional changes to UFS necessary to make this code work will be commited seperately. Submitted by: Godmar Back <gback@facility.cs.utah.edu> Obtained from: Lites/Mach4
OpenPOWER on IntegriCloud