aboutsummaryrefslogtreecommitdiff
path: root/sys/gnu/ext2fs/ext2_vfsops.c
Commit message (Collapse)AuthorAgeFilesLines
* Move ext2fs from src/gnu to src/gnu/fs.Craig Rodrigues2005-06-151-1128/+0
| | | | | | | | | | | Discussed on arch@. Reviewed by: kan Approved by: re (blanket), kan Discussed with: dumbbell Notes: svn path=/head/; revision=147401
* - Update vfs_root implementations to match the new prototype. None ofJeff Roberson2005-03-241-1/+2
| | | | | | | | | | | these filesystems will support shared locks until they are explicitly modified to do so. Careful review must be done to ensure that this is safe for each individual filesystem. Sponsored by: Isilon Systems, Inc. Notes: svn path=/head/; revision=144059
* Add two arguments to the vfs_hash() KPI so that filesystems which doPoul-Henning Kamp2005-03-161-2/+2
| | | | | | | not have unique hashes (NFS) can also use it. Notes: svn path=/head/; revision=143692
* Don't hold a reference to the disk vnode for each inode.Poul-Henning Kamp2005-03-161-2/+0
| | | | | | | | Don't store the disk cdev in all inodes, it's only used for debugging printfs. Notes: svn path=/head/; revision=143677
* Improve the vfs_hash() API: vput() the unneeded vnode centrally toPoul-Henning Kamp2005-03-151-3/+1
| | | | | | | avoid replicating the vput in all the filesystems. Notes: svn path=/head/; revision=143663
* Simplify the vfs_hash calling convention.Poul-Henning Kamp2005-03-151-23/+3
| | | | Notes: svn path=/head/; revision=143619
* Use vfs_hash() instead of home-rolledPoul-Henning Kamp2005-03-141-53/+27
| | | | Notes: svn path=/head/; revision=143578
* - Catch up with ufs_inode 1.59, ffs_vfsops.c 1.280, and ufs_vnops.c 1.267.Jeff Roberson2005-03-131-11/+4
| | | | | | | | | Various changes to support new vgone() locking protocol. Sponsored by: Isilon Systems, Inc. Notes: svn path=/head/; revision=143509
* Introduce and use g_vfs_close().Poul-Henning Kamp2005-01-251-2/+2
| | | | Notes: svn path=/head/; revision=140822
* Create a vp->v_object in VFS_FHTOVP() if we want to be exportablePoul-Henning Kamp2005-01-241-0/+1
| | | | | | | | | | | | | | | | with NFS. We are moving responsibility for creating the vnode_pager object into the filesystems which own the vnode, and this is one of the places we have to cover. We call vnode_create_vobject() directly because we own the vnode. If we can get the size easily, pass it as an argument to save the call to VOP_GETATTR() in vnode_create_vobject() Notes: svn path=/head/; revision=140768
* Remove unused cred argument to ext2_reload()Poul-Henning Kamp2005-01-241-6/+3
| | | | Notes: svn path=/head/; revision=140736
* Eliminate unused and unnecessary "cred" argument from vinvalbuf()Poul-Henning Kamp2005-01-141-2/+2
| | | | Notes: svn path=/head/; revision=140220
* Remove the unused credential argument from VOP_FSYNC() and VFS_SYNC().Poul-Henning Kamp2005-01-111-5/+4
| | | | | | | | | | | | | | | | | | | | | I'm not sure why a credential was added to these in the first place, it is not used anywhere and it doesn't make much sense: The credentials for syncing a file (ability to write to the file) should be checked at the system call level. Credentials for syncing one or more filesystems ("none") should be checked at the system call level as well. If the filesystem implementation needs a particular credential to carry out the syncing it would logically have to the cached mount credential, or a credential cached along with any delayed write data. Discussed with: rwatson Notes: svn path=/head/; revision=140048
* /* -> /*- for copyright notices, minor format tweaks as necessaryWarner Losh2005-01-061-2/+2
| | | | Notes: svn path=/head/; revision=139778
* Convert to nmount. Add omount compat code.Poul-Henning Kamp2004-12-061-10/+13
| | | | Notes: svn path=/head/; revision=138493
* VFS_STATFS(mp, ...) is mostly called with &mp->mnt_stat, but a few casesPoul-Henning Kamp2004-12-051-7/+0
| | | | | | | | | | | doesn't. Most of the implementations have grown weeds for this so they copy some fields from mnt_stat if the passed argument isn't that. Fix this the cleaner way: Always call the implementation on mnt_stat and copy that in toto to the VFS_STATFS argument if different. Notes: svn path=/head/; revision=138412
* Remove #if 0'ed rootfs mounting code.Poul-Henning Kamp2004-12-041-58/+0
| | | | Notes: svn path=/head/; revision=138368
* Back when VOP_* was introduced, we did not have new-style structPoul-Henning Kamp2004-12-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | initializations but we did have lofty goals and big ideals. Adjust to more contemporary circumstances and gain type checking. Replace the entire vop_t frobbing thing with properly typed structures. The only casualty is that we can not add a new VOP_ method with a loadable module. History has not given us reason to belive this would ever be feasible in the the first place. Eliminate in toto VOCALL(), vop_t, VNODEOP_SET() etc. Give coda correct prototypes and function definitions for all vop_()s. Generate a bit more data from the vnode_if.src file: a struct vop_vector and protype typedefs for all vop methods. Add a new vop_bypass() and make vop_default be a pointer to another struct vop_vector. Remove a lot of vfs_init since vop_vector is ready to use from the compiler. Cast various vop_mumble() to void * with uppercase name, for instance VOP_PANIC, VOP_NULL etc. Implement VCALL() by making vdesc_offset the offsetof() the relevant function pointer in vop_vector. This is disgusting but since the code is generated by a script comparatively safe. The alternative for nullfs etc. would be much worse. Fix up all vnode method vectors to remove casts so they become typesafe. (The bulk of this is generated by scripts) Notes: svn path=/head/; revision=138290
* Get even closer to not crashing ext2fsPoul-Henning Kamp2004-11-061-1/+1
| | | | Notes: svn path=/head/; revision=137321
* Get closer to unbreaking ext2fsPoul-Henning Kamp2004-11-061-0/+2
| | | | Notes: svn path=/head/; revision=137320
* Move EXT2FS to GEOM backing instead of DEVFS.Poul-Henning Kamp2004-10-291-43/+42
| | | | | | | For details, please see src/sys/ufs/ffs/ffs_vfsops.c 1.250. Notes: svn path=/head/; revision=137039
* Reduce the locking activity by epsilon by checking VNON condition beforePoul-Henning Kamp2004-10-281-4/+3
| | | | | | | releasing the mountlock. Notes: svn path=/head/; revision=137008
* Loose the v_dirty* and v_clean* alias macros.Poul-Henning Kamp2004-10-251-1/+2
| | | | | | | | Check the count field where we just want to know the full/empty state, rather than using TAILQ_EMPTY() or TAILQ_FIRST(). Notes: svn path=/head/; revision=136943
* Desupport device nodes on EXT2 filesystems.Poul-Henning Kamp2004-09-271-1/+1
| | | | Notes: svn path=/head/; revision=135864
* Put a version element in the VFS filesystem configuration structurePoul-Henning Kamp2004-07-301-5/+5
| | | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=132902
* Remove global variable rootdevs and rootvp, they are unused as such.Poul-Henning Kamp2004-07-281-1/+2
| | | | | | | | | | | 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. Notes: svn path=/head/; revision=132805
* Make VFS_ROOT() and vflush() take a thread argument.Alfred Perlstein2004-07-121-2/+3
| | | | | | | | | 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. Notes: svn path=/head/; revision=132023
* When we traverse the vnodes on a mountpoint we need to look out forPoul-Henning Kamp2004-07-041-14/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=131551
* Do the dreaded s/dev_t/struct cdev */Poul-Henning Kamp2004-06-161-4/+4
| | | | | | | Bump __FreeBSD_version accordingly. Notes: svn path=/head/; revision=130585
* Remove advertising clause from University of California Regent'sWarner Losh2004-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 Notes: svn path=/head/; revision=128019
* Remove unused mnt_reservedvnlist field.Poul-Henning Kamp2004-03-111-1/+0
| | | | Notes: svn path=/head/; revision=126852
* Enforce the file size limit in VOP_WRITE() as well as VOP_TRUNCATE();Tim J. Robbins2004-02-191-0/+5
| | | | | | | pointed out by bde. Notes: svn path=/head/; revision=125991
* Removed support for the unsupported option READONLY. It just forcedBruce Evans2004-02-151-4/+0
| | | | | | | dishonoring of requests for read-write mounts. Notes: svn path=/head/; revision=125842
* MFffs (ffs_vfsops.c 1.76 (part of the big soft updates commit): lockBruce Evans2004-02-131-4/+10
| | | | | | | | | | | | | 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). Notes: svn path=/head/; revision=125786
* MFffs (ffs_vfsops.c 1.227: clean up open mode bandaid). This reducesBruce Evans2004-02-121-12/+13
| | | | | | | gratuitous differences with ffs a little. Notes: svn path=/head/; revision=125739
* Copy workaround from FFS: open device for write access even ifTim J. Robbins2004-01-241-0/+19
| | | | | | | | | | | 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 Notes: svn path=/head/; revision=124908
* Fixed a reference to a nonexistent variable in previous commit. RenamingBruce Evans2003-11-051-9/+8
| | | | | | | | | | | 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. Notes: svn path=/head/; revision=122114
* Remove mntvnode_mtx and replace it with per-mountpoint mutex.Alexander Kabaev2003-11-051-11/+11
| | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=122091
* Use VOP_UNLOCK/vrele instead of vput. td was erecived as a parameterAlexander Kabaev2003-11-031-2/+4
| | | | | | | and one cannot be sure it is equal to curthread. Notes: svn path=/head/; revision=121925
* Take care not to call vput if thread used in corresponding vgetAlexander Kabaev2003-11-021-1/+2
| | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=121874
* Temporarily undo parts of the stuct mount locking commit by jeff.Alexander Kabaev2003-11-011-2/+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 Notes: svn path=/head/; revision=121847
* - File systems that wish to inspect the vnode contents or their privateJeff Roberson2003-10-051-0/+8
| | | | | | | | | 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. Notes: svn path=/head/; revision=120783
* - Don't use vrecycle() call vgonel() directly after grabing the vnodeJeff Roberson2003-10-041-4/+6
| | | | | | | | 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. Notes: svn path=/head/; revision=120751
* - Clean-up comments that refer to the use of B_LOCKED.Jeff Roberson2003-08-281-1/+0
| | | | Notes: svn path=/head/; revision=119513
* Add a "int fd" argument to VOP_OPEN() which in the future willPoul-Henning Kamp2003-07-261-1/+1
| | | | | | | | | | | | contain the filedescriptor number on opens from userland. The index is used rather than a "struct file *" since it conveys a bit more information, which may be useful to in particular fdescfs and /dev/fd/* For now pass -1 all over the place. Notes: svn path=/head/; revision=118047
* Initialize struct vfsops C99-sparsely.Poul-Henning Kamp2003-06-121-25/+21
| | | | | | | | Submitted by: hmp Reviewed by: phk Notes: svn path=/head/; revision=116271
* - Add a new 'flags' parameter to getblk().Jeff Roberson2003-03-041-1/+1
| | | | | | | | | | | | | - Define one flag GB_LOCK_NOWAIT that tells getblk() to pass the LK_NOWAIT flag to the initial BUF_LOCK(). This will eventually be used in cases were we want to use a buffer only if it is not currently in use. - Convert all consumers of the getblk() api to use this extra parameter. Reviwed by: arch Not objected to by: mckusick Notes: svn path=/head/; revision=111856
* Back out M_* changes, per decision of the TRB.Warner Losh2003-02-191-6/+6
| | | | | | | Approved by: trb Notes: svn path=/head/; revision=111119
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.Alfred Perlstein2003-01-211-6/+6
| | | | | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. Notes: svn path=/head/; revision=109623
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,Jens Schweikhardt2003-01-011-2/+2
| | | | | | | especially in troff files. Notes: svn path=/head/; revision=108533