diff options
author | Mateusz Guzik <mjg@FreeBSD.org> | 2020-08-16 17:18:54 +0000 |
---|---|---|
committer | Mateusz Guzik <mjg@FreeBSD.org> | 2020-08-16 17:18:54 +0000 |
commit | a92a971bbb94ad5b44e2a5bbdc669ad3ae762c8d (patch) | |
tree | 2b25fe1e41aaf0791b26dd5a4b8ad0cad897fe6e | |
parent | d59f3890c36601f4f62bb4a0b7db977e42339588 (diff) | |
download | src-test2-a92a971bbb94ad5b44e2a5bbdc669ad3ae762c8d.tar.gz src-test2-a92a971bbb94ad5b44e2a5bbdc669ad3ae762c8d.zip |
Notes
-rw-r--r-- | sys/compat/linuxkpi/common/include/linux/fs.h | 2 | ||||
-rw-r--r-- | sys/fs/autofs/autofs_vnops.c | 2 | ||||
-rw-r--r-- | sys/fs/ext2fs/ext2_vfsops.c | 4 | ||||
-rw-r--r-- | sys/fs/fdescfs/fdesc_vfsops.c | 2 | ||||
-rw-r--r-- | sys/fs/fdescfs/fdesc_vnops.c | 4 | ||||
-rw-r--r-- | sys/fs/fuse/fuse_vfsops.c | 2 | ||||
-rw-r--r-- | sys/fs/msdosfs/msdosfs_vfsops.c | 2 | ||||
-rw-r--r-- | sys/fs/nfsclient/nfs_clvfsops.c | 2 | ||||
-rw-r--r-- | sys/fs/nullfs/null_vfsops.c | 2 | ||||
-rw-r--r-- | sys/fs/pseudofs/pseudofs_vncache.c | 4 | ||||
-rw-r--r-- | sys/fs/smbfs/smbfs_node.c | 2 | ||||
-rw-r--r-- | sys/fs/smbfs/smbfs_vfsops.c | 2 | ||||
-rw-r--r-- | sys/fs/tmpfs/tmpfs_subr.c | 2 | ||||
-rw-r--r-- | sys/fs/tmpfs/tmpfs_vfsops.c | 3 | ||||
-rw-r--r-- | sys/kern/uipc_mqueue.c | 2 | ||||
-rw-r--r-- | sys/kern/vfs_default.c | 2 | ||||
-rw-r--r-- | sys/kern/vfs_subr.c | 6 | ||||
-rw-r--r-- | sys/sys/vnode.h | 2 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_alloc.c | 2 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_softdep.c | 3 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 7 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_quota.c | 7 | ||||
-rw-r--r-- | sys/vm/vm_fault.c | 4 | ||||
-rw-r--r-- | sys/vm/vm_mmap.c | 4 | ||||
-rw-r--r-- | sys/vm/vm_pageout.c | 2 |
25 files changed, 35 insertions, 41 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/fs.h b/sys/compat/linuxkpi/common/include/linux/fs.h index 7f5993bd7754..f400fc7cbfda 100644 --- a/sys/compat/linuxkpi/common/include/linux/fs.h +++ b/sys/compat/linuxkpi/common/include/linux/fs.h @@ -260,7 +260,7 @@ igrab(struct inode *inode) { int error; - error = vget(inode, 0, curthread); + error = vget(inode, 0); if (error) return (NULL); diff --git a/sys/fs/autofs/autofs_vnops.c b/sys/fs/autofs/autofs_vnops.c index e9e058933e5b..a9bfcc56b65b 100644 --- a/sys/fs/autofs/autofs_vnops.c +++ b/sys/fs/autofs/autofs_vnops.c @@ -656,7 +656,7 @@ autofs_node_vn(struct autofs_node *anp, struct mount *mp, int flags, vp = anp->an_vnode; if (vp != NULL) { - error = vget(vp, flags | LK_RETRY, curthread); + error = vget(vp, flags | LK_RETRY); if (error != 0) { AUTOFS_WARN("vget failed with error %d", error); sx_xunlock(&anp->an_vnode_lock); diff --git a/sys/fs/ext2fs/ext2_vfsops.c b/sys/fs/ext2fs/ext2_vfsops.c index f40fb7202e45..5aff9bdb2ff2 100644 --- a/sys/fs/ext2fs/ext2_vfsops.c +++ b/sys/fs/ext2fs/ext2_vfsops.c @@ -799,7 +799,7 @@ loop: /* * Step 4: invalidate all cached file data. */ - if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td)) { + if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK)) { MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp); goto loop; } @@ -1158,7 +1158,7 @@ loop: VI_UNLOCK(vp); continue; } - error = vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, td); + error = vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK); if (error) { if (error == ENOENT) { MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp); diff --git a/sys/fs/fdescfs/fdesc_vfsops.c b/sys/fs/fdescfs/fdesc_vfsops.c index e6aa9b9a2341..e7878f115ac2 100644 --- a/sys/fs/fdescfs/fdesc_vfsops.c +++ b/sys/fs/fdescfs/fdesc_vfsops.c @@ -163,7 +163,7 @@ fdesc_root(struct mount *mp, int flags, struct vnode **vpp) * Return locked reference to root. */ vp = VFSTOFDESC(mp)->f_root; - vget(vp, LK_EXCLUSIVE | LK_RETRY, curthread); + vget(vp, LK_EXCLUSIVE | LK_RETRY); *vpp = vp; return (0); } diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c index 732d679f6deb..87fcb7160bbb 100644 --- a/sys/fs/fdescfs/fdesc_vnops.c +++ b/sys/fs/fdescfs/fdesc_vnops.c @@ -182,7 +182,7 @@ loop: vp = fd->fd_vnode; VI_LOCK(vp); mtx_unlock(&fdesc_hashmtx); - if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td)) + if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK)) goto loop; *vpp = vp; return (0); @@ -232,7 +232,7 @@ loop: vp2 = fd2->fd_vnode; VI_LOCK(vp2); mtx_unlock(&fdesc_hashmtx); - error = vget(vp2, LK_EXCLUSIVE | LK_INTERLOCK, td); + error = vget(vp2, LK_EXCLUSIVE | LK_INTERLOCK); /* Someone beat us, dec use count and wait for reclaim */ vgone(vp); vput(vp); diff --git a/sys/fs/fuse/fuse_vfsops.c b/sys/fs/fuse/fuse_vfsops.c index 93e2b922b765..ce7ffeda2498 100644 --- a/sys/fs/fuse/fuse_vfsops.c +++ b/sys/fs/fuse/fuse_vfsops.c @@ -610,7 +610,7 @@ fuse_vfsop_root(struct mount *mp, int lkflags, struct vnode **vpp) int err = 0; if (data->vroot != NULL) { - err = vget(data->vroot, lkflags, curthread); + err = vget(data->vroot, lkflags); if (err == 0) *vpp = data->vroot; } else { diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index 2d0c10d519e3..8d0686469068 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -921,7 +921,7 @@ loop: VI_UNLOCK(vp); continue; } - error = vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, td); + error = vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK); if (error) { if (error == ENOENT) { MNT_VNODE_FOREACH_ALL_ABORT(mp, nvp); diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c index e97d42f4a381..3a12af68bfe1 100644 --- a/sys/fs/nfsclient/nfs_clvfsops.c +++ b/sys/fs/nfsclient/nfs_clvfsops.c @@ -1828,7 +1828,7 @@ loop: VI_UNLOCK(vp); continue; } - if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td)) { + if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK)) { MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp); goto loop; } diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c index cdce2872e239..a3d23d350188 100644 --- a/sys/fs/nullfs/null_vfsops.c +++ b/sys/fs/nullfs/null_vfsops.c @@ -281,7 +281,7 @@ nullfs_root(mp, flags, vpp) NULLFSDEBUG("nullfs_root(mp = %p, vp = %p)\n", mp, mntdata->nullm_lowerrootvp); - error = vget(mntdata->nullm_lowerrootvp, flags, curthread); + error = vget(mntdata->nullm_lowerrootvp, flags); if (error == 0) { error = null_nodeget(mp, mntdata->nullm_lowerrootvp, &vp); if (error == 0) { diff --git a/sys/fs/pseudofs/pseudofs_vncache.c b/sys/fs/pseudofs/pseudofs_vncache.c index 6fd73babaf30..8d6f56f6fe27 100644 --- a/sys/fs/pseudofs/pseudofs_vncache.c +++ b/sys/fs/pseudofs/pseudofs_vncache.c @@ -136,7 +136,7 @@ retry: vp = pvd->pvd_vnode; VI_LOCK(vp); mtx_unlock(&pfs_vncache_mutex); - if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, curthread) == 0) { + if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK) == 0) { ++pfs_vncache_hits; *vpp = vp; /* @@ -218,7 +218,7 @@ retry2: vp = pvd2->pvd_vnode; VI_LOCK(vp); mtx_unlock(&pfs_vncache_mutex); - if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, curthread) == 0) { + if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK) == 0) { ++pfs_vncache_hits; vgone(*vpp); vput(*vpp); diff --git a/sys/fs/smbfs/smbfs_node.c b/sys/fs/smbfs/smbfs_node.c index 16b5de938464..f544d1019e83 100644 --- a/sys/fs/smbfs/smbfs_node.c +++ b/sys/fs/smbfs/smbfs_node.c @@ -124,7 +124,7 @@ smbfs_node_alloc(struct mount *mp, struct vnode *dvp, const char *dirnm, if (dvp == NULL) return EINVAL; vp = VTOSMB(VTOSMB(dvp)->n_parent)->n_vnode; - error = vget(vp, LK_EXCLUSIVE, td); + error = vget(vp, LK_EXCLUSIVE); if (error == 0) *vpp = vp; return error; diff --git a/sys/fs/smbfs/smbfs_vfsops.c b/sys/fs/smbfs/smbfs_vfsops.c index a85f06720528..12a5525990fb 100644 --- a/sys/fs/smbfs/smbfs_vfsops.c +++ b/sys/fs/smbfs/smbfs_vfsops.c @@ -329,7 +329,7 @@ smbfs_root(struct mount *mp, int flags, struct vnode **vpp) if (smp->sm_root) { *vpp = SMBTOV(smp->sm_root); - return vget(*vpp, LK_EXCLUSIVE | LK_RETRY, td); + return vget(*vpp, LK_EXCLUSIVE | LK_RETRY); } scred = smbfs_malloc_scred(); smb_makescred(scred, td, cred); diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index 55a6390f6833..2bf1cb9cc69e 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -620,7 +620,7 @@ loop: goto loop; } TMPFS_NODE_UNLOCK(node); - error = vget(vp, lkflag | LK_INTERLOCK, curthread); + error = vget(vp, lkflag | LK_INTERLOCK); if (error == ENOENT) { TMPFS_NODE_LOCK(node); goto loop; diff --git a/sys/fs/tmpfs/tmpfs_vfsops.c b/sys/fs/tmpfs/tmpfs_vfsops.c index bb2ae154af93..c98b6126eecd 100644 --- a/sys/fs/tmpfs/tmpfs_vfsops.c +++ b/sys/fs/tmpfs/tmpfs_vfsops.c @@ -130,8 +130,7 @@ tmpfs_update_mtime(struct mount *mp, bool lazy) * metadata changes now. */ if (!lazy || obj->generation != obj->cleangeneration) { - if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, - curthread) != 0) + if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK) != 0) continue; tmpfs_check_mtime(vp); if (!lazy) diff --git a/sys/kern/uipc_mqueue.c b/sys/kern/uipc_mqueue.c index 018630ca7dad..28fc1d84329b 100644 --- a/sys/kern/uipc_mqueue.c +++ b/sys/kern/uipc_mqueue.c @@ -754,7 +754,7 @@ mqfs_allocv(struct mount *mp, struct vnode **vpp, struct mqfs_node *pn) found: *vpp = vd->mv_vnode; sx_xunlock(&mqfs->mi_lock); - error = vget(*vpp, LK_RETRY | LK_EXCLUSIVE, curthread); + error = vget(*vpp, LK_RETRY | LK_EXCLUSIVE); vdrop(*vpp); return (error); } diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index 57465506d7d8..c8e2947b613c 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -1348,7 +1348,7 @@ loop: VI_UNLOCK(vp); continue; } - if ((error = vget(vp, lockreq, td)) != 0) { + if ((error = vget(vp, lockreq)) != 0) { if (error == ENOENT) { MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp); goto loop; diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 03bfa129b16c..a8a26e28a0ac 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -2856,12 +2856,10 @@ vget_abort(struct vnode *vp, enum vgetstate vs) } int -vget(struct vnode *vp, int flags, struct thread *td) +vget(struct vnode *vp, int flags) { enum vgetstate vs; - MPASS(td == curthread); - vs = vget_prep(vp); return (vget_finish(vp, flags, vs)); } @@ -4684,7 +4682,7 @@ vfs_periodic_msync_inactive(struct mount *mp, int flags) VI_UNLOCK(vp); continue; } - if (vget(vp, lkflags, td) == 0) { + if (vget(vp, lkflags) == 0) { obj = vp->v_object; if (obj != NULL && (vp->v_vflag & VV_NOSYNC) == 0) { VM_OBJECT_WLOCK(obj); diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 9d736483d008..7d87f70da53a 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -680,7 +680,7 @@ void vlazy(struct vnode *); void vdrop(struct vnode *); void vdropl(struct vnode *); int vflush(struct mount *mp, int rootrefs, int flags, struct thread *td); -int vget(struct vnode *vp, int flags, struct thread *td); +int vget(struct vnode *vp, int flags); enum vgetstate vget_prep_smr(struct vnode *vp); enum vgetstate vget_prep(struct vnode *vp); int vget_finish(struct vnode *vp, int flags, enum vgetstate vs); diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index d8ccdec718ae..221f3bf157fe 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -3463,7 +3463,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) */ pwd = pwd_hold(td); dvp = pwd->pwd_cdir; - if ((error = vget(dvp, LK_EXCLUSIVE, td)) != 0) { + if ((error = vget(dvp, LK_EXCLUSIVE)) != 0) { vput(fdvp); pwd_drop(pwd); break; diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index f97b08160dbc..577ddfa7e8d2 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -13624,8 +13624,7 @@ softdep_request_cleanup_flush(mp, ump) VI_UNLOCK(lvp); continue; } - if (vget(lvp, LK_EXCLUSIVE | LK_INTERLOCK | LK_NOWAIT, - td) != 0) { + if (vget(lvp, LK_EXCLUSIVE | LK_INTERLOCK | LK_NOWAIT) != 0) { failed_vnode = 1; continue; } diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 834930b5e995..e02af7499c1f 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -974,7 +974,7 @@ loop: /* * Step 4: invalidate all cached file data. */ - if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td)) { + if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK)) { MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp); goto loop; } @@ -1758,8 +1758,7 @@ ffs_sync_lazy(mp) VI_UNLOCK(vp); continue; } - if ((error = vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, - td)) != 0) + if ((error = vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK)) != 0) continue; #ifdef QUOTA qsyncvp(vp); @@ -1856,7 +1855,7 @@ loop: VI_UNLOCK(vp); continue; } - if ((error = vget(vp, lockreq, td)) != 0) { + if ((error = vget(vp, lockreq)) != 0) { if (error == ENOENT || error == ENOLCK) { MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp); goto loop; diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c index f59ff2a1c183..47c8133adc11 100644 --- a/sys/ufs/ufs/ufs_quota.c +++ b/sys/ufs/ufs/ufs_quota.c @@ -613,7 +613,7 @@ quotaon(struct thread *td, struct mount *mp, int type, void *fname) */ again: MNT_VNODE_FOREACH_ALL(vp, mp, mvp) { - if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td)) { + if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK)) { MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp); goto again; } @@ -680,7 +680,7 @@ again: VI_UNLOCK(vp); continue; } - if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td)) { + if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK)) { MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp); goto again; } @@ -1064,7 +1064,6 @@ int qsync(struct mount *mp) { struct ufsmount *ump = VFSTOUFS(mp); - struct thread *td = curthread; /* XXX */ struct vnode *vp, *mvp; struct dquot *dq; int i, error; @@ -1088,7 +1087,7 @@ again: VI_UNLOCK(vp); continue; } - error = vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td); + error = vget(vp, LK_EXCLUSIVE | LK_INTERLOCK); if (error) { if (error == ENOENT) { MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp); diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index d28ec3a366ed..cc67e131f2df 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -673,7 +673,7 @@ vm_fault_lock_vnode(struct faultstate *fs, bool objlocked) * paging-in-progress count incremented. Otherwise, we could * deadlock. */ - error = vget(vp, locked | LK_CANRECURSE | LK_NOWAIT, curthread); + error = vget(vp, locked | LK_CANRECURSE | LK_NOWAIT); if (error == 0) { fs->vp = vp; return (KERN_SUCCESS); @@ -684,7 +684,7 @@ vm_fault_lock_vnode(struct faultstate *fs, bool objlocked) unlock_and_deallocate(fs); else fault_deallocate(fs); - error = vget(vp, locked | LK_RETRY | LK_CANRECURSE, curthread); + error = vget(vp, locked | LK_RETRY | LK_CANRECURSE); vdrop(vp); fs->vp = vp; KASSERT(error == 0, ("vm_fault: vget failed %d", error)); diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index 7add69a58f06..24f542edfa39 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -1284,7 +1284,7 @@ vm_mmap_vnode(struct thread *td, vm_size_t objsize, cred = td->td_ucred; writex = (*maxprotp & VM_PROT_WRITE) != 0 && (*flagsp & MAP_SHARED) != 0; - if ((error = vget(vp, LK_SHARED, td)) != 0) + if ((error = vget(vp, LK_SHARED)) != 0) return (error); AUDIT_ARG_VNODE1(vp); foff = *foffp; @@ -1305,7 +1305,7 @@ vm_mmap_vnode(struct thread *td, vm_size_t objsize, * Bypass filesystems obey the mpsafety of the * underlying fs. Tmpfs never bypasses. */ - error = vget(vp, LK_SHARED, td); + error = vget(vp, LK_SHARED); if (error != 0) return (error); } diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index a882a17f3f39..34a3a4f9048e 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -643,7 +643,7 @@ vm_pageout_clean(vm_page_t m, int *numpagedout) VM_OBJECT_WUNLOCK(object); lockmode = MNT_SHARED_WRITES(vp->v_mount) ? LK_SHARED : LK_EXCLUSIVE; - if (vget(vp, lockmode | LK_TIMELOCK, curthread)) { + if (vget(vp, lockmode | LK_TIMELOCK)) { vp = NULL; error = EDEADLK; goto unlock_mp; |