diff options
author | jhb <jhb@FreeBSD.org> | 2001-01-27 00:01:31 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-01-27 00:01:31 +0000 |
commit | b6baa60b1e807d09641c20b2ff1fe838ddebbd3b (patch) | |
tree | 81781cbbf3ad98f73e64d11188dfe3084b844e12 /sys/fs | |
parent | 0c5b7b7672ac24978496b6d8b72a9f4c74349b64 (diff) | |
download | FreeBSD-src-b6baa60b1e807d09641c20b2ff1fe838ddebbd3b.zip FreeBSD-src-b6baa60b1e807d09641c20b2ff1fe838ddebbd3b.tar.gz |
Back out proc locking to protect p_ucred for obtaining additional
references along with the actual obtaining of additional references.
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/cd9660/cd9660_vfsops.c | 17 | ||||
-rw-r--r-- | sys/fs/coda/coda_vfsops.c | 16 | ||||
-rw-r--r-- | sys/fs/hpfs/hpfs_vfsops.c | 10 |
3 files changed, 5 insertions, 38 deletions
diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c index cd58e6d..aaefb78 100644 --- a/sys/fs/cd9660/cd9660_vfsops.c +++ b/sys/fs/cd9660/cd9660_vfsops.c @@ -183,7 +183,6 @@ cd9660_mount(mp, path, data, ndp, p) { struct vnode *devvp; struct iso_args args; - struct ucred *uc; size_t size; int error; mode_t accessmode; @@ -228,12 +227,7 @@ cd9660_mount(mp, path, data, ndp, p) */ accessmode = VREAD; vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p); - PROC_LOCK(p); - uc = p->p_ucred; - crhold(uc); - PROC_UNLOCK(p); - error = VOP_ACCESS(devvp, accessmode, uc, p); - crfree(uc); + error = VOP_ACCESS(devvp, accessmode, p->p_ucred, p); if (error) error = suser(p); if (error) { @@ -277,7 +271,6 @@ iso_mountfs(devvp, mp, p, argp) register struct iso_mnt *isomp = (struct iso_mnt *)0; struct buf *bp = NULL; struct buf *pribp = NULL, *supbp = NULL; - struct ucred *uc; dev_t dev = devvp->v_rdev; int error = EINVAL; int needclose = 0; @@ -305,13 +298,7 @@ iso_mountfs(devvp, mp, p, argp) return error; if (vcount(devvp) > 1 && devvp != rootvp) return EBUSY; - PROC_LOCK(p); - uc = p->p_ucred; - crhold(uc); - PROC_UNLOCK(p); - error = vinvalbuf(devvp, V_SAVE, p->p_ucred, p, 0, 0); - crfree(uc); - if (error) + if ((error = vinvalbuf(devvp, V_SAVE, p->p_ucred, p, 0, 0))) return (error); vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p); diff --git a/sys/fs/coda/coda_vfsops.c b/sys/fs/coda/coda_vfsops.c index 0708181..0496ea5 100644 --- a/sys/fs/coda/coda_vfsops.c +++ b/sys/fs/coda/coda_vfsops.c @@ -292,7 +292,6 @@ coda_root(vfsp, vpp) int error; struct proc *p = curproc; /* XXX - bnoble */ ViceFid VFid; - struct ucred* uc; ENTRY; MARK_ENTRY(CODA_ROOT_STATS); @@ -316,12 +315,7 @@ coda_root(vfsp, vpp) } } - PROC_LOCK(p); - uc = p->p_ucred; - crhold(uc); - PROC_UNLOCK(p); - error = venus_root(vftomi(vfsp), uc, p, &VFid); - crfree(uc); + error = venus_root(vftomi(vfsp), p->p_ucred, p, &VFid); if (!error) { /* @@ -447,7 +441,6 @@ coda_fhtovp(vfsp, fhp, nam, vpp, exflagsp, creadanonp) int error; struct proc *p = curproc; /* XXX -mach */ ViceFid VFid; - struct ucred *uc; int vtype; ENTRY; @@ -461,12 +454,7 @@ coda_fhtovp(vfsp, fhp, nam, vpp, exflagsp, creadanonp) return(0); } - PROC_LOCK(p); - uc = p->p_ucred; - crhold(uc); - PROC_UNLOCK(p); - error = venus_fhtovp(vftomi(vfsp), &cfid->cfid_fid, uc, p, &VFid, &vtype); - crfree(uc); + error = venus_fhtovp(vftomi(vfsp), &cfid->cfid_fid, p->p_ucred, p, &VFid, &vtype); if (error) { CODADEBUG(CODA_VGET, myprintf(("vget error %d\n",error));) diff --git a/sys/fs/hpfs/hpfs_vfsops.c b/sys/fs/hpfs/hpfs_vfsops.c index 5b8d9bb..1581851 100644 --- a/sys/fs/hpfs/hpfs_vfsops.c +++ b/sys/fs/hpfs/hpfs_vfsops.c @@ -331,9 +331,6 @@ hpfs_mountfs(devvp, mp, argsp, p) struct hpfsmount *hpmp; struct buf *bp = NULL; struct vnode *vp; -#if defined(__FreeBSD__) - struct ucred *uc; -#endif dev_t dev = devvp->v_rdev; dprintf(("hpfs_mountfs():\n")); @@ -356,12 +353,7 @@ hpfs_mountfs(devvp, mp, argsp, p) #if defined(__FreeBSD__) VN_LOCK(devvp, LK_EXCLUSIVE | LK_RETRY, p); - PROC_LOCK(p); - uc = p->p_ucred; - crhold(uc); - PROC_UNLOCK(p); - error = vinvalbuf(devvp, V_SAVE, uc, p, 0, 0); - crfree(uc); + error = vinvalbuf(devvp, V_SAVE, p->p_ucred, p, 0, 0); VOP__UNLOCK(devvp, 0, p); #else error = vinvalbuf(devvp, V_SAVE, p->p_ucred, p, 0, 0); |