diff options
author | phk <phk@FreeBSD.org> | 2005-01-13 12:25:19 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2005-01-13 12:25:19 +0000 |
commit | 3760addae23efed2c59b081d8b911fffafea8c14 (patch) | |
tree | 7d6746c70417d5e77d9141b543695fea22e9859b /sys | |
parent | 1d0efb6bd215298a956b11bba7269f94b30a2b6c (diff) | |
download | FreeBSD-src-3760addae23efed2c59b081d8b911fffafea8c14.zip FreeBSD-src-3760addae23efed2c59b081d8b911fffafea8c14.tar.gz |
Ditch vfs_object_create() and make the callers call VOP_CREATEVOBJECT()
directly.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/coda/coda_fbsd.c | 4 | ||||
-rw-r--r-- | sys/coda/coda_vnops.c | 12 | ||||
-rw-r--r-- | sys/fs/coda/coda_fbsd.c | 4 | ||||
-rw-r--r-- | sys/fs/coda/coda_vnops.c | 12 | ||||
-rw-r--r-- | sys/fs/unionfs/union_subr.c | 8 | ||||
-rw-r--r-- | sys/fs/unionfs/union_vnops.c | 5 | ||||
-rw-r--r-- | sys/kern/vfs_default.c | 2 | ||||
-rw-r--r-- | sys/kern/vfs_extattr.c | 4 | ||||
-rw-r--r-- | sys/kern/vfs_lookup.c | 6 | ||||
-rw-r--r-- | sys/kern/vfs_subr.c | 16 | ||||
-rw-r--r-- | sys/kern/vfs_syscalls.c | 4 | ||||
-rw-r--r-- | sys/kern/vfs_vnops.c | 2 | ||||
-rw-r--r-- | sys/nfsserver/nfs_srvsubs.c | 2 | ||||
-rw-r--r-- | sys/sys/vnode.h | 2 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 4 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_extattr.c | 5 |
16 files changed, 36 insertions, 56 deletions
diff --git a/sys/coda/coda_fbsd.c b/sys/coda/coda_fbsd.c index 8fe503b..19953e1 100644 --- a/sys/coda/coda_fbsd.c +++ b/sys/coda/coda_fbsd.c @@ -140,9 +140,9 @@ printf("coda_getp: Internally Opening %p\n", vp); return (error); } if (vp->v_type == VREG) { - error = vfs_object_create(vp, p, cred); + error = VOP_CREATEVOBJECT(vp, cred, p); if (error != 0) { - printf("coda_getpage: vfs_object_create() returns %d\n", error); + printf("coda_getpage: VOP_CREATEVOBJECT() returns %d\n", error); vput(vp); return(error); } diff --git a/sys/coda/coda_vnops.c b/sys/coda/coda_vnops.c index 71b6976..9509115 100644 --- a/sys/coda/coda_vnops.c +++ b/sys/coda/coda_vnops.c @@ -267,9 +267,9 @@ coda_open(struct vop_open_args *ap) } /* grab (above) does this when it calls newvnode unless it's in the cache*/ if (vp->v_type == VREG) { - error = vfs_object_create(vp, td, cred); + error = VOP_CREATEVOBJECT(vp, cred, td); if (error != 0) { - printf("coda_open: vfs_object_create() returns %d\n", error); + printf("coda_open: VOP_CREATEVOBJECT() returns %d\n", error); vput(vp); } } @@ -432,9 +432,9 @@ printf("coda_rdwr: Internally Opening %p\n", vp); return (error); } if (vp->v_type == VREG) { - error = vfs_object_create(vp, td, cred); + error = VOP_CREATEVOBJECT(vp, cred, td); if (error != 0) { - printf("coda_rdwr: vfs_object_create() returns %d\n", error); + printf("coda_rdwr: VOP_CREATEVOBJECT() returns %d\n", error); vput(vp); } } @@ -1563,9 +1563,9 @@ printf("coda_readdir: Internally Opening %p\n", vp); return (error); } if (vp->v_type == VREG) { - error = vfs_object_create(vp, td, cred); + error = VOP_CREATEVOBJECT(vp, cred, td); if (error != 0) { - printf("coda_readdir: vfs_object_create() returns %d\n", error); + printf("coda_readdir: VOP_CREATEVOBJECT() returns %d\n", error); vput(vp); } } diff --git a/sys/fs/coda/coda_fbsd.c b/sys/fs/coda/coda_fbsd.c index 8fe503b..19953e1 100644 --- a/sys/fs/coda/coda_fbsd.c +++ b/sys/fs/coda/coda_fbsd.c @@ -140,9 +140,9 @@ printf("coda_getp: Internally Opening %p\n", vp); return (error); } if (vp->v_type == VREG) { - error = vfs_object_create(vp, p, cred); + error = VOP_CREATEVOBJECT(vp, cred, p); if (error != 0) { - printf("coda_getpage: vfs_object_create() returns %d\n", error); + printf("coda_getpage: VOP_CREATEVOBJECT() returns %d\n", error); vput(vp); return(error); } diff --git a/sys/fs/coda/coda_vnops.c b/sys/fs/coda/coda_vnops.c index 71b6976..9509115 100644 --- a/sys/fs/coda/coda_vnops.c +++ b/sys/fs/coda/coda_vnops.c @@ -267,9 +267,9 @@ coda_open(struct vop_open_args *ap) } /* grab (above) does this when it calls newvnode unless it's in the cache*/ if (vp->v_type == VREG) { - error = vfs_object_create(vp, td, cred); + error = VOP_CREATEVOBJECT(vp, cred, td); if (error != 0) { - printf("coda_open: vfs_object_create() returns %d\n", error); + printf("coda_open: VOP_CREATEVOBJECT() returns %d\n", error); vput(vp); } } @@ -432,9 +432,9 @@ printf("coda_rdwr: Internally Opening %p\n", vp); return (error); } if (vp->v_type == VREG) { - error = vfs_object_create(vp, td, cred); + error = VOP_CREATEVOBJECT(vp, cred, td); if (error != 0) { - printf("coda_rdwr: vfs_object_create() returns %d\n", error); + printf("coda_rdwr: VOP_CREATEVOBJECT() returns %d\n", error); vput(vp); } } @@ -1563,9 +1563,9 @@ printf("coda_readdir: Internally Opening %p\n", vp); return (error); } if (vp->v_type == VREG) { - error = vfs_object_create(vp, td, cred); + error = VOP_CREATEVOBJECT(vp, cred, td); if (error != 0) { - printf("coda_readdir: vfs_object_create() returns %d\n", error); + printf("coda_readdir: VOP_CREATEVOBJECT() returns %d\n", error); vput(vp); } } diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c index bcd39d9..78a469b 100644 --- a/sys/fs/unionfs/union_subr.c +++ b/sys/fs/unionfs/union_subr.c @@ -782,7 +782,7 @@ union_copyup(un, docopy, cred, td) vn_lock(lvp, LK_EXCLUSIVE | LK_RETRY, td); error = VOP_OPEN(lvp, FREAD, cred, td, -1); if (error == 0 && vn_canvmio(lvp) == TRUE) - error = vfs_object_create(lvp, td, cred); + error = VOP_CREATEVOBJECT(lvp, cred, td); if (error == 0) { error = union_copyfile(lvp, uvp, cred, td); VOP_UNLOCK(lvp, 0, td); @@ -815,7 +815,7 @@ union_copyup(un, docopy, cred, td) } if (un->un_openl) { if (vn_canvmio(uvp) == TRUE) - error = vfs_object_create(uvp, td, cred); + error = VOP_CREATEVOBJECT(uvp, cred, td); } un->un_openl = 0; } @@ -1128,7 +1128,7 @@ union_vn_create(vpp, un, td) error = VOP_OPEN(vp, fmode, cred, td, -1); if (error == 0 && vn_canvmio(vp) == TRUE) - error = vfs_object_create(vp, td, cred); + error = VOP_CREATEVOBJECT(vp, cred, td); if (error) { vput(vp); return (error); @@ -1331,7 +1331,7 @@ union_dircheck(struct thread *td, struct vnode **vp, struct file *fp) if (lvp != NULLVP) { error = VOP_OPEN(lvp, FREAD, fp->f_cred, td, -1); if (error == 0 && vn_canvmio(lvp) == TRUE) - error = vfs_object_create(lvp, td, fp->f_cred); + error = VOP_CREATEVOBJECT(lvp, fp->f_cred, td); if (error) { vput(lvp); return (error); diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c index 2dcfd2d..94df922 100644 --- a/sys/fs/unionfs/union_vnops.c +++ b/sys/fs/unionfs/union_vnops.c @@ -785,9 +785,8 @@ union_open(ap) /* * This is absolutely necessary or UFS will blow up. */ - if (error == 0 && vn_canvmio(tvp) == TRUE) { - error = vfs_object_create(tvp, td, cred); - } + if (error == 0 && vn_canvmio(tvp) == TRUE) + error = VOP_CREATEVOBJECT(tvp, cred, td); /* * Release any locks held. diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index 970861a..8e8e1ea 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -420,7 +420,7 @@ vop_stdcreatevobject(ap) vrele(vp); } - KASSERT(vp->v_object != NULL, ("vfs_object_create: NULL object")); + KASSERT(vp->v_object != NULL, ("vop_stdcreatevobject: NULL object")); vp->v_vflag |= VV_OBJBUF; return (error); diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c index 17ef241..e1f8870 100644 --- a/sys/kern/vfs_extattr.c +++ b/sys/kern/vfs_extattr.c @@ -3957,7 +3957,7 @@ fhopen(td, uap) * Make sure that a VM object is created for VMIO support. */ if (vn_canvmio(vp) == TRUE) { - if ((error = vfs_object_create(vp, td, td->td_ucred)) != 0) + if ((error = VOP_CREATEVOBJECT(vp, td->td_ucred, td)) != 0) goto bad; } if (fmode & FWRITE) @@ -4011,7 +4011,7 @@ fhopen(td, uap) fp->f_flag |= FHASLOCK; } if ((vp->v_type == VREG) && (VOP_GETVOBJECT(vp, NULL) != 0)) - vfs_object_create(vp, td, td->td_ucred); + VOP_CREATEVOBJECT(vp, td->td_ucred, td); VOP_UNLOCK(vp, 0, td); fdrop(fp, td); diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 2ab34c6..00f9bd5 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -207,8 +207,8 @@ namei(ndp) (cnp->cn_nameiop != DELETE) && ((cnp->cn_flags & (NOOBJ|LOCKLEAF)) == LOCKLEAF)) - vfs_object_create(ndp->ni_vp, td, - ndp->ni_cnd.cn_cred); + VOP_CREATEVOBJECT(ndp->ni_vp, + ndp->ni_cnd.cn_cred, td); return (0); } @@ -771,7 +771,7 @@ relookup(dvp, vpp, cnp) if (vn_canvmio(dp) == TRUE && ((cnp->cn_flags & (NOOBJ|LOCKLEAF)) == LOCKLEAF)) - vfs_object_create(dp, td, cnp->cn_cred); + VOP_CREATEVOBJECT(dp, cnp->cn_cred, td); if ((cnp->cn_flags & LOCKLEAF) == 0) VOP_UNLOCK(dp, 0, td); diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 52b7b2d..4fda763 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -2843,22 +2843,6 @@ loop: } /* - * Create the VM object needed for VMIO and mmap support. This - * is done for all VREG files in the system. Some filesystems might - * afford the additional metadata buffering capability of the - * VMIO code by making the device node be VMIO mode also. - * - * vp must be locked when vfs_object_create is called. - */ -int -vfs_object_create(struct vnode *vp, struct thread *td, struct ucred *cred) -{ - - GIANT_REQUIRED; - return (VOP_CREATEVOBJECT(vp, cred, td)); -} - -/* * Mark a vnode as free, putting it up for recycling. */ void diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 17ef241..e1f8870 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -3957,7 +3957,7 @@ fhopen(td, uap) * Make sure that a VM object is created for VMIO support. */ if (vn_canvmio(vp) == TRUE) { - if ((error = vfs_object_create(vp, td, td->td_ucred)) != 0) + if ((error = VOP_CREATEVOBJECT(vp, td->td_ucred, td)) != 0) goto bad; } if (fmode & FWRITE) @@ -4011,7 +4011,7 @@ fhopen(td, uap) fp->f_flag |= FHASLOCK; } if ((vp->v_type == VREG) && (VOP_GETVOBJECT(vp, NULL) != 0)) - vfs_object_create(vp, td, td->td_ucred); + VOP_CREATEVOBJECT(vp, td->td_ucred, td); VOP_UNLOCK(vp, 0, td); fdrop(fp, td); diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 3e98446..dff2573 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -252,7 +252,7 @@ restart: * restores the requested locking state. */ #endif - if ((error = vfs_object_create(vp, td, cred)) != 0) { + if ((error = VOP_CREATEVOBJECT(vp, cred, td)) != 0) { VOP_UNLOCK(vp, 0, td); VOP_CLOSE(vp, fmode, cred, td); NDFREE(ndp, NDF_ONLY_PNBUF); diff --git a/sys/nfsserver/nfs_srvsubs.c b/sys/nfsserver/nfs_srvsubs.c index 2ea1783..2e7aad4 100644 --- a/sys/nfsserver/nfs_srvsubs.c +++ b/sys/nfsserver/nfs_srvsubs.c @@ -1233,7 +1233,7 @@ nfsrv_object_create(struct vnode *vp) if (vp == NULL || vp->v_type != VREG) return (1); - return (vfs_object_create(vp, curthread, curthread->td_ucred)); + return (VOP_CREATEVOBJECT(vp, curthread->td_ucred, curthread)); } /* diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 2974f2f..892e494 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -649,8 +649,6 @@ int vn_extattr_set(struct vnode *vp, int ioflg, int attrnamespace, int vn_extattr_rm(struct vnode *vp, int ioflg, int attrnamespace, const char *attrname, struct thread *td); int vfs_cache_lookup(struct vop_lookup_args *ap); -int vfs_object_create(struct vnode *vp, struct thread *td, - struct ucred *cred); void vfs_timestamp(struct timespec *); void vfs_write_resume(struct mount *mp); int vfs_write_suspend(struct mount *mp); diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index ef9d35a..e3fcf95 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -410,7 +410,7 @@ ffs_reload(struct mount *mp, struct thread *td) vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); if (vinvalbuf(devvp, 0, td->td_ucred, td, 0, 0) != 0) panic("ffs_reload: dirty1"); - vfs_object_create(devvp, td, td->td_ucred); + VOP_CREATEVOBJECT(devvp, td->td_ucred, td); VOP_UNLOCK(devvp, 0, td); /* @@ -553,7 +553,7 @@ ffs_mountfs(devvp, mp, td) dev = devvp->v_rdev; cred = td ? td->td_ucred : NOCRED; - vfs_object_create(devvp, td, td->td_ucred); + VOP_CREATEVOBJECT(devvp, td->td_ucred, td); ronly = (mp->mnt_flag & MNT_RDONLY) != 0; DROP_GIANT(); g_topology_lock(); diff --git a/sys/ufs/ufs/ufs_extattr.c b/sys/ufs/ufs/ufs_extattr.c index 0bc2b85..9e0b641 100644 --- a/sys/ufs/ufs/ufs_extattr.c +++ b/sys/ufs/ufs/ufs_extattr.c @@ -333,12 +333,11 @@ ufs_extattr_enable_with_open(struct ufsmount *ump, struct vnode *vp, } /* - * XXX: Note, should VOP_CLOSE() if vfs_object_create() fails, but due + * XXX: Note, should VOP_CLOSE() if VOP_CREATEVOBJECT() fails, but due * to a similar piece of code in vn_open(), we don't. */ if (vn_canvmio(vp) == TRUE) - if ((error = vfs_object_create(vp, td, - td->td_ucred)) != 0) { + if ((error = VOP_CREATEVOBJECT(vp, td->td_ucred, td)) != 0) { /* * XXX: bug replicated from vn_open(): should * VOP_CLOSE() here. |