diff options
Diffstat (limited to 'sys/ufs/ufs')
-rw-r--r-- | sys/ufs/ufs/extattr.h | 10 | ||||
-rw-r--r-- | sys/ufs/ufs/quota.h | 8 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_acl.c | 18 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_extattr.c | 206 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_extern.h | 4 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_ihash.c | 9 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_inode.c | 14 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_lookup.c | 56 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_quota.c | 50 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_readwrite.c | 16 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_vfsops.c | 22 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_vnops.c | 92 | ||||
-rw-r--r-- | sys/ufs/ufs/ufsmount.h | 2 |
13 files changed, 254 insertions, 253 deletions
diff --git a/sys/ufs/ufs/extattr.h b/sys/ufs/ufs/extattr.h index b609ded..0eca43f 100644 --- a/sys/ufs/ufs/extattr.h +++ b/sys/ufs/ufs/extattr.h @@ -93,14 +93,14 @@ struct ufs_extattr_per_mount { void ufs_extattr_uepm_init(struct ufs_extattr_per_mount *uepm); void ufs_extattr_uepm_destroy(struct ufs_extattr_per_mount *uepm); -int ufs_extattr_start(struct mount *mp, struct proc *p); -int ufs_extattr_autostart(struct mount *mp, struct proc *p); -int ufs_extattr_stop(struct mount *mp, struct proc *p); +int ufs_extattr_start(struct mount *mp, struct thread *td); +int ufs_extattr_autostart(struct mount *mp, struct thread *td); +int ufs_extattr_stop(struct mount *mp, struct thread *td); int ufs_extattrctl(struct mount *mp, int cmd, struct vnode *filename, - int attrnamespace, const char *attrname, struct proc *p); + int attrnamespace, const char *attrname, struct thread *td); int ufs_vop_getextattr(struct vop_getextattr_args *ap); int ufs_vop_setextattr(struct vop_setextattr_args *ap); -void ufs_extattr_vnode_inactive(struct vnode *vp, struct proc *p); +void ufs_extattr_vnode_inactive(struct vnode *vp, struct thread *td); #endif /* !_KERNEL */ diff --git a/sys/ufs/ufs/quota.h b/sys/ufs/ufs/quota.h index efa714e..080569c 100644 --- a/sys/ufs/ufs/quota.h +++ b/sys/ufs/ufs/quota.h @@ -174,7 +174,7 @@ struct dquot { struct inode; struct mount; -struct proc; +struct thread; struct ucred; struct vnode; @@ -185,11 +185,11 @@ void dqrele __P((struct vnode *, struct dquot *)); int getinoquota __P((struct inode *)); int getquota __P((struct mount *, u_long, int, caddr_t)); int qsync __P((struct mount *mp)); -int quotaoff __P((struct proc *, struct mount *, int)); -int quotaon __P((struct proc *, struct mount *, int, caddr_t)); +int quotaoff __P((struct thread *td, struct mount *, int)); +int quotaon __P((struct thread *td, struct mount *, int, caddr_t)); int setquota __P((struct mount *, u_long, int, caddr_t)); int setuse __P((struct mount *, u_long, int, caddr_t)); -int ufs_quotactl __P((struct mount *, int, uid_t, caddr_t, struct proc *)); +int ufs_quotactl __P((struct mount *, int, uid_t, caddr_t, struct thread *td)); #else /* !_KERNEL */ diff --git a/sys/ufs/ufs/ufs_acl.c b/sys/ufs/ufs/ufs_acl.c index d5ab20b..56e4828 100644 --- a/sys/ufs/ufs/ufs_acl.c +++ b/sys/ufs/ufs/ufs_acl.c @@ -217,7 +217,7 @@ ufs_getacl(ap) struct acl_type_t type; struct acl *aclp; struct ucred *cred; - struct proc *p; + struct thread *td; } */ *ap; { struct inode *ip = VTOI(ap->a_vp); @@ -241,7 +241,7 @@ ufs_getacl(ap) error = vn_extattr_get(ap->a_vp, IO_NODELOCKED, POSIX1E_ACL_ACCESS_EXTATTR_NAMESPACE, POSIX1E_ACL_ACCESS_EXTATTR_NAME, &len, (char *) ap->a_aclp, - ap->a_p); + ap->a_td); switch (error) { /* XXX: Will be ENOATTR. */ /* XXX: If ufs_getacl() should work on file systems without @@ -294,7 +294,7 @@ ufs_getacl(ap) error = vn_extattr_get(ap->a_vp, IO_NODELOCKED, POSIX1E_ACL_DEFAULT_EXTATTR_NAMESPACE, POSIX1E_ACL_DEFAULT_EXTATTR_NAME, &len, - (char *) ap->a_aclp, ap->a_p); + (char *) ap->a_aclp, ap->a_td); /* * Unlike ACL_TYPE_ACCESS, there is no relationship between * the inode contents and the ACL, and it is therefore @@ -370,7 +370,7 @@ ufs_setacl(ap) * Set operation. */ error = VOP_ACLCHECK(ap->a_vp, ap->a_type, ap->a_aclp, - ap->a_cred, ap->a_p); + ap->a_cred, ap->a_td); if (error != 0) return (error); } else { @@ -397,7 +397,7 @@ ufs_setacl(ap) /* * Must hold VADMIN (be file owner) or have appropriate privilege. */ - if ((error = VOP_ACCESS(ap->a_vp, VADMIN, ap->a_cred, ap->a_p))) + if ((error = VOP_ACCESS(ap->a_vp, VADMIN, ap->a_cred, ap->a_td))) return (error); switch(ap->a_type) { @@ -405,14 +405,14 @@ ufs_setacl(ap) error = vn_extattr_set(ap->a_vp, IO_NODELOCKED, POSIX1E_ACL_ACCESS_EXTATTR_NAMESPACE, POSIX1E_ACL_ACCESS_EXTATTR_NAME, sizeof(*ap->a_aclp), - (char *) ap->a_aclp, ap->a_p); + (char *) ap->a_aclp, ap->a_td); break; case ACL_TYPE_DEFAULT: if (ap->a_aclp == NULL) { error = vn_extattr_rm(ap->a_vp, IO_NODELOCKED, POSIX1E_ACL_DEFAULT_EXTATTR_NAMESPACE, - POSIX1E_ACL_DEFAULT_EXTATTR_NAME, ap->a_p); + POSIX1E_ACL_DEFAULT_EXTATTR_NAME, ap->a_td); /* * Attempting to delete a non-present default ACL * will return success for portability purposes. @@ -425,7 +425,7 @@ ufs_setacl(ap) error = vn_extattr_set(ap->a_vp, IO_NODELOCKED, POSIX1E_ACL_DEFAULT_EXTATTR_NAMESPACE, POSIX1E_ACL_DEFAULT_EXTATTR_NAME, - sizeof(*ap->a_aclp), (char *) ap->a_aclp, ap->a_p); + sizeof(*ap->a_aclp), (char *) ap->a_aclp, ap->a_td); break; default: @@ -466,7 +466,7 @@ ufs_aclcheck(ap) acl_type_t type; struct acl *aclp; struct ucred *cred; - struct proc *p; + struct thread *td; } */ *ap; { diff --git a/sys/ufs/ufs/ufs_extattr.c b/sys/ufs/ufs/ufs_extattr.c index b713267..60dc574 100644 --- a/sys/ufs/ufs/ufs_extattr.c +++ b/sys/ufs/ufs/ufs_extattr.c @@ -66,20 +66,20 @@ SYSCTL_INT(_debug, OID_AUTO, ufs_extattr_sync, CTLFLAG_RW, &ufs_extattr_sync, static int ufs_extattr_valid_attrname(const char *attrname); static int ufs_extattr_credcheck(struct vnode *vp, - struct ufs_extattr_list_entry *uele, struct ucred *cred, struct proc *p, + struct ufs_extattr_list_entry *uele, struct ucred *cred, struct thread *td, int access); static int ufs_extattr_enable_with_open(struct ufsmount *ump, - struct vnode *vp, int attrnamespace, const char *attrname, struct proc *p); + struct vnode *vp, int attrnamespace, const char *attrname, struct thread *td); static int ufs_extattr_enable(struct ufsmount *ump, int attrnamespace, - const char *attrname, struct vnode *backing_vnode, struct proc *p); + const char *attrname, struct vnode *backing_vnode, struct thread *td); static int ufs_extattr_disable(struct ufsmount *ump, int attrnamespace, - const char *attrname, struct proc *p); + const char *attrname, struct thread *td); static int ufs_extattr_get(struct vnode *vp, int attrnamespace, - const char *name, struct uio *uio, struct ucred *cred, struct proc *p); + const char *name, struct uio *uio, struct ucred *cred, struct thread *td); static int ufs_extattr_set(struct vnode *vp, int attrnamespace, - const char *name, struct uio *uio, struct ucred *cred, struct proc *p); + const char *name, struct uio *uio, struct ucred *cred, struct thread *td); static int ufs_extattr_rm(struct vnode *vp, int attrnamespace, - const char *name, struct ucred *cred, struct proc *p); + const char *name, struct ucred *cred, struct thread *td); /* * Per-FS attribute lock protecting attribute operations. @@ -87,19 +87,19 @@ static int ufs_extattr_rm(struct vnode *vp, int attrnamespace, * lock per-FS; really, this should be far more fine-grained. */ static void -ufs_extattr_uepm_lock(struct ufsmount *ump, struct proc *p) +ufs_extattr_uepm_lock(struct ufsmount *ump, struct thread *td) { /* Ideally, LK_CANRECURSE would not be used, here. */ lockmgr(&ump->um_extattr.uepm_lock, LK_EXCLUSIVE | LK_RETRY | - LK_CANRECURSE, 0, p); + LK_CANRECURSE, 0, td); } static void -ufs_extattr_uepm_unlock(struct ufsmount *ump, struct proc *p) +ufs_extattr_uepm_unlock(struct ufsmount *ump, struct thread *td) { - lockmgr(&ump->um_extattr.uepm_lock, LK_RELEASE, 0, p); + lockmgr(&ump->um_extattr.uepm_lock, LK_RELEASE, 0, td); } /* @@ -190,14 +190,14 @@ ufs_extattr_uepm_destroy(struct ufs_extattr_per_mount *uepm) * Start extended attribute support on an FS. */ int -ufs_extattr_start(struct mount *mp, struct proc *p) +ufs_extattr_start(struct mount *mp, struct thread *td) { struct ufsmount *ump; int error = 0; ump = VFSTOUFS(mp); - ufs_extattr_uepm_lock(ump, p); + ufs_extattr_uepm_lock(ump, td); if (!(ump->um_extattr.uepm_flags & UFS_EXTATTR_UEPM_INITIALIZED)) { error = EOPNOTSUPP; @@ -210,11 +210,11 @@ ufs_extattr_start(struct mount *mp, struct proc *p) ump->um_extattr.uepm_flags |= UFS_EXTATTR_UEPM_STARTED; - crhold(p->p_ucred); - ump->um_extattr.uepm_ucred = p->p_ucred; + crhold(td->td_proc->p_ucred); + ump->um_extattr.uepm_ucred = td->td_proc->p_ucred; unlock: - ufs_extattr_uepm_unlock(ump, p); + ufs_extattr_uepm_unlock(ump, td); return (error); } @@ -232,7 +232,7 @@ unlock: #define UE_GETDIR_LOCKPARENT_DONT 2 static int ufs_extattr_lookup(struct vnode *start_dvp, int lockparent, char *dirname, - struct vnode **vp, struct proc *p) + struct vnode **vp, struct thread *td) { struct vop_cachedlookup_args vargs; struct componentname cnp; @@ -244,15 +244,15 @@ ufs_extattr_lookup(struct vnode *start_dvp, int lockparent, char *dirname, cnp.cn_flags = ISLASTCN; if (lockparent == UE_GETDIR_LOCKPARENT) cnp.cn_flags |= LOCKPARENT; - cnp.cn_proc = p; - cnp.cn_cred = p->p_ucred; + cnp.cn_thread = td; + cnp.cn_cred = td->td_proc->p_ucred; cnp.cn_pnbuf = zalloc(namei_zone); cnp.cn_nameptr = cnp.cn_pnbuf; error = copystr(dirname, cnp.cn_pnbuf, MAXPATHLEN, (size_t *) &cnp.cn_namelen); if (error) { if (lockparent == UE_GETDIR_LOCKPARENT_DONT) { - VOP_UNLOCK(start_dvp, 0, p); + VOP_UNLOCK(start_dvp, 0, td); } zfree(namei_zone, cnp.cn_pnbuf); printf("ufs_extattr_lookup: copystr failed\n"); @@ -272,7 +272,7 @@ ufs_extattr_lookup(struct vnode *start_dvp, int lockparent, char *dirname, */ if (!(cnp.cn_flags & PDIRUNLOCK) && (lockparent == UE_GETDIR_LOCKPARENT_DONT)) - VOP_UNLOCK(start_dvp, 0, p); + VOP_UNLOCK(start_dvp, 0, td); /* * Check that ufs_lookup() didn't release the lock when we @@ -313,15 +313,15 @@ ufs_extattr_lookup(struct vnode *start_dvp, int lockparent, char *dirname, */ static int ufs_extattr_enable_with_open(struct ufsmount *ump, struct vnode *vp, - int attrnamespace, const char *attrname, struct proc *p) + int attrnamespace, const char *attrname, struct thread *td) { int error; - error = VOP_OPEN(vp, FREAD|FWRITE, p->p_ucred, p); + error = VOP_OPEN(vp, FREAD|FWRITE, td->td_proc->p_ucred, td); if (error) { printf("ufs_extattr_enable_with_open.VOP_OPEN(): failed " "with %d\n", error); - VOP_UNLOCK(vp, 0, p); + VOP_UNLOCK(vp, 0, td); return (error); } @@ -330,12 +330,12 @@ ufs_extattr_enable_with_open(struct ufsmount *ump, struct vnode *vp, * to a similar piece of code in vn_open(), we don't. */ if (vn_canvmio(vp) == TRUE) - if ((error = vfs_object_create(vp, p, p->p_ucred)) != 0) { + if ((error = vfs_object_create(vp, td, td->td_proc->p_ucred)) != 0) { /* * XXX: bug replicated from vn_open(): should * VOP_CLOSE() here. */ - VOP_UNLOCK(vp, 0, p); + VOP_UNLOCK(vp, 0, td); return (error); } @@ -343,11 +343,11 @@ ufs_extattr_enable_with_open(struct ufsmount *ump, struct vnode *vp, vref(vp); - VOP_UNLOCK(vp, 0, p); + VOP_UNLOCK(vp, 0, td); - error = ufs_extattr_enable(ump, attrnamespace, attrname, vp, p); + error = ufs_extattr_enable(ump, attrnamespace, attrname, vp, td); if (error != 0) - vn_close(vp, FREAD|FWRITE, p->p_ucred, p); + vn_close(vp, FREAD|FWRITE, td->td_proc->p_ucred, td); return (error); } @@ -361,7 +361,7 @@ ufs_extattr_enable_with_open(struct ufsmount *ump, struct vnode *vp, */ static int ufs_extattr_iterate_directory(struct ufsmount *ump, struct vnode *dvp, - int attrnamespace, struct proc *p) + int attrnamespace, struct thread *td) { struct vop_readdir_args vargs; struct dirent *dp, *edp; @@ -380,13 +380,13 @@ ufs_extattr_iterate_directory(struct ufsmount *ump, struct vnode *dvp, auio.uio_iovcnt = 1; auio.uio_rw = UIO_READ; auio.uio_segflg = UIO_SYSSPACE; - auio.uio_procp = p; + auio.uio_td = td; auio.uio_offset = 0; vargs.a_desc = NULL; vargs.a_vp = dvp; vargs.a_uio = &auio; - vargs.a_cred = p->p_ucred; + vargs.a_cred = td->td_proc->p_ucred; vargs.a_eofflag = &eofflag; vargs.a_ncookies = NULL; vargs.a_cookies = NULL; @@ -413,7 +413,7 @@ ufs_extattr_iterate_directory(struct ufsmount *ump, struct vnode *dvp, if (dp->d_reclen == 0) break; error = ufs_extattr_lookup(dvp, UE_GETDIR_LOCKPARENT, - dp->d_name, &attr_vp, p); + dp->d_name, &attr_vp, td); if (error) { printf("ufs_extattr_iterate_directory: lookup " "%s %d\n", dp->d_name, error); @@ -429,7 +429,7 @@ ufs_extattr_iterate_directory(struct ufsmount *ump, struct vnode *dvp, vput(attr_vp); } else { error = ufs_extattr_enable_with_open(ump, - attr_vp, attrnamespace, dp->d_name, p); + attr_vp, attrnamespace, dp->d_name, td); vrele(attr_vp); if (error) { printf("ufs_extattr_iterate_directory: " @@ -458,7 +458,7 @@ ufs_extattr_iterate_directory(struct ufsmount *ump, struct vnode *dvp, * mount-time. */ int -ufs_extattr_autostart(struct mount *mp, struct proc *p) +ufs_extattr_autostart(struct mount *mp, struct thread *td) { struct vnode *rvp, *attr_dvp, *attr_system_dvp, *attr_user_dvp; int error; @@ -474,7 +474,7 @@ ufs_extattr_autostart(struct mount *mp, struct proc *p) } error = ufs_extattr_lookup(rvp, UE_GETDIR_LOCKPARENT_DONT, - UFS_EXTATTR_FSROOTSUBDIR, &attr_dvp, p); + UFS_EXTATTR_FSROOTSUBDIR, &attr_dvp, td); if (error) { /* rvp ref'd but now unlocked */ vrele(rvp); @@ -494,7 +494,7 @@ ufs_extattr_autostart(struct mount *mp, struct proc *p) goto return_vput_attr_dvp; } - error = ufs_extattr_start(mp, p); + error = ufs_extattr_start(mp, td); if (error) { printf("ufs_extattr_autostart: ufs_extattr_start failed (%d)\n", error); @@ -509,10 +509,10 @@ ufs_extattr_autostart(struct mount *mp, struct proc *p) * be cleaned up on exit. */ error = ufs_extattr_lookup(attr_dvp, UE_GETDIR_LOCKPARENT, - UFS_EXTATTR_SUBDIR_SYSTEM, &attr_system_dvp, p); + UFS_EXTATTR_SUBDIR_SYSTEM, &attr_system_dvp, td); if (!error) { error = ufs_extattr_iterate_directory(VFSTOUFS(mp), - attr_system_dvp, EXTATTR_NAMESPACE_SYSTEM, p); + attr_system_dvp, EXTATTR_NAMESPACE_SYSTEM, td); if (error) printf("ufs_extattr_iterate_directory returned %d\n", error); @@ -520,10 +520,10 @@ ufs_extattr_autostart(struct mount *mp, struct proc *p) } error = ufs_extattr_lookup(attr_dvp, UE_GETDIR_LOCKPARENT, - UFS_EXTATTR_SUBDIR_USER, &attr_user_dvp, p); + UFS_EXTATTR_SUBDIR_USER, &attr_user_dvp, td); if (!error) { error = ufs_extattr_iterate_directory(VFSTOUFS(mp), - attr_user_dvp, EXTATTR_NAMESPACE_USER, p); + attr_user_dvp, EXTATTR_NAMESPACE_USER, td); if (error) printf("ufs_extattr_iterate_directory returned %d\n", error); @@ -544,13 +544,13 @@ return_vput_attr_dvp: * Stop extended attribute support on an FS. */ int -ufs_extattr_stop(struct mount *mp, struct proc *p) +ufs_extattr_stop(struct mount *mp, struct thread *td) { struct ufs_extattr_list_entry *uele; struct ufsmount *ump = VFSTOUFS(mp); int error = 0; - ufs_extattr_uepm_lock(ump, p); + ufs_extattr_uepm_lock(ump, td); if (!(ump->um_extattr.uepm_flags & UFS_EXTATTR_UEPM_STARTED)) { error = EOPNOTSUPP; @@ -560,7 +560,7 @@ ufs_extattr_stop(struct mount *mp, struct proc *p) while (LIST_FIRST(&ump->um_extattr.uepm_list) != NULL) { uele = LIST_FIRST(&ump->um_extattr.uepm_list); ufs_extattr_disable(ump, uele->uele_attrnamespace, - uele->uele_attrname, p); + uele->uele_attrname, td); } ump->um_extattr.uepm_flags &= ~UFS_EXTATTR_UEPM_STARTED; @@ -569,7 +569,7 @@ ufs_extattr_stop(struct mount *mp, struct proc *p) ump->um_extattr.uepm_ucred = NULL; unlock: - ufs_extattr_uepm_unlock(ump, p); + ufs_extattr_uepm_unlock(ump, td); return (error); } @@ -580,7 +580,7 @@ unlock: */ static int ufs_extattr_enable(struct ufsmount *ump, int attrnamespace, - const char *attrname, struct vnode *backing_vnode, struct proc *p) + const char *attrname, struct vnode *backing_vnode, struct thread *td) { struct ufs_extattr_list_entry *attribute; struct iovec aiov; @@ -622,13 +622,13 @@ ufs_extattr_enable(struct ufsmount *ump, int attrnamespace, auio.uio_offset = (off_t) 0; auio.uio_segflg = UIO_SYSSPACE; auio.uio_rw = UIO_READ; - auio.uio_procp = (struct proc *) p; + auio.uio_td = td; - VOP_LEASE(backing_vnode, p, p->p_ucred, LEASE_WRITE); - vn_lock(backing_vnode, LK_SHARED | LK_NOPAUSE | LK_RETRY, p); + VOP_LEASE(backing_vnode, td, td->td_proc->p_ucred, LEASE_WRITE); + vn_lock(backing_vnode, LK_SHARED | LK_NOPAUSE | LK_RETRY, td); error = VOP_READ(backing_vnode, &auio, IO_NODELOCKED, ump->um_extattr.uepm_ucred); - VOP_UNLOCK(backing_vnode, 0, p); + VOP_UNLOCK(backing_vnode, 0, td); if (error) goto free_exit; @@ -667,7 +667,7 @@ free_exit: */ static int ufs_extattr_disable(struct ufsmount *ump, int attrnamespace, - const char *attrname, struct proc *p) + const char *attrname, struct thread *td) { struct ufs_extattr_list_entry *uele; int error = 0; @@ -682,7 +682,7 @@ ufs_extattr_disable(struct ufsmount *ump, int attrnamespace, LIST_REMOVE(uele, uele_entries); uele->uele_backing_vnode->v_flag &= ~VSYSTEM; - error = vn_close(uele->uele_backing_vnode, FREAD|FWRITE, p->p_ucred, p); + error = vn_close(uele->uele_backing_vnode, FREAD|FWRITE, td->td_proc->p_ucred, td); FREE(uele, M_UFS_EXTATTR); @@ -696,7 +696,7 @@ ufs_extattr_disable(struct ufsmount *ump, int attrnamespace, */ int ufs_extattrctl(struct mount *mp, int cmd, struct vnode *filename_vp, - int attrnamespace, const char *attrname, struct proc *p) + int attrnamespace, const char *attrname, struct thread *td) { struct ufsmount *ump = VFSTOUFS(mp); int error; @@ -705,34 +705,34 @@ ufs_extattrctl(struct mount *mp, int cmd, struct vnode *filename_vp, * Processes with privilege, but in jail, are not allowed to * configure extended attributes. */ - if ((error = suser_xxx(p->p_ucred, p, 0))) { + if ((error = suser_xxx(td->td_proc->p_ucred, td->td_proc, 0))) { if (filename_vp != NULL) - VOP_UNLOCK(filename_vp, 0, p); + VOP_UNLOCK(filename_vp, 0, td); return (error); } switch(cmd) { case UFS_EXTATTR_CMD_START: if (filename_vp != NULL) { - VOP_UNLOCK(filename_vp, 0, p); + VOP_UNLOCK(filename_vp, 0, td); return (EINVAL); } if (attrname != NULL) return (EINVAL); - error = ufs_extattr_start(mp, p); + error = ufs_extattr_start(mp, td); return (error); case UFS_EXTATTR_CMD_STOP: if (filename_vp != NULL) { - VOP_UNLOCK(filename_vp, 0, p); + VOP_UNLOCK(filename_vp, 0, td); return (EINVAL); } if (attrname != NULL) return (EINVAL); - error = ufs_extattr_stop(mp, p); + error = ufs_extattr_stop(mp, td); return (error); @@ -741,7 +741,7 @@ ufs_extattrctl(struct mount *mp, int cmd, struct vnode *filename_vp, if (filename_vp == NULL) return (EINVAL); if (attrname == NULL) { - VOP_UNLOCK(filename_vp, 0, p); + VOP_UNLOCK(filename_vp, 0, td); return (EINVAL); } @@ -749,25 +749,25 @@ ufs_extattrctl(struct mount *mp, int cmd, struct vnode *filename_vp, * ufs_extattr_enable_with_open() will always unlock the * vnode, regardless of failure. */ - ufs_extattr_uepm_lock(ump, p); + ufs_extattr_uepm_lock(ump, td); error = ufs_extattr_enable_with_open(ump, filename_vp, - attrnamespace, attrname, p); - ufs_extattr_uepm_unlock(ump, p); + attrnamespace, attrname, td); + ufs_extattr_uepm_unlock(ump, td); return (error); case UFS_EXTATTR_CMD_DISABLE: if (filename_vp != NULL) { - VOP_UNLOCK(filename_vp, 0, p); + VOP_UNLOCK(filename_vp, 0, td); return (EINVAL); } if (attrname == NULL) return (EINVAL); - ufs_extattr_uepm_lock(ump, p); - error = ufs_extattr_disable(ump, attrnamespace, attrname, p); - ufs_extattr_uepm_unlock(ump, p); + ufs_extattr_uepm_lock(ump, td); + error = ufs_extattr_disable(ump, attrnamespace, attrname, td); + ufs_extattr_uepm_unlock(ump, td); return (error); @@ -782,7 +782,7 @@ ufs_extattrctl(struct mount *mp, int cmd, struct vnode *filename_vp, */ static int ufs_extattr_credcheck(struct vnode *vp, struct ufs_extattr_list_entry *uele, - struct ucred *cred, struct proc *p, int access) + struct ucred *cred, struct thread *td, int access) { /* @@ -800,9 +800,9 @@ ufs_extattr_credcheck(struct vnode *vp, struct ufs_extattr_list_entry *uele, */ switch (uele->uele_attrnamespace) { case EXTATTR_NAMESPACE_SYSTEM: - return (suser_xxx(cred, p, 0)); + return (suser_xxx(cred, td->td_proc, 0)); case EXTATTR_NAMESPACE_USER: - return (VOP_ACCESS(vp, access, cred, p)); + return (VOP_ACCESS(vp, access, cred, td)); default: return (EPERM); } @@ -820,7 +820,7 @@ vop_getextattr { IN const char *a_name; INOUT struct uio *a_uio; IN struct ucred *a_cred; - IN struct proc *a_p; + IN struct thread *a_td; }; */ { @@ -828,12 +828,12 @@ vop_getextattr { struct ufsmount *ump = VFSTOUFS(mp); int error; - ufs_extattr_uepm_lock(ump, ap->a_p); + ufs_extattr_uepm_lock(ump, ap->a_td); error = ufs_extattr_get(ap->a_vp, ap->a_attrnamespace, ap->a_name, - ap->a_uio, ap->a_cred, ap->a_p); + ap->a_uio, ap->a_cred, ap->a_td); - ufs_extattr_uepm_unlock(ump, ap->a_p); + ufs_extattr_uepm_unlock(ump, ap->a_td); return (error); } @@ -844,7 +844,7 @@ vop_getextattr { */ static int ufs_extattr_get(struct vnode *vp, int attrnamespace, const char *name, - struct uio *uio, struct ucred *cred, struct proc *p) + struct uio *uio, struct ucred *cred, struct thread *td) { struct ufs_extattr_list_entry *attribute; struct ufs_extattr_header ueh; @@ -870,7 +870,7 @@ ufs_extattr_get(struct vnode *vp, int attrnamespace, const char *name, if (!attribute) return (ENOENT); - if ((error = ufs_extattr_credcheck(vp, attribute, cred, p, IREAD))) + if ((error = ufs_extattr_credcheck(vp, attribute, cred, td, IREAD))) return (error); /* @@ -900,21 +900,21 @@ ufs_extattr_get(struct vnode *vp, int attrnamespace, const char *name, local_aio.uio_iovcnt = 1; local_aio.uio_rw = UIO_READ; local_aio.uio_segflg = UIO_SYSSPACE; - local_aio.uio_procp = p; + local_aio.uio_td = td; local_aio.uio_offset = base_offset; local_aio.uio_resid = sizeof(struct ufs_extattr_header); /* * Acquire locks. */ - VOP_LEASE(attribute->uele_backing_vnode, p, cred, LEASE_READ); + VOP_LEASE(attribute->uele_backing_vnode, td, cred, LEASE_READ); /* * Don't need to get a lock on the backing file if the getattr is * being applied to the backing file, as the lock is already held. */ if (attribute->uele_backing_vnode != vp) vn_lock(attribute->uele_backing_vnode, LK_SHARED | - LK_NOPAUSE | LK_RETRY, p); + LK_NOPAUSE | LK_RETRY, td); error = VOP_READ(attribute->uele_backing_vnode, &local_aio, IO_NODELOCKED, ump->um_extattr.uepm_ucred); @@ -970,7 +970,7 @@ vopunlock_exit: uio->uio_offset = 0; if (attribute->uele_backing_vnode != vp) - VOP_UNLOCK(attribute->uele_backing_vnode, 0, p); + VOP_UNLOCK(attribute->uele_backing_vnode, 0, td); return (error); } @@ -987,7 +987,7 @@ vop_setextattr { IN const char *a_name; INOUT struct uio *a_uio; IN struct ucred *a_cred; - IN struct proc *a_p; + IN struct thread *a_td; }; */ { @@ -996,16 +996,16 @@ vop_setextattr { int error; - ufs_extattr_uepm_lock(ump, ap->a_p); + ufs_extattr_uepm_lock(ump, ap->a_td); if (ap->a_uio != NULL) error = ufs_extattr_set(ap->a_vp, ap->a_attrnamespace, - ap->a_name, ap->a_uio, ap->a_cred, ap->a_p); + ap->a_name, ap->a_uio, ap->a_cred, ap->a_td); else error = ufs_extattr_rm(ap->a_vp, ap->a_attrnamespace, - ap->a_name, ap->a_cred, ap->a_p); + ap->a_name, ap->a_cred, ap->a_td); - ufs_extattr_uepm_unlock(ump, ap->a_p); + ufs_extattr_uepm_unlock(ump, ap->a_td); return (error); } @@ -1016,7 +1016,7 @@ vop_setextattr { */ static int ufs_extattr_set(struct vnode *vp, int attrnamespace, const char *name, - struct uio *uio, struct ucred *cred, struct proc *p) + struct uio *uio, struct ucred *cred, struct thread *td) { struct ufs_extattr_list_entry *attribute; struct ufs_extattr_header ueh; @@ -1039,7 +1039,7 @@ ufs_extattr_set(struct vnode *vp, int attrnamespace, const char *name, if (!attribute) return (ENOENT); - if ((error = ufs_extattr_credcheck(vp, attribute, cred, p, IWRITE))) + if ((error = ufs_extattr_credcheck(vp, attribute, cred, td, IWRITE))) return (error); /* @@ -1071,14 +1071,14 @@ ufs_extattr_set(struct vnode *vp, int attrnamespace, const char *name, local_aio.uio_iovcnt = 1; local_aio.uio_rw = UIO_WRITE; local_aio.uio_segflg = UIO_SYSSPACE; - local_aio.uio_procp = p; + local_aio.uio_td = td; local_aio.uio_offset = base_offset; local_aio.uio_resid = sizeof(struct ufs_extattr_header); /* * Acquire locks. */ - VOP_LEASE(attribute->uele_backing_vnode, p, cred, LEASE_WRITE); + VOP_LEASE(attribute->uele_backing_vnode, td, cred, LEASE_WRITE); /* * Don't need to get a lock on the backing file if the setattr is @@ -1086,7 +1086,7 @@ ufs_extattr_set(struct vnode *vp, int attrnamespace, const char *name, */ if (attribute->uele_backing_vnode != vp) vn_lock(attribute->uele_backing_vnode, - LK_EXCLUSIVE | LK_NOPAUSE | LK_RETRY, p); + LK_EXCLUSIVE | LK_NOPAUSE | LK_RETRY, td); ioflag = IO_NODELOCKED; if (ufs_extattr_sync) @@ -1116,7 +1116,7 @@ vopunlock_exit: uio->uio_offset = 0; if (attribute->uele_backing_vnode != vp) - VOP_UNLOCK(attribute->uele_backing_vnode, 0, p); + VOP_UNLOCK(attribute->uele_backing_vnode, 0, td); return (error); } @@ -1127,7 +1127,7 @@ vopunlock_exit: */ static int ufs_extattr_rm(struct vnode *vp, int attrnamespace, const char *name, - struct ucred *cred, struct proc *p) + struct ucred *cred, struct thread *td) { struct ufs_extattr_list_entry *attribute; struct ufs_extattr_header ueh; @@ -1150,7 +1150,7 @@ ufs_extattr_rm(struct vnode *vp, int attrnamespace, const char *name, if (!attribute) return (ENOENT); - if ((error = ufs_extattr_credcheck(vp, attribute, cred, p, IWRITE))) + if ((error = ufs_extattr_credcheck(vp, attribute, cred, td, IWRITE))) return (error); /* @@ -1172,11 +1172,11 @@ ufs_extattr_rm(struct vnode *vp, int attrnamespace, const char *name, local_aio.uio_iovcnt = 1; local_aio.uio_rw = UIO_READ; local_aio.uio_segflg = UIO_SYSSPACE; - local_aio.uio_procp = p; + local_aio.uio_td = td; local_aio.uio_offset = base_offset; local_aio.uio_resid = sizeof(struct ufs_extattr_header); - VOP_LEASE(attribute->uele_backing_vnode, p, cred, LEASE_WRITE); + VOP_LEASE(attribute->uele_backing_vnode, td, cred, LEASE_WRITE); /* * Don't need to get the lock on the backing vnode if the vnode we're @@ -1184,7 +1184,7 @@ ufs_extattr_rm(struct vnode *vp, int attrnamespace, const char *name, */ if (attribute->uele_backing_vnode != vp) vn_lock(attribute->uele_backing_vnode, - LK_EXCLUSIVE | LK_NOPAUSE | LK_RETRY, p); + LK_EXCLUSIVE | LK_NOPAUSE | LK_RETRY, td); error = VOP_READ(attribute->uele_backing_vnode, &local_aio, IO_NODELOCKED, ump->um_extattr.uepm_ucred); @@ -1221,7 +1221,7 @@ ufs_extattr_rm(struct vnode *vp, int attrnamespace, const char *name, local_aio.uio_iovcnt = 1; local_aio.uio_rw = UIO_WRITE; local_aio.uio_segflg = UIO_SYSSPACE; - local_aio.uio_procp = p; + local_aio.uio_td = td; local_aio.uio_offset = base_offset; local_aio.uio_resid = sizeof(struct ufs_extattr_header); @@ -1237,7 +1237,7 @@ ufs_extattr_rm(struct vnode *vp, int attrnamespace, const char *name, error = ENXIO; vopunlock_exit: - VOP_UNLOCK(attribute->uele_backing_vnode, 0, p); + VOP_UNLOCK(attribute->uele_backing_vnode, 0, td); return (error); } @@ -1247,7 +1247,7 @@ vopunlock_exit: * attributes stripped. */ void -ufs_extattr_vnode_inactive(struct vnode *vp, struct proc *p) +ufs_extattr_vnode_inactive(struct vnode *vp, struct thread *td) { struct ufs_extattr_list_entry *uele; struct mount *mp = vp->v_mount; @@ -1261,18 +1261,18 @@ ufs_extattr_vnode_inactive(struct vnode *vp, struct proc *p) if (!(ump->um_extattr.uepm_flags & UFS_EXTATTR_UEPM_INITIALIZED)) return; - ufs_extattr_uepm_lock(ump, p); + ufs_extattr_uepm_lock(ump, td); if (!(ump->um_extattr.uepm_flags & UFS_EXTATTR_UEPM_STARTED)) { - ufs_extattr_uepm_unlock(ump, p); + ufs_extattr_uepm_unlock(ump, td); return; } LIST_FOREACH(uele, &ump->um_extattr.uepm_list, uele_entries) ufs_extattr_rm(vp, uele->uele_attrnamespace, - uele->uele_attrname, NULL, p); + uele->uele_attrname, NULL, td); - ufs_extattr_uepm_unlock(ump, p); + ufs_extattr_uepm_unlock(ump, td); } #endif /* !UFS_EXTATTR */ diff --git a/sys/ufs/ufs/ufs_extern.h b/sys/ufs/ufs/ufs_extern.h index d95013b..c4e2795 100644 --- a/sys/ufs/ufs/ufs_extern.h +++ b/sys/ufs/ufs/ufs_extern.h @@ -43,7 +43,7 @@ struct indir; struct inode; struct mount; struct netcred; -struct proc; +struct thread; struct sockaddr; struct ucred; struct ufid; @@ -89,7 +89,7 @@ int ufs_readdir __P((struct vop_readdir_args *)); int ufs_reclaim __P((struct vop_reclaim_args *)); void ffs_snapgone __P((struct inode *)); int ufs_root __P((struct mount *, struct vnode **)); -int ufs_start __P((struct mount *, int, struct proc *)); +int ufs_start __P((struct mount *, int, struct thread *)); int ufs_vinit __P((struct mount *, vop_t **, vop_t **, struct vnode **)); /* diff --git a/sys/ufs/ufs/ufs_ihash.c b/sys/ufs/ufs/ufs_ihash.c index 1fd39e9..d1537af 100644 --- a/sys/ufs/ufs/ufs_ihash.c +++ b/sys/ufs/ufs/ufs_ihash.c @@ -40,6 +40,7 @@ #include <sys/lock.h> #include <sys/vnode.h> #include <sys/malloc.h> +#include <sys/proc.h> #include <sys/mutex.h> #include <ufs/ufs/quota.h> @@ -97,7 +98,7 @@ ufs_ihashget(dev, inum) dev_t dev; ino_t inum; { - struct proc *p = curproc; /* XXX */ + struct thread *td = curthread; /* XXX */ struct inode *ip; struct vnode *vp; @@ -108,7 +109,7 @@ loop: vp = ITOV(ip); mtx_lock(&vp->v_interlock); mtx_unlock(&ufs_ihash_mtx); - if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, p)) + if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td)) goto loop; return (vp); } @@ -124,11 +125,11 @@ void ufs_ihashins(ip) struct inode *ip; { - struct proc *p = curproc; /* XXX */ + struct thread *td = curthread; /* XXX */ struct ihashhead *ipp; /* lock the inode, then put it on the appropriate hash list */ - lockmgr(&ip->i_vnode->v_lock, LK_EXCLUSIVE, (struct mtx *)0, p); + lockmgr(&ip->i_vnode->v_lock, LK_EXCLUSIVE, (struct mtx *)0, td); mtx_lock(&ufs_ihash_mtx); ipp = INOHASH(ip->i_dev, ip->i_number); diff --git a/sys/ufs/ufs/ufs_inode.c b/sys/ufs/ufs/ufs_inode.c index 028e3b9..9858297 100644 --- a/sys/ufs/ufs/ufs_inode.c +++ b/sys/ufs/ufs/ufs_inode.c @@ -65,12 +65,12 @@ int ufs_inactive(ap) struct vop_inactive_args /* { struct vnode *a_vp; - struct proc *a_p; + struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; struct inode *ip = VTOI(vp); - struct proc *p = ap->a_p; + struct thread *td = ap->a_td; int mode, error = 0; if (prtactive && vp->v_usecount != 0) @@ -90,9 +90,9 @@ ufs_inactive(ap) (void)chkiq(ip, -1, NOCRED, 0); #endif #ifdef UFS_EXTATTR - ufs_extattr_vnode_inactive(ap->a_vp, ap->a_p); + ufs_extattr_vnode_inactive(ap->a_vp, ap->a_td); #endif - error = UFS_TRUNCATE(vp, (off_t)0, 0, NOCRED, p); + error = UFS_TRUNCATE(vp, (off_t)0, 0, NOCRED, td); /* * Setting the mode to zero needs to wait for the inode * to be written just as does a change to the link count. @@ -117,13 +117,13 @@ ufs_inactive(ap) } } out: - VOP_UNLOCK(vp, 0, p); + VOP_UNLOCK(vp, 0, td); /* * If we are done with the inode, reclaim it * so that it can be reused immediately. */ if (ip->i_mode == 0) - vrecycle(vp, NULL, p); + vrecycle(vp, NULL, td); return (error); } @@ -134,7 +134,7 @@ int ufs_reclaim(ap) struct vop_reclaim_args /* { struct vnode *a_vp; - struct proc *a_p; + struct thread *a_td; } */ *ap; { register struct inode *ip; diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index a062330..da1c0e9 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -156,7 +156,7 @@ ufs_lookup(ap) struct ucred *cred = cnp->cn_cred; int flags = cnp->cn_flags; int nameiop = cnp->cn_nameiop; - struct proc *p = cnp->cn_proc; + struct thread *td = cnp->cn_thread; bp = NULL; slotoffset = -1; @@ -400,7 +400,7 @@ notfound: * Access for write is interpreted as allowing * creation of files in the directory. */ - error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_proc); + error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_thread); if (error) return (error); /* @@ -445,7 +445,7 @@ notfound: */ cnp->cn_flags |= SAVENAME; if (!lockparent) { - VOP_UNLOCK(vdp, 0, p); + VOP_UNLOCK(vdp, 0, td); cnp->cn_flags |= PDIRUNLOCK; } return (EJUSTRETURN); @@ -490,7 +490,7 @@ found: /* * Write access to directory required to delete files. */ - error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_proc); + error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_thread); if (error) return (error); /* @@ -509,10 +509,10 @@ found: return (0); } if (flags & ISDOTDOT) - VOP_UNLOCK(vdp, 0, p); /* race to get the inode */ + VOP_UNLOCK(vdp, 0, td); /* race to get the inode */ error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp); if (flags & ISDOTDOT) { - if (vn_lock(vdp, LK_EXCLUSIVE | LK_RETRY, p) != 0) + if (vn_lock(vdp, LK_EXCLUSIVE | LK_RETRY, td) != 0) cnp->cn_flags |= PDIRUNLOCK; } if (error) @@ -524,14 +524,14 @@ found: * implements append-only directories. */ if ((dp->i_mode & ISVTX) && - VOP_ACCESS(vdp, VADMIN, cred, cnp->cn_proc) && - VOP_ACCESS(tdp, VADMIN, cred, cnp->cn_proc)) { + VOP_ACCESS(vdp, VADMIN, cred, cnp->cn_thread) && + VOP_ACCESS(tdp, VADMIN, cred, cnp->cn_thread)) { vput(tdp); return (EPERM); } *vpp = tdp; if (!lockparent) { - VOP_UNLOCK(vdp, 0, p); + VOP_UNLOCK(vdp, 0, td); cnp->cn_flags |= PDIRUNLOCK; } return (0); @@ -544,7 +544,7 @@ found: * regular file, or empty directory. */ if (nameiop == RENAME && wantparent && (flags & ISLASTCN)) { - if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_proc)) != 0) + if ((error = VOP_ACCESS(vdp, VWRITE, cred, cnp->cn_thread)) != 0) return (error); /* * Careful about locking second inode. @@ -553,10 +553,10 @@ found: if (dp->i_number == dp->i_ino) return (EISDIR); if (flags & ISDOTDOT) - VOP_UNLOCK(vdp, 0, p); /* race to get the inode */ + VOP_UNLOCK(vdp, 0, td); /* race to get the inode */ error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp); if (flags & ISDOTDOT) { - if (vn_lock(vdp, LK_EXCLUSIVE | LK_RETRY, p) != 0) + if (vn_lock(vdp, LK_EXCLUSIVE | LK_RETRY, td) != 0) cnp->cn_flags |= PDIRUNLOCK; } if (error) @@ -564,7 +564,7 @@ found: *vpp = tdp; cnp->cn_flags |= SAVENAME; if (!lockparent) { - VOP_UNLOCK(vdp, 0, p); + VOP_UNLOCK(vdp, 0, td); cnp->cn_flags |= PDIRUNLOCK; } return (0); @@ -591,15 +591,15 @@ found: */ pdp = vdp; if (flags & ISDOTDOT) { - VOP_UNLOCK(pdp, 0, p); /* race to get the inode */ + VOP_UNLOCK(pdp, 0, td); /* race to get the inode */ cnp->cn_flags |= PDIRUNLOCK; if ((error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp)) != 0) { - if (vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY, p) == 0) + if (vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY, td) == 0) cnp->cn_flags &= ~PDIRUNLOCK; return (error); } if (lockparent && (flags & ISLASTCN)) { - if ((error = vn_lock(pdp, LK_EXCLUSIVE, p)) != 0) { + if ((error = vn_lock(pdp, LK_EXCLUSIVE, td)) != 0) { vput(tdp); return (error); } @@ -614,7 +614,7 @@ found: if (error) return (error); if (!lockparent || !(flags & ISLASTCN)) { - VOP_UNLOCK(pdp, 0, p); + VOP_UNLOCK(pdp, 0, td); cnp->cn_flags |= PDIRUNLOCK; } *vpp = tdp; @@ -739,7 +739,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp) struct buf *newdirbp; { struct ucred *cr; - struct proc *p; + struct thread *td; int newentrysize; struct inode *dp; struct buf *bp; @@ -748,8 +748,8 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp) int error, ret, blkoff, loc, spacefree, flags; char *dirbuf; - p = curproc; /* XXX */ - cr = p->p_ucred; + td = curthread; /* XXX */ + cr = td->td_proc->p_ucred; dp = VTOI(dvp); newentrysize = DIRSIZ(OFSFMT(dvp), dirp); @@ -818,10 +818,10 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp) if ((error = BUF_WRITE(bp))) return (error); if (tvp != NULL) - VOP_UNLOCK(tvp, 0, p); - error = VOP_FSYNC(dvp, p->p_ucred, MNT_WAIT, p); + VOP_UNLOCK(tvp, 0, td); + error = VOP_FSYNC(dvp, td->td_proc->p_ucred, MNT_WAIT, td); if (tvp != NULL) - vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY, p); + vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY, td); return (error); } if (DOINGASYNC(dvp)) { @@ -966,14 +966,14 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp) */ if (error == 0 && dp->i_endoff && dp->i_endoff < dp->i_size) { if (tvp != NULL) - VOP_UNLOCK(tvp, 0, p); + VOP_UNLOCK(tvp, 0, td); #ifdef UFS_DIRHASH if (dp->i_dirhash != NULL) ufsdirhash_dirtrunc(dp, dp->i_endoff); #endif - (void) UFS_TRUNCATE(dvp, (off_t)dp->i_endoff, IO_SYNC, cr, p); + (void) UFS_TRUNCATE(dvp, (off_t)dp->i_endoff, IO_SYNC, cr, td); if (tvp != NULL) - vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY, p); + vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY, td); } return (error); } @@ -1159,7 +1159,7 @@ ufs_dirempty(ip, parentino, cred) for (off = 0; off < ip->i_size; off += dp->d_reclen) { error = vn_rdwr(UIO_READ, ITOV(ip), (caddr_t)dp, MINDIRSIZ, off, - UIO_SYSSPACE, IO_NODELOCKED, cred, &count, (struct proc *)0); + UIO_SYSSPACE, IO_NODELOCKED, cred, &count, (struct thread *)0); /* * Since we read MINDIRSIZ, residual must * be 0 unless we're at end of file. @@ -1230,7 +1230,7 @@ ufs_checkpath(source, target, cred) } error = vn_rdwr(UIO_READ, vp, (caddr_t)&dirbuf, sizeof (struct dirtemplate), (off_t)0, UIO_SYSSPACE, - IO_NODELOCKED, cred, (int *)0, (struct proc *)0); + IO_NODELOCKED, cred, (int *)0, (struct thread *)0); if (error != 0) break; # if (BYTE_ORDER == LITTLE_ENDIAN) diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c index 6992160..4c10d88 100644 --- a/sys/ufs/ufs/ufs_quota.c +++ b/sys/ufs/ufs/ufs_quota.c @@ -386,8 +386,8 @@ chkdquot(ip) * Q_QUOTAON - set up a quota file for a particular file system. */ int -quotaon(p, mp, type, fname) - struct proc *p; +quotaon(td, mp, type, fname) + struct thread *td; struct mount *mp; register int type; caddr_t fname; @@ -400,20 +400,20 @@ quotaon(p, mp, type, fname) struct nameidata nd; vpp = &ump->um_quotas[type]; - NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, fname, p); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, fname, td); flags = FREAD | FWRITE; error = vn_open(&nd, &flags, 0); if (error) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); vp = nd.ni_vp; - VOP_UNLOCK(vp, 0, p); + VOP_UNLOCK(vp, 0, td); if (vp->v_type != VREG) { - (void) vn_close(vp, FREAD|FWRITE, p->p_ucred, p); + (void) vn_close(vp, FREAD|FWRITE, td->td_proc->p_ucred, td); return (EACCES); } if (*vpp != vp) - quotaoff(p, mp, type); + quotaoff(td, mp, type); ump->um_qflags[type] |= QTF_OPENING; mp->mnt_flag |= MNT_QUOTA; vp->v_flag |= VSYSTEM; @@ -422,8 +422,8 @@ quotaon(p, mp, type, fname) * Save the credential of the process that turned on quotas. * Set up the time limits for this quota. */ - crhold(p->p_ucred); - ump->um_cred[type] = p->p_ucred; + crhold(td->td_proc->p_ucred); + ump->um_cred[type] = td->td_proc->p_ucred; ump->um_btime[type] = MAX_DQ_TIME; ump->um_itime[type] = MAX_IQ_TIME; if (dqget(NULLVP, 0, ump, type, &dq) == 0) { @@ -452,7 +452,7 @@ again: mtx_lock(&mntvnode_mtx); continue; } - if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, p)) { + if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td)) { mtx_lock(&mntvnode_mtx); goto again; } @@ -467,7 +467,7 @@ again: mtx_unlock(&mntvnode_mtx); ump->um_qflags[type] &= ~QTF_OPENING; if (error) - quotaoff(p, mp, type); + quotaoff(td, mp, type); return (error); } @@ -475,8 +475,8 @@ again: * Q_QUOTAOFF - turn off disk quotas for a filesystem. */ int -quotaoff(p, mp, type) - struct proc *p; +quotaoff(td, mp, type) + struct thread *td; struct mount *mp; register int type; { @@ -508,7 +508,7 @@ again: mtx_lock(&mntvnode_mtx); continue; } - if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, p)) { + if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td)) { mtx_lock(&mntvnode_mtx); goto again; } @@ -524,7 +524,7 @@ again: mtx_unlock(&mntvnode_mtx); dqflush(qvp); qvp->v_flag &= ~VSYSTEM; - error = vn_close(qvp, FREAD|FWRITE, p->p_ucred, p); + error = vn_close(qvp, FREAD|FWRITE, td->td_proc->p_ucred, td); ump->um_quotas[type] = NULLVP; crfree(ump->um_cred[type]); ump->um_cred[type] = NOCRED; @@ -675,7 +675,7 @@ qsync(mp) struct mount *mp; { struct ufsmount *ump = VFSTOUFS(mp); - struct proc *p = curproc; /* XXX */ + struct thread *td = curthread; /* XXX */ struct vnode *vp, *nextvp; struct dquot *dq; int i, error; @@ -706,7 +706,7 @@ again: mtx_lock(&mntvnode_mtx); continue; } - error = vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, p); + error = vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, td); if (error) { mtx_lock(&mntvnode_mtx); if (error == ENOENT) @@ -765,7 +765,7 @@ dqget(vp, id, ump, type, dqp) register int type; struct dquot **dqp; { - struct proc *p = curproc; /* XXX */ + struct thread *td = curthread; /* XXX */ struct dquot *dq; struct dqhash *dqh; struct vnode *dqvp; @@ -821,7 +821,7 @@ dqget(vp, id, ump, type, dqp) * Initialize the contents of the dquot structure. */ if (vp != dqvp) - vn_lock(dqvp, LK_EXCLUSIVE | LK_RETRY, p); + vn_lock(dqvp, LK_EXCLUSIVE | LK_RETRY, td); LIST_INSERT_HEAD(dqh, dq, dq_hash); DQREF(dq); dq->dq_flags = DQ_LOCK; @@ -836,12 +836,12 @@ dqget(vp, id, ump, type, dqp) auio.uio_offset = (off_t)(id * sizeof (struct dqblk)); auio.uio_segflg = UIO_SYSSPACE; auio.uio_rw = UIO_READ; - auio.uio_procp = (struct proc *)0; + auio.uio_td = (struct thread *)0; error = VOP_READ(dqvp, &auio, 0, ump->um_cred[type]); if (auio.uio_resid == sizeof(struct dqblk) && error == 0) bzero((caddr_t)&dq->dq_dqb, sizeof(struct dqblk)); if (vp != dqvp) - VOP_UNLOCK(dqvp, 0, p); + VOP_UNLOCK(dqvp, 0, td); if (dq->dq_flags & DQ_WANT) wakeup((caddr_t)dq); dq->dq_flags = 0; @@ -915,7 +915,7 @@ dqsync(vp, dq) struct vnode *vp; struct dquot *dq; { - struct proc *p = curproc; /* XXX */ + struct thread *td = curthread; /* XXX */ struct vnode *dqvp; struct iovec aiov; struct uio auio; @@ -929,13 +929,13 @@ dqsync(vp, dq) panic("dqsync: file"); (void) vn_write_suspend_wait(dqvp, NULL, V_WAIT); if (vp != dqvp) - vn_lock(dqvp, LK_EXCLUSIVE | LK_RETRY, p); + vn_lock(dqvp, LK_EXCLUSIVE | LK_RETRY, td); while (dq->dq_flags & DQ_LOCK) { dq->dq_flags |= DQ_WANT; (void) tsleep((caddr_t)dq, PINOD+2, "dqsync", 0); if ((dq->dq_flags & DQ_MOD) == 0) { if (vp != dqvp) - VOP_UNLOCK(dqvp, 0, p); + VOP_UNLOCK(dqvp, 0, td); return (0); } } @@ -948,7 +948,7 @@ dqsync(vp, dq) auio.uio_offset = (off_t)(dq->dq_id * sizeof (struct dqblk)); auio.uio_segflg = UIO_SYSSPACE; auio.uio_rw = UIO_WRITE; - auio.uio_procp = (struct proc *)0; + auio.uio_td = (struct thread *)0; error = VOP_WRITE(dqvp, &auio, 0, dq->dq_ump->um_cred[dq->dq_type]); if (auio.uio_resid && error == 0) error = EIO; @@ -956,7 +956,7 @@ dqsync(vp, dq) wakeup((caddr_t)dq); dq->dq_flags &= ~(DQ_MOD|DQ_LOCK|DQ_WANT); if (vp != dqvp) - VOP_UNLOCK(dqvp, 0, p); + VOP_UNLOCK(dqvp, 0, td); return (error); } diff --git a/sys/ufs/ufs/ufs_readwrite.c b/sys/ufs/ufs/ufs_readwrite.c index 0308895..83673eb 100644 --- a/sys/ufs/ufs/ufs_readwrite.c +++ b/sys/ufs/ufs/ufs_readwrite.c @@ -395,7 +395,7 @@ WRITE(ap) register struct inode *ip; register FS *fs; struct buf *bp; - struct proc *p; + struct thread *td; ufs_daddr_t lbn; off_t osize; int seqcount; @@ -456,13 +456,13 @@ WRITE(ap) * Maybe this should be above the vnode op call, but so long as * file servers have no limits, I don't think it matters. */ - p = uio->uio_procp; - if (vp->v_type == VREG && p && + td = uio->uio_td; + if (vp->v_type == VREG && td && uio->uio_offset + uio->uio_resid > - p->p_rlimit[RLIMIT_FSIZE].rlim_cur) { - PROC_LOCK(p); - psignal(p, SIGXFSZ); - PROC_UNLOCK(p); + td->td_proc->p_rlimit[RLIMIT_FSIZE].rlim_cur) { + PROC_LOCK(td->td_proc); + psignal(td->td_proc, SIGXFSZ); + PROC_UNLOCK(td->td_proc); if (object) { vm_object_vndeallocate(object); } @@ -573,7 +573,7 @@ WRITE(ap) if (error) { if (ioflag & IO_UNIT) { (void)UFS_TRUNCATE(vp, osize, - ioflag & IO_SYNC, ap->a_cred, uio->uio_procp); + ioflag & IO_SYNC, ap->a_cred, uio->uio_td); uio->uio_offset -= resid - uio->uio_resid; uio->uio_resid = resid; } diff --git a/sys/ufs/ufs/ufs_vfsops.c b/sys/ufs/ufs/ufs_vfsops.c index 1fcd530..7b42452 100644 --- a/sys/ufs/ufs/ufs_vfsops.c +++ b/sys/ufs/ufs/ufs_vfsops.c @@ -64,10 +64,10 @@ MALLOC_DEFINE(M_UFSMNT, "UFS mount", "UFS mount structure"); */ /* ARGSUSED */ int -ufs_start(mp, flags, p) +ufs_start(mp, flags, td) struct mount *mp; int flags; - struct proc *p; + struct thread *td; { return (0); @@ -95,12 +95,12 @@ ufs_root(mp, vpp) * Do operations associated with quotas */ int -ufs_quotactl(mp, cmds, uid, arg, p) +ufs_quotactl(mp, cmds, uid, arg, td) struct mount *mp; int cmds; uid_t uid; caddr_t arg; - struct proc *p; + struct thread *td; { #ifndef QUOTA return (EOPNOTSUPP); @@ -108,35 +108,35 @@ ufs_quotactl(mp, cmds, uid, arg, p) int cmd, type, error; if (uid == -1) - uid = p->p_ucred->cr_ruid; + uid = td->td_proc->p_ucred->cr_ruid; cmd = cmds >> SUBCMDSHIFT; switch (cmd) { case Q_SYNC: break; case Q_GETQUOTA: - if (uid == p->p_ucred->cr_ruid) + if (uid == td->td_proc->p_ucred->cr_ruid) break; /* fall through */ default: - if ((error = suser_xxx(0, p, PRISON_ROOT)) != 0) + if ((error = suser_xxx(0, td->td_proc, PRISON_ROOT)) != 0) return (error); } type = cmds & SUBCMDMASK; if ((u_int)type >= MAXQUOTAS) return (EINVAL); - if (vfs_busy(mp, LK_NOWAIT, 0, p)) + if (vfs_busy(mp, LK_NOWAIT, 0, td)) return (0); switch (cmd) { case Q_QUOTAON: - error = quotaon(p, mp, type, arg); + error = quotaon(td, mp, type, arg); break; case Q_QUOTAOFF: - error = quotaoff(p, mp, type); + error = quotaoff(td, mp, type); break; case Q_SETQUOTA: @@ -159,7 +159,7 @@ ufs_quotactl(mp, cmds, uid, arg, p) error = EINVAL; break; } - vfs_unbusy(mp, p); + vfs_unbusy(mp, td); return (error); #endif } diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index e52bf93..c108c90 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -83,8 +83,8 @@ static int ufs_access __P((struct vop_access_args *)); static int ufs_advlock __P((struct vop_advlock_args *)); -static int ufs_chmod __P((struct vnode *, int, struct ucred *, struct proc *)); -static int ufs_chown __P((struct vnode *, uid_t, gid_t, struct ucred *, struct proc *)); +static int ufs_chmod __P((struct vnode *, int, struct ucred *, struct thread *)); +static int ufs_chown __P((struct vnode *, uid_t, gid_t, struct ucred *, struct thread *)); static int ufs_close __P((struct vop_close_args *)); static int ufs_create __P((struct vop_create_args *)); static int ufs_getattr __P((struct vop_getattr_args *)); @@ -267,7 +267,7 @@ ufs_open(ap) struct vnode *a_vp; int a_mode; struct ucred *a_cred; - struct proc *a_p; + struct thread *a_td; } */ *ap; { @@ -292,7 +292,7 @@ ufs_close(ap) struct vnode *a_vp; int a_fflag; struct ucred *a_cred; - struct proc *a_p; + struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; @@ -332,7 +332,7 @@ ufs_access(ap) struct vnode *a_vp; int a_mode; struct ucred *a_cred; - struct proc *a_p; + struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; @@ -373,7 +373,7 @@ ufs_access(ap) #ifdef UFS_ACL MALLOC(acl, struct acl *, sizeof(*acl), M_ACL, M_WAITOK); len = sizeof(*acl); - error = VOP_GETACL(vp, ACL_TYPE_ACCESS, acl, ap->a_cred, ap->a_p); + error = VOP_GETACL(vp, ACL_TYPE_ACCESS, acl, ap->a_cred, ap->a_td); switch (error) { case EOPNOTSUPP: error = vaccess(vp->v_type, ip->i_mode, ip->i_uid, ip->i_gid, @@ -408,7 +408,7 @@ ufs_getattr(ap) struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct proc *a_p; + struct thread *a_td; } */ *ap; { register struct vnode *vp = ap->a_vp; @@ -452,14 +452,14 @@ ufs_setattr(ap) struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct proc *a_p; + struct thread *a_td; } */ *ap; { struct vattr *vap = ap->a_vap; struct vnode *vp = ap->a_vp; struct inode *ip = VTOI(vp); struct ucred *cred = ap->a_cred; - struct proc *p = ap->a_p; + struct thread *td = ap->a_td; int error; /* @@ -478,7 +478,7 @@ ufs_setattr(ap) * Callers may only modify the file flags on objects they * have VADMIN rights for. */ - if ((error = VOP_ACCESS(vp, VADMIN, cred, p))) + if ((error = VOP_ACCESS(vp, VADMIN, cred, td))) return (error); /* * Unprivileged processes and privileged processes in @@ -519,7 +519,7 @@ ufs_setattr(ap) if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); if ((error = ufs_chown(vp, vap->va_uid, vap->va_gid, cred, - p)) != 0) + td)) != 0) return (error); } if (vap->va_size != VNOVAL) { @@ -541,7 +541,7 @@ ufs_setattr(ap) default: break; } - if ((error = UFS_TRUNCATE(vp, vap->va_size, 0, cred, p)) != 0) + if ((error = UFS_TRUNCATE(vp, vap->va_size, 0, cred, td)) != 0) return (error); } if (vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL) { @@ -557,9 +557,9 @@ ufs_setattr(ap) * If times is non-NULL, ... The caller must be the owner of * the file or be the super-user. */ - if ((error = VOP_ACCESS(vp, VADMIN, cred, p)) && + if ((error = VOP_ACCESS(vp, VADMIN, cred, td)) && ((vap->va_vaflags & VA_UTIMES_NULL) == 0 || - (error = VOP_ACCESS(vp, VWRITE, cred, p)))) + (error = VOP_ACCESS(vp, VWRITE, cred, td)))) return (error); if (vap->va_atime.tv_sec != VNOVAL) ip->i_flag |= IN_ACCESS; @@ -585,7 +585,7 @@ ufs_setattr(ap) if ((ip->i_flags & SF_SNAPSHOT) != 0 && (vap->va_mode & (S_IXUSR | S_IWUSR | S_IXGRP | S_IWGRP | S_IXOTH | S_IWOTH))) return (EPERM); - error = ufs_chmod(vp, (int)vap->va_mode, cred, p); + error = ufs_chmod(vp, (int)vap->va_mode, cred, td); } VN_KNOTE(vp, NOTE_ATTRIB); return (error); @@ -596,11 +596,11 @@ ufs_setattr(ap) * Inode must be locked before calling. */ static int -ufs_chmod(vp, mode, cred, p) +ufs_chmod(vp, mode, cred, td) register struct vnode *vp; register int mode; register struct ucred *cred; - struct proc *p; + struct thread *td; { register struct inode *ip = VTOI(vp); int error; @@ -609,7 +609,7 @@ ufs_chmod(vp, mode, cred, p) * To modify the permissions on a file, must possess VADMIN * for that file. */ - if ((error = VOP_ACCESS(vp, VADMIN, cred, p))) + if ((error = VOP_ACCESS(vp, VADMIN, cred, td))) return (error); /* * Privileged processes may set the sticky bit on non-directories, @@ -633,12 +633,12 @@ ufs_chmod(vp, mode, cred, p) * inode must be locked prior to call. */ static int -ufs_chown(vp, uid, gid, cred, p) +ufs_chown(vp, uid, gid, cred, td) register struct vnode *vp; uid_t uid; gid_t gid; struct ucred *cred; - struct proc *p; + struct thread *td; { register struct inode *ip = VTOI(vp); uid_t ouid; @@ -657,7 +657,7 @@ ufs_chown(vp, uid, gid, cred, p) * To modify the ownership of a file, must possess VADMIN * for that file. */ - if ((error = VOP_ACCESS(vp, VADMIN, cred, p))) + if ((error = VOP_ACCESS(vp, VADMIN, cred, td))) return (error); /* * To change the owner of a file, or change the group of a file @@ -666,7 +666,7 @@ ufs_chown(vp, uid, gid, cred, p) */ if ((uid != ip->i_uid || (gid != ip->i_gid && !groupmember(gid, cred))) && - (error = suser_xxx(cred, p, PRISON_ROOT))) + (error = suser_xxx(cred, td->td_proc, PRISON_ROOT))) return (error); ogid = ip->i_gid; ouid = ip->i_uid; @@ -780,7 +780,7 @@ ufs_link(ap) struct vnode *vp = ap->a_vp; struct vnode *tdvp = ap->a_tdvp; struct componentname *cnp = ap->a_cnp; - struct proc *p = cnp->cn_proc; + struct thread *td = cnp->cn_thread; struct inode *ip; struct direct newdir; int error; @@ -793,7 +793,7 @@ ufs_link(ap) error = EXDEV; goto out2; } - if (tdvp != vp && (error = vn_lock(vp, LK_EXCLUSIVE, p))) { + if (tdvp != vp && (error = vn_lock(vp, LK_EXCLUSIVE, td))) { goto out2; } ip = VTOI(vp); @@ -825,7 +825,7 @@ ufs_link(ap) } out1: if (tdvp != vp) - VOP_UNLOCK(vp, 0, p); + VOP_UNLOCK(vp, 0, td); out2: VN_KNOTE(vp, NOTE_LINK); VN_KNOTE(tdvp, NOTE_WRITE); @@ -928,7 +928,7 @@ ufs_rename(ap) struct vnode *fdvp = ap->a_fdvp; struct componentname *tcnp = ap->a_tcnp; struct componentname *fcnp = ap->a_fcnp; - struct proc *p = fcnp->cn_proc; + struct thread *td = fcnp->cn_thread; struct inode *ip, *xp, *dp; struct direct newdir; int doingdirectory = 0, oldparent = 0, newparent = 0; @@ -1019,18 +1019,18 @@ abortit: vput(fvp); return (error); } - if ((error = vn_lock(fvp, LK_EXCLUSIVE, p)) != 0) + if ((error = vn_lock(fvp, LK_EXCLUSIVE, td)) != 0) goto abortit; dp = VTOI(fdvp); ip = VTOI(fvp); if (ip->i_nlink >= LINK_MAX) { - VOP_UNLOCK(fvp, 0, p); + VOP_UNLOCK(fvp, 0, td); error = EMLINK; goto abortit; } if ((ip->i_flags & (NOUNLINK | IMMUTABLE | APPEND)) || (dp->i_flags & APPEND)) { - VOP_UNLOCK(fvp, 0, p); + VOP_UNLOCK(fvp, 0, td); error = EPERM; goto abortit; } @@ -1041,7 +1041,7 @@ abortit: if ((fcnp->cn_namelen == 1 && fcnp->cn_nameptr[0] == '.') || dp == ip || (fcnp->cn_flags | tcnp->cn_flags) & ISDOTDOT || (ip->i_flag & IN_RENAME)) { - VOP_UNLOCK(fvp, 0, p); + VOP_UNLOCK(fvp, 0, td); error = EINVAL; goto abortit; } @@ -1074,7 +1074,7 @@ abortit: softdep_change_linkcnt(ip); if ((error = UFS_UPDATE(fvp, !(DOINGSOFTDEP(fvp) | DOINGASYNC(fvp)))) != 0) { - VOP_UNLOCK(fvp, 0, p); + VOP_UNLOCK(fvp, 0, td); goto bad; } @@ -1088,8 +1088,8 @@ abortit: * to namei, as the parent directory is unlocked by the * call to checkpath(). */ - error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, tcnp->cn_proc); - VOP_UNLOCK(fvp, 0, p); + error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, tcnp->cn_thread); + VOP_UNLOCK(fvp, 0, td); if (oldparent != dp->i_number) newparent = dp->i_number; if (doingdirectory && newparent) { @@ -1172,8 +1172,8 @@ abortit: * directories. */ if ((dp->i_mode & S_ISTXT) && - VOP_ACCESS(tdvp, VADMIN, tcnp->cn_cred, p) && - VOP_ACCESS(tvp, VADMIN, tcnp->cn_cred, p)) { + VOP_ACCESS(tdvp, VADMIN, tcnp->cn_cred, td) && + VOP_ACCESS(tvp, VADMIN, tcnp->cn_cred, td)) { error = EPERM; goto bad; } @@ -1232,7 +1232,7 @@ abortit: xp->i_flag |= IN_CHANGE; ioflag = DOINGASYNC(tvp) ? 0 : IO_SYNC; if ((error = UFS_TRUNCATE(tvp, (off_t)0, ioflag, - tcnp->cn_cred, tcnp->cn_proc)) != 0) + tcnp->cn_cred, tcnp->cn_thread)) != 0) goto bad; } VN_KNOTE(tdvp, NOTE_WRITE); @@ -1307,7 +1307,7 @@ bad: out: if (doingdirectory) ip->i_flag &= ~IN_RENAME; - if (vn_lock(fvp, LK_EXCLUSIVE, p) == 0) { + if (vn_lock(fvp, LK_EXCLUSIVE, td) == 0) { ip->i_effnlink--; ip->i_nlink--; ip->i_flag |= IN_CHANGE; @@ -1432,7 +1432,7 @@ ufs_mkdir(ap) * Retrieve default ACL from parent, if any. */ error = VOP_GETACL(dvp, ACL_TYPE_DEFAULT, acl, cnp->cn_cred, - cnp->cn_proc); + cnp->cn_thread); switch (error) { case 0: /* @@ -1500,10 +1500,10 @@ ufs_mkdir(ap) * code that the EAs for the file need to be released? */ error = VOP_SETACL(tvp, ACL_TYPE_ACCESS, acl, cnp->cn_cred, - cnp->cn_proc); + cnp->cn_thread); if (error == 0) error = VOP_SETACL(tvp, ACL_TYPE_DEFAULT, dacl, - cnp->cn_cred, cnp->cn_proc); + cnp->cn_cred, cnp->cn_thread); switch (error) { case 0: break; @@ -1693,7 +1693,7 @@ ufs_rmdir(ap) ip->i_flag |= IN_CHANGE; ioflag = DOINGASYNC(vp) ? 0 : IO_SYNC; error = UFS_TRUNCATE(vp, (off_t)0, ioflag, cnp->cn_cred, - cnp->cn_proc); + cnp->cn_thread); } cache_purge(vp); #ifdef UFS_DIRHASH @@ -1738,7 +1738,7 @@ ufs_symlink(ap) } else error = vn_rdwr(UIO_WRITE, vp, ap->a_target, len, (off_t)0, UIO_SYSSPACE, IO_NODELOCKED, ap->a_cnp->cn_cred, (int *)0, - (struct proc *)0); + (struct thread *)0); if (error) vput(vp); return (error); @@ -2014,7 +2014,7 @@ ufsspec_close(ap) struct vnode *a_vp; int a_fflag; struct ucred *a_cred; - struct proc *a_p; + struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; @@ -2088,7 +2088,7 @@ ufsfifo_close(ap) struct vnode *a_vp; int a_fflag; struct ucred *a_cred; - struct proc *a_p; + struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; @@ -2310,7 +2310,7 @@ ufs_makeinode(mode, dvp, vpp, cnp) * Retrieve default ACL for parent, if any. */ error = VOP_GETACL(dvp, ACL_TYPE_DEFAULT, acl, cnp->cn_cred, - cnp->cn_proc); + cnp->cn_thread); switch (error) { case 0: /* @@ -2372,7 +2372,7 @@ ufs_makeinode(mode, dvp, vpp, cnp) * code that the EAs for the file need to be released? */ error = VOP_SETACL(tvp, ACL_TYPE_ACCESS, acl, cnp->cn_cred, - cnp->cn_proc); + cnp->cn_thread); switch (error) { case 0: break; diff --git a/sys/ufs/ufs/ufsmount.h b/sys/ufs/ufs/ufsmount.h index 4c73aa3..85c9866 100644 --- a/sys/ufs/ufs/ufsmount.h +++ b/sys/ufs/ufs/ufsmount.h @@ -88,7 +88,7 @@ struct ufsmount { int um_i_effnlink_valid; /* i_effnlink valid? */ int (*um_balloc) __P((struct vnode *, off_t, int, struct ucred *, int, struct buf **)); int (*um_blkatoff) __P((struct vnode *, off_t, char **, struct buf **)); - int (*um_truncate) __P((struct vnode *, off_t, int, struct ucred *, struct proc *)); + int (*um_truncate) __P((struct vnode *, off_t, int, struct ucred *, struct thread *)); int (*um_update) __P((struct vnode *, int)); int (*um_valloc) __P((struct vnode *, int, struct ucred *, struct vnode **)); int (*um_vfree) __P((struct vnode *, ino_t, int)); |