summaryrefslogtreecommitdiffstats
path: root/sys/ufs
Commit message (Collapse)AuthorAgeFilesLines
* Make sure to update the mnt_stats before UFS1 extattr tried tophk2004-07-141-5/+4
| | | | | do I/O on the device. Otherwise the blocksize is undefined in the buffer cache.
* Make VFS_ROOT() and vflush() take a thread argument.alfred2004-07-123-5/+6
| | | | | | This is to allow filesystems to decide based on the passed thread which vnode to return. Several filesystems used curthread, they now use the passed thread.
* Update for the KDB debugger framework:marcel2004-07-102-6/+5
| | | | | | o Make debugging code conditional upon KDB. o Use kdb_backtrace() instead of backtrace(). o Remove inclusion of opt_ddb.h.
* Explicity initialize vp->v_bsize.phk2004-07-071-1/+3
|
* When we traverse the vnodes on a mountpoint we need to look out forphk2004-07-043-47/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | our cached 'next vnode' being removed from this mountpoint. If we find that it was recycled, we restart our traversal from the start of the list. Code to do that is in all local disk filesystems (and a few other places) and looks roughly like this: MNT_ILOCK(mp); loop: for (vp = TAILQ_FIRST(&mp...); (vp = nvp) != NULL; nvp = TAILQ_NEXT(vp,...)) { if (vp->v_mount != mp) goto loop; MNT_IUNLOCK(mp); ... MNT_ILOCK(mp); } MNT_IUNLOCK(mp); The code which takes vnodes off a mountpoint looks like this: MNT_ILOCK(vp->v_mount); ... TAILQ_REMOVE(&vp->v_mount->mnt_nvnodelist, vp, v_nmntvnodes); ... MNT_IUNLOCK(vp->v_mount); ... vp->v_mount = something; (Take a moment and try to spot the locking error before you read on.) On a SMP system, one CPU could have removed nvp from our mountlist but not yet gotten to assign a new value to vp->v_mount while another CPU simultaneously get to the top of the traversal loop where it finds that (vp->v_mount != mp) is not true despite the fact that the vnode has indeed been removed from our mountpoint. Fix: Introduce the macro MNT_VNODE_FOREACH() to traverse the list of vnodes on a mountpoint while taking into account that vnodes may be removed from the list as we go. This saves approx 65 lines of duplicated code. Split the insmntque() which potentially moves a vnode from one mount point to another into delmntque() and insmntque() which does just what the names say. Fix delmntque() to set vp->v_mount to NULL while holding the mountpoint lock.
* Annotate that we don't check the returned data length from ufs_readdir()rwatson2004-06-241-0/+6
| | | | | | because UFS uses fixed-size directory blocks. When using this code with other file systems, such as HFS+, the value of auio.uio_resid will need to be taken into account.
* Remove unnecessary setting of VV_SYSTEM on extended attribute backingrwatson2004-06-241-2/+0
| | | | | files. When this flag is used in our port of this code to Darwin, it caused remarkable pain, and doesn't offer a benefit in FreeBSD.
* Protect a non-text comment with a '-'.rwatson2004-06-241-1/+1
|
* White space cleanup: use spaces instead of tabs in variable declarationsrwatson2004-06-241-57/+55
| | | | | | | | local to a function. Remove a couple of blank lines in variable declarations. In one case, explicitly test against NULL rather than using a pointer as a boolean directly.
* Backed out previous commit. The dev_t -> `struct cdev *' changes havebde2004-06-201-1/+1
| | | | | | | lots of errors. Blind substitution of "dev_t foo" by "struct cdev *foo" in comments usually just created an English syntax error (e.g., "struct cdev *changes"), but here it did less than that since the dev_t is a user dev_t.
* Avoid deadlock which is caused by locking VDIR of parent and VREG ofkuriyama2004-06-181-0/+9
| | | | | | | | snapshot itself in wrong order. We can skip unlink check of that directory because it must have snapshot in it. Reviewed by: mckusick and current@
* Do the dreaded s/dev_t/struct cdev */phk2004-06-166-10/+10
| | | | Bump __FreeBSD_version accordingly.
* Nice, is a property of a process as a whole..julian2004-06-161-4/+4
| | | | | I mistakenly moved it to the ksegroup when breaking up the process structure. Put it back in the proc structure.
* Avoid assignments to cast expressions.stefanf2004-06-081-2/+2
| | | | | Reviewed by: md5 Approved by: das (mentor)
* Move TDF_DEADLKTREAT into td_pflags (and rename it accordingly) to avoidtjr2004-06-031-2/+2
| | | | | | | having to acquire sched_lock when manipulating it in lockmgr(), uiomove(), and uiomove_fromphys(). Reviewed by: jhb
* - Fix typokrion2004-05-311-1/+1
| | | | Approved by: tobez
* Upon further review it was decided this piece of the msync(2)kensmith2004-05-211-0/+2
| | | | | | | | | | fixes was applicable to HEAD, originally it was thought this should only be done in RELENG_4. Implement IO_INVAL in the vnode op for writing by marking the buffer as "no cache". This fix has already been applied to RELENG_4 as Rev. 1.65.2.15 of ufs/ufs/ufs_readwrite.c. Reviewed by: alc, tegge
* Style fixup in previous commit.kensmith2004-05-191-4/+2
| | | | Noticed by: bde (thanks!)
* Change ffs_realloccg() to set the valid bits for the extended part of thekensmith2004-05-141-2/+10
| | | | | | | | fragment to zero the valid parts of a VM_IO buffer. RE would like this to be part of 4.10-RC3 so this will be MFC-ed immediately. Reviewed by: alc, tegge
* Revert previous change to this file because it breaks somebmilekic2004-04-291-9/+2
| | | | | | | | | | things which compare /etc/fstab entries to results from getfsstat(). The real way to fix this is to make 'ufs2' a recognized filesystem (for real, no beating around the bush). This should fix things like 'umount -a -t ufs' now. Appologies for the previous breakage.
* The previous change to mount(8) to report ufs or ufs2 usedbmilekic2004-04-261-2/+9
| | | | | | | | | | | libufs, which only works for Charlie root. This change reverts the introduction of libufs and moves the check into the kernel. Since the f_fstypename is the same for both ufs and ufs2, we check fs_magic for presence of ufs2 and copy "ufs2" explicitly instead. Submitted by: Christian S.J. Peron <maneo@bsdpro.com>
* 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-0721-84/+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-112-1/+32
| | | | | | | | | | | | | 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-113-19/+19
| | | | and s/BUF_WRITE()/bwrite()/ since it now does the same as bwrite().
* A more accurate test in the new ufs_lock than that in 1.235.mckusick2004-02-231-2/+3
|
* 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>
* Change UFS from using vop_stdlock to using its own ufs_lock.mckusick2004-02-231-0/+28
| | | | | | | | | | In ufs_lock, check for attempts to acquire shared locks on snapshot files and change them to be exclusive locks. This change eliminates deadlocks and machine lockups reported in -current since most read requests started using shared lock requests. Submitted by: Jun Kuriyama <kuriyama@imgsrc.co.jp>
* Update my personal copyrights and NETA copyrights in the kernelrwatson2004-02-221-2/+2
| | | | | | | | to use the "year1-year3" format, as opposed to "year1, year2, year3". This seems to make lawyers more happy, but also prevents the lines from getting excessively long as the years start to add up. Suggested by: imp
* Abstract dirhash's locking using macros. This should make it easier todwmalone2004-02-151-69/+75
| | | | | | | | use the same dirhash code on different branches/platforms. Reviewed by: Ted Unangst <tedu@zeitbombe.org> Reviewed by: iedowse MFC after: 3 weeks
* 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
|
OpenPOWER on IntegriCloud