summaryrefslogtreecommitdiffstats
path: root/sys/ufs/ffs
Commit message (Collapse)AuthorAgeFilesLines
* Record where half the bits in this file came from (from ufs_readwrite.c).bde2004-04-071-0/+2
| | | | | Damage to history from moving bits was especially large since a repo copy is not feasible for partial files.
* Remove advertising clause from University of California Regent'simp2004-04-079-36/+0
| | | | | | | | | license, per letter dated July 22, 1999 and irc message from Robert Watson saying that clause 3 can be removed from those files with an NAI copyright that also have only a University of California copyrights. Approved by: core, rwatson
* Fix a paste-o from the buf_prewrite() cleanup commit and check for thejhb2004-04-061-1/+1
| | | | | | | MNTK_SUSPEND flag on the correct vnode pointer in softdep_disk_prewrite(). Reviewed by: phk Tested by: kensmith
* Fix the remaining warnings of growfs(8) on my sparc64 box withmux2004-04-031-1/+1
| | | | | | | | WARNS=6. I don't change the WARNS level in the Makefile because I didn't tested this on other archs. The fs.h fix was suggested by: marcel Reviewed by: md5(1)
* Avoid doing bawrite to initialize inode block while holding cylinderkan2004-03-161-1/+3
| | | | | | | | | | group block locked. If filesystem has any active snapshots, bawrite can come back trying to allocate new snapshot data block from the same cylinder group and cause panic due to recursive lock attempt. PR: 64206 Reviewed by: mckusick Tested by: pjd
* When I was a kid my work table was one cluttered mess an cleaning it upphk2004-03-111-0/+30
| | | | | | | | | | | | | were a rather overwhelming task. I soon learned that if you don't know where you're going to store something, at least try to pile it next to something slightly related in the hope that a pattern emerges. Apply the same principle to the ffs/snapshot/softupdates code which have leaked into specfs: Add yet a buf-quasi-method and call it from the only two places I can see it can make a difference and implement the magic in ffs_softdep.c where it belongs. It's not pretty, but at least it's one less layer violated.
* Properly vector all bwrite() and BUF_WRITE() calls through the same pathphk2004-03-111-10/+10
| | | | and s/BUF_WRITE()/bwrite()/ since it now does the same as bwrite().
* In the function clear_inodedeps(), a FREE_LOCK() should be calledmckusick2004-02-231-1/+1
| | | | | | | AFTER the call to vn_start_write(), not before it. Otherwise, it is possible to unlock it multiple times if the vn_start_write() fails. Submitted by: Juergen Hannken-Illjes <hannken@eis.cs.tu-bs.de>
* Fixed some style bugs:bde2004-02-141-18/+10
| | | | | | - don't unlock the vnode after vinvalbuf() only to have to relock it almost immediately. - don't refer to devices classified by vn_isdisk() as block devices.
* MFextfs: backed out secondary changes in rev.1.40 that had become justbde2004-02-131-6/+1
| | | | style bugs (a variable that is used only once, and misformattings).
* Fix style bugs in previous commit.kuriyama2004-02-131-2/+6
| | | | Submitted by: bde
* Fixed some minor style bugs (English usage and formatting of binarybde2004-02-121-12/+13
| | | | | | operators) in and near revs.1.169-1.170 (open mode bandaid). This (or better a proper fix) should have been done before cloning the bandaid to many other file systems.
* Reverse lock order by using local variable. This will shut up "acquiringkuriyama2004-02-121-4/+6
| | | | | | duplicate lock of same type" message. Reviewed by: mckusick
* Removed more vestiges of vfs_ioopt:bde2004-02-111-38/+4
| | | | | | | | | | | | - rev.1.42 of ffs_readwrite.c added a special case in ffs_read() for reads that are initially at EOF, and rev.1.62 of ufs_readwrite.c fixed timestamp bugs in it. Removal of most of vfs_ioopt made it just and optimization, and removal of the vm object reference calls made it less than an optimization. It was cloned in rev.1.94 of ufs_readwrite.c as part of cloning ffs_extwrite() although it was always less than an optimization in ffs_extwrite(). - some comments, compound statements and vertical whitespace were vestiges of dead code.
* Locking for the per-process resource limits structure.jhb2004-02-041-5/+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
* Remove unnecessary vm object reference and deallocate calls from ffs_read()alc2004-01-311-30/+0
| | | | | | | | and ffs_write(). These calls trace their origins to the dead vfs_ioopt code, first appearing in revision 1.39 of ufs_readwrite.c. Observed by: bde Discussed with: tegge
* Turn uio_resid/uio_offset comments into KASSERTsache2004-01-271-16/+8
| | | | Reviewed by: bde
* Copy comment about caller check from ffs_read to ffs_extread, don'tache2004-01-231-2/+6
| | | | check for uio_resid < 0 here too.
* Fix various panic() strings to reflect true function name to allowache2004-01-231-11/+12
| | | | | | easy grep. Small code reorganization to look more logic. Copy ffs_write check from prev. commit to ffs_extwrite.
* ffs_read:ache2004-01-231-7/+14
| | | | | | | | | | | | | | | | | | | Replace wrong check returned EFBIG with EOVERFLOW handling from POSIX: 36708 [EOVERFLOW] The file is a regular file, nbyte is greater than 0, the starting position is before the end-of-file, and the starting position is greater than or equal to the offset maximum established in the open file description associated with fildes. ffs_write: Replace u_int64_t cast with uoff_t cast which is more natural for types used. ffs_write & ffs_read: Remove uio_offset and uio_resid checks for negative values, the caller supposed to do it already. Add comments about it. Reviewed by: bde
* Spell magic '16' number as IO_SEQSHIFT.kan2004-01-191-2/+2
|
* Avoid calling vprint on a vnode while holding its interlock mutex.kan2004-01-041-2/+2
| | | | | | Move diagnostic printf after vget. This might delay the debug output some, but at least it keeps kernel from exploding if DEBUG_VFS_LOCKS is in effect.
* Set fs_ronly to the correct value in ffs_reload() when reloading the filetruckman2003-12-071-0/+2
| | | | | | | | | | | system super block after fsck has repaired the file system. The value of fs_ronly was getting overwritten, which caused ffs_update() to attempt to update inode timestamps even though the file system was still mounted read-only. This fixes the "giving up on N buffers" error that is triggered by running fsck on the root file system and then rebooting without mounting the file system read-write.
* Write the UFS2 superblock with a 'BAD' magic number at the beginningwes2003-11-161-0/+1
| | | | | | | | of newfs, to signify the newfs operation has not yet completed. Re- write the superblock with the correct magic number once all of the cylinder groups have been created to show the operation has finished. Sponsored by: St. Bernard Software
* Send B_PHYS out to pasture, it no longer serves any function.phk2003-11-151-1/+1
|
* Call free(9) after the vnode interlock is released, avoiding a lock-orderalc2003-11-131-1/+1
| | | | reversal.
* Update the statfs structure with 64-bit fields to allowmckusick2003-11-121-0/+11
| | | | | | | | | | | | | | | | | accurate reporting of multi-terabyte filesystem sizes. You should build and boot a new kernel BEFORE doing a `make world' as the new kernel will know about binaries using the old statfs structure, but an old kernel will not know about the new system calls that support the new statfs structure. Running an old kernel after a `make world' will cause programs such as `df' that do a statfs system call to fail with a bad system call. Reviewed by: Bruce Evans <bde@zeta.org.au> Reviewed by: Tim Robbins <tjr@freebsd.org> Reviewed by: Julian Elischer <julian@elischer.org> Reviewed by: the hoards of <arch@freebsd.org> Sponsored by: DARPA & NAI Labs.
* Remove mntvnode_mtx and replace it with per-mountpoint mutex.kan2003-11-052-20/+20
| | | | | | | | | | Introduce two new macros MNT_ILOCK(mp)/MNT_IUNLOCK(mp) to operate on this mutex transparently. Eventually new mutex will be protecting more fields in struct mount, not only vnode list. Discussed with: jeff
* Use VOP_UNLOCK/vrele instead of vput. td was erecived as a parameterkan2003-11-031-1/+2
| | | | and one cannot be sure it is equal to curthread.
* Take care not to call vput if thread used in corresponding vgetkan2003-11-021-2/+4
| | | | | | | | | | wasn't curthread, i.e. when we receive a thread pointer to use as a function argument. Use VOP_UNLOCK/vrele in these cases. The only case there td != curthread known at the moment is boot() calling sync with thread0 pointer. This fixes the panic on shutdown people have reported.
* Temporarily undo parts of the stuct mount locking commit by jeff.kan2003-11-011-6/+1
| | | | | | | | It is unsafe to hold a mutex across vput/vrele calls. This will be redone when a better locking strategy is agreed upon. Discussed with: jeff
* Tweak the calculation of minbfree in ffs_dirpref() so that onlytruckman2003-10-311-7/+7
| | | | | | | | | | | | | | | | | | | | | those cylinder groups that have at least 75% of the average free space per cylinder group for that file system are considered as candidates for the creation of a new directory. The previous formula for minbfree would set it to zero if the file system was more than 75% full, which allowed cylinder groups with no free space at all to be chosen as candidates for directory creation, which resulted in an expensive search for free blocks for each file that was subsequently created in that directory. Modify the calculation of minifree in the same way. Decrease maxcontigdirs as the file system fills to decrease the likelyhood that a cluster of directories will overflow the available space in a cylinder group. Reviewed by: mckusick Tested by: kmarx@vicor.com MFC after: 2 weeks
* Move the P_COWINPROGRESS flag from being a per-process p_flag to being ajhb2003-10-232-15/+15
| | | | | | | per-thread td_pflag which doesn't require any locks to read or write as it is only read or written by curthread on itself. Glanced at by: mckusick
* Initialize bp->b_offset to the physical offset in partitiontegge2003-10-221-6/+5
| | | | so GEOM knows where to read from disk.
* DuH!phk2003-10-181-1/+1
| | | | | bp->b_iooffset (the spot on the disk), not bp->b_offset (the offset in the file)
* Initialize bp->b_offset before calling VOP_[SPEC]STRATEGY()phk2003-10-181-0/+1
|
* When expunging unlinked files from a snapshot, skip over holes in themckusick2003-10-171-6/+16
| | | | | | file rather than panicing with "indiracct: botched params". Submitted by: Mark Santcroos <marks@ripe.net>
* - My last commit to this file is still not safe, I believe that it may bejeff2003-10-061-0/+6
| | | | due to the recursion in indir_trunc().
* - Reinstate 1.142 this was fixed by 1.144.jeff2003-10-061-3/+5
|
* - The VCHR case in ffs_sync() is an unneccsary optimization especiallyjeff2003-10-051-5/+2
| | | | | | | considering how infrequently we access devices via ffs now that we have devfs. Collapse this case with the other case. Obtained from: bde
* - Further simplify ffs_sync(). The vnode lock is required for UFS_UPDATE()jeff2003-10-051-16/+12
| | | | | | so make the code slightly more uniform. The vnode lock is acquired in all cases and now the only difference between VCHR and other is we call UFS_UPDATE instead of VOP_FSYNC().
* - In ffs_update() assert that either the vnode lock or the XLOCK is held.jeff2003-10-051-0/+4
|
* - Check the XLOCK before inspecting v_data.jeff2003-10-051-9/+25
| | | | | | | | | | | | - Slightly rewrite the fsync loop to be more lock friendly. We must acquire the vnode interlock before dropping the mnt lock. We must also check XLOCK to prevent vclean() races. - Use LK_INTERLOCK in the vget() in ffs_sync to further prevent vclean() races. - Use a local variable to store the results of the nvp == TAILQ_NEXT test so that we do not access the vp after we've vrele()d it. - Add an XXX comment about UFS_UPDATE() not being protected by any lock here. I suspect that it should need the VOP lock.
* - Skip over xvp if XLOCK is set.jeff2003-10-051-1/+2
|
* Synchronize access to a vm page's valid field using the containingalc2003-10-041-3/+4
| | | | vm object's lock.
* - The VI assert in getdirtybuf() is only valid if we're not on a VCHRjeff2003-10-041-1/+4
| | | | | | vnode. VCHR vnodes don't do background writes. Reported by: kan
* - Increase the scope of the interlock in ffs_reload(). Acquire it beforejeff2003-10-041-9/+6
| | | | | | | | we release the mntvnode_mtx. - Call vgonel() directly instead of going through vrecycle() since we own the interlock now. - Remove a few cases where we locked the interlock just so that we could call VOP_UNLOCK with interlock held.
* - Fix an unlocked call to GETATTR by slightly shuffling the code injeff2003-10-041-6/+14
| | | | | | ffs_snapshot() around. - Acquire the interlock before releasing the mntvnode_mtx. Use the interlock to protect v_usecount access.
* - Remove a mp_fixme() and some locks that weren't necessary. I nowjeff2003-10-041-6/+1
| | | | understand how this works.
* - Several of the callers to getdirtybuf() were erroneously changed to passjeff2003-09-031-9/+16
| | | | | | | | | in a list head instead of a pointer to the first element at the time of the first call. These lists are subject to change, and getdirtybuf() would refetch from the wrong list in some cases. Spottedy by: tegge Pointy hat to: me
OpenPOWER on IntegriCloud