summaryrefslogtreecommitdiffstats
path: root/sys/gnu
Commit message (Collapse)AuthorAgeFilesLines
* Reduce the locking activity by epsilon by checking VNON condition beforephk2004-10-282-8/+6
| | | | releasing the mountlock.
* Eliminate unnecessary KASSERTs.phk2004-10-274-8/+2
| | | | Don't use bp->b_vp in VOP_STRATEGY: the vnode is passed in as an argument.
* Loose the v_dirty* and v_clean* alias macros.phk2004-10-254-6/+8
| | | | | Check the count field where we just want to know the full/empty state, rather than using TAILQ_EMPTY() or TAILQ_FIRST().
* Move the buffer method vector (buf->b_op) to the bufobj.phk2004-10-244-4/+4
| | | | | | | | | | | | | | | | | Extend it with a strategy method. Add bufstrategy() which do the usual VOP_SPECSTRATEGY/VOP_STRATEGY song and dance. Rename ibwrite to bufwrite(). Move the two NFS buf_ops to more sensible places, add bufstrategy to them. Add inlines for bwrite() and bstrategy() which calls through buf->b_bufobj->b_ops->b_{write,strategy}(). Replace almost all VOP_STRATEGY()/VOP_SPECSTRATEGY() calls with bstrategy().
* Add b_bufobj to struct buf which eventually will eliminate the need for b_vp.phk2004-10-222-2/+2
| | | | | | | | | | | | | | | | | | Initialize b_bufobj for all buffers. Make incore() and gbincore() take a bufobj instead of a vnode. Make inmem() local to vfs_bio.c Change a lot of VI_[UN]LOCK(bp->b_vp) to BO_[UN]LOCK(bp->b_bufobj) also VI_MTX() to BO_MTX(), Make buf_vlist_add() take a bufobj instead of a vnode. Eliminate other uses of bp->b_vp where bp->b_bufobj will do. Various minor polishing: remove "register", turn panic into KASSERT, use new function declarations, TAILQ_FOREACH_SAFE() etc.
* Desupport device nodes on EXT2 filesystems.phk2004-09-276-238/+24
|
* Give cluster_write() an explicit vnode argument.phk2004-09-272-2/+2
| | | | In the future a struct buf will not automatically point out a vnode for us.
* Create simple function init_va_filerev() for initializing a va_filerevphk2004-09-072-48/+2
| | | | | | | | | field. Replace three instances of longhaired initialization va_filerev fields. Added XXX comment wondering why we don't use random bits instead of uptime of the system for this purpose.
* Add locking to the kqueue subsystem. This also makes the kqueue subsystemjmg2004-08-152-16/+10
| | | | | | | | | | | | | a more complete subsystem, and removes the knowlege of how things are implemented from the drivers. Include locking around filter ops, so a module like aio will know when not to be unloaded if there are outstanding knotes using it's filter ops. Currently, it uses the MTX_DUPOK even though it is not always safe to aquire duplicate locks. Witness currently doesn't support the ability to discover if a dup lock is ok (in some cases). Reviewed by: green, rwatson (both earlier versions)
* Put a version element in the VFS filesystem configuration structurephk2004-07-302-10/+10
| | | | | | | | | | | | | | | | | | and refuse initializing filesystems with a wrong version. This will aid maintenance activites on the 5-stable branch. s/vfs_mount/vfs_omount/ s/vfs_nmount/vfs_mount/ Name our filesystems mount function consistently. Eliminate the namiedata argument to both vfs_mount and vfs_omount. It was originally there to save stack space. A few places abused it to get hold of some credentials to pass around. Effectively it is unused. Reorganize the root filesystem selection code.
* Remove global variable rootdevs and rootvp, they are unused as such.phk2004-07-282-2/+4
| | | | | | | | Add local rootvp variables as needed. Remove checks for miniroot's in the swappartition. We never did that and most of the filesystems could never be used for that, but it had still been copy&pasted all over the place.
* Rename suser_cred()'s PRISON_ROOT flag to SUSER_ALLOWJAIL. This iscperciva2004-07-262-10/+10
| | | | | | | | | | | somewhat clearer, but more importantly allows for a consistent naming scheme for suser_cred flags. The old name is still defined, but will be removed in a few days (unless I hear any complaints...) Discussed with: rwatson, scottl Requested by: jhb
* Make VFS_ROOT() and vflush() take a thread argument.alfred2004-07-122-4/+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 framework:marcel2004-07-102-10/+6
| | | | o Make debugging code conditional upon KDB instead of DDB.
* When we traverse the vnodes on a mountpoint we need to look out forphk2004-07-042-28/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fixed misformatting of code and breaking of a comment in previous commit.bde2004-06-202-4/+4
|
* Fixed misformatting in previous commit.bde2004-06-202-2/+2
|
* Do the dreaded s/dev_t/struct cdev */phk2004-06-169-20/+20
| | | | Bump __FreeBSD_version accordingly.
* Remove advertising clause from University of California Regent'simp2004-04-0727-108/+0
| | | | | | | license, per letter dated July 22, 1999 and email from Peter Wemm, Alan Cox and Robert Watson. Approved by: core, peter, alc, rwatson
* Properly vector all bwrite() and BUF_WRITE() calls through the same pathphk2004-03-112-8/+8
| | | | and s/BUF_WRITE()/bwrite()/ since it now does the same as bwrite().
* Remove unused mnt_reservedvnlist field.phk2004-03-112-2/+0
|
* Remove unused second arg to vfinddev().phk2004-03-112-2/+6
| | | | Don't call addaliasu() on VBLK nodes.
* Enforce the file size limit in VOP_WRITE() as well as VOP_TRUNCATE();tjr2004-02-198-32/+22
| | | | pointed out by bde.
* Add partial support for large (>4GB) files on ext2 filesystems. Thistjr2004-02-186-2/+32
| | | | | | | | support is partial in that it will refuse to create large files on filesystems that haven't been upgraded to EXT2_DYN_REV or that don't have the EXT2_FEATURE_RO_COMPAT_LARGE_FILE flag set in the superblock. MFC after: 2 weeks
* Fixed misspellings of "ext2_*" as "ufs_*" and " "ext2fs_*", and ofbde2004-02-152-14/+12
| | | | | "independent" as "dependent" Fixed some other relatively minor wording and formatting errors.
* Removed support for the unsupported option READONLY. It just forcedbde2004-02-152-8/+0
| | | | dishonoring of requests for read-write mounts.
* MFffs (ffs_vfsops.c 1.76 (part of the big soft updates commit): lockbde2004-02-132-8/+20
| | | | | | | | | | the vnode around calls to vinvalbuf()). Apparently no one has tested ext2fs with DEBUG_VOP_LOCKS. Vnode locking for vinvalbuf() might not be required in non-soft-updates cases, but it is now asserted. MFffs (uncommitted related and nearby cleanups: 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).
* Fixed longstanding brokenness of inode updates. The waitfor flag wasbde2004-02-132-8/+0
| | | | | | | | | | | | dishonored in rev.1.1 by commenting out the code that honored it. This gave the worst disadvantages of async mounts in an uncontrollable way. Honoring the flag costs about 50% in real time in worst cases on a new but not very fast ATA drive with write caching (probably more on drives without write caching). The old misbehavior can be recovered using async mounts after implementing them in mount_ext2fs(8) (just put the MNT_ASYNC flag in mount_ext2fs's table of supported options like it is in mount's table).
* MFffs (ffs_vfsops.c 1.227: clean up open mode bandaid). This reducesbde2004-02-122-24/+26
| | | | gratuitous differences with ffs a little.
* Locking for the per-process resource limits structure.jhb2004-02-042-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* Copy workaround from FFS: open device for write access even iftjr2004-01-242-0/+38
| | | | | | | | the user requests a read-only mount. This is necessary because we don't do the VOP_OPEN again if they upgrade a read-only mount to read-write. Noticed by: bde
* Spell magic '16' number as IO_SEQSHIFT.kan2004-01-192-6/+6
|
* This commit was generated by cvs2svn to compensate for changes in r124361,obrien2004-01-111-10/+19
|\ | | | | | | which included commits to RCS files with non-trunk default branches.
| * Vendor import emu10k1.h from version 1.0.1 of the ALSA driver.obrien2004-01-111-10/+19
| | | | | | | | | | ftp://ftp.alsa-project.org/pub/driver/alsa-driver-1.0.1.tar.bz2 or http://www.alsa-project.org/alsa/cvs/alsa-kernel/include/emu10k1.h
* | Sync with Creative's 8010.h rev 1.51.obrien2004-01-091-74/+140
| |
* | Dike out some very Linux-specific parts that we can't compile with.obrien2004-01-091-0/+8
| | | | | | | | Also protect AC97_MUTE which is also defined in our own ac97.h.
* | This commit was generated by cvs2svn to compensate for changes in r124273,obrien2004-01-091-2/+42
|\ \ | |/ | | | | which included commits to RCS files with non-trunk default branches.
| * Vendor import revision 1.9 of ac97_codec.h (we renamed the file) fromobrien2004-01-091-2/+42
| | | | | | | | http://cvs.sourceforge.net/viewcvs.py/emu10k1/emu10k1/ac97_codec.h
* | Fixed a reference to a nonexistent variable in previous commit. Renamingbde2003-11-052-18/+16
| | | | | | | | | | | | | | | | of ffs_reload()'s mountp parameter to mp in rev.1.28 of ffs_vnops.c had not been merged here. ext2fs_reload() is still missing locking from not merging other changes to ffs_reload(), but none of these is related to recent locking changes.
* | Remove mntvnode_mtx and replace it with per-mountpoint mutex.kan2003-11-052-22/+22
| | | | | | | | | | | | | | | | | | | | 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
* | Remove alpha-bitops.h now that it's unused. It's in the attic ifmarcel2003-11-031-255/+0
| | | | | | | | we want it again.
* | Use VOP_UNLOCK/vrele instead of vput. td was erecived as a parameterkan2003-11-032-4/+8
| | | | | | | | and one cannot be sure it is equal to curthread.
* | Take care not to call vput if thread used in corresponding vgetkan2003-11-022-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-012-4/+2
| | | | | | | | | | | | | | | | 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
* | Fix the alpha tinderbox. The alpha specific bitops used by the bitmapmarcel2003-10-294-12/+4
| | | | | | | | | | | | | | | | | | | | code has the typical branch prediction detour, which creates cross- section branches. A LINT kernel is apparently large enough nowadays that the .text and .text2 sections cannot always be layed-out so that branches between them reach. The fix is to stop using the alpha-specific bitops and instead use the portable implementation used by all platforms other than alpha and i386.
* | DuH!phk2003-10-186-6/+6
| | | | | | | | | | 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-186-0/+6
| |
* | - File systems that wish to inspect the vnode contents or their privatejeff2003-10-052-0/+16
| | | | | | | | | | | | v_data field before calling vget/vn_lock must check VI_XLOCK manually to be sure that v_data is still valid. Implement this check in two places here.
* | - Don't cache_purge() in ext2_reclaim. vclean() does it for us sojeff2003-10-052-2/+0
| | | | | | | | this is redundant.
* | - Don't use vrecycle() call vgonel() directly after grabing the vnodejeff2003-10-042-8/+12
| | | | | | | | | | interlock. We do this so that we still hold the interlock when we lock the vnode later. This prevents races with the mnt vnode list.
OpenPOWER on IntegriCloud