Index: share/man/man9/VOP_GETEXTATTR.9 =================================================================== --- share/man/man9/VOP_GETEXTATTR.9 (revision 199789) +++ share/man/man9/VOP_GETEXTATTR.9 (working copy) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 23, 1999 +.Dd November 30, 2009 .Os .Dt VOP_GETEXTATTR 9 .Sh NAME @@ -43,7 +43,6 @@ .Fa "struct uio *uio" .Fa "size_t *size" .Fa "struct ucred *cred" -.Fa "struct thread *td" .Fc .Sh DESCRIPTION This vnode call may be used to retrieve a specific named extended attribute @@ -74,9 +73,6 @@ when is not, and vise versa. .It Fa cred The user credentials to use in authorizing the request. -.It Fa td -The thread requesting the extended attribute. -.El .Pp The .Fa cred Index: share/man/man9/VOP_SETEXTATTR.9 =================================================================== --- share/man/man9/VOP_SETEXTATTR.9 (revision 199789) +++ share/man/man9/VOP_SETEXTATTR.9 (working copy) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 23, 1999 +.Dd November 30, 2009 .Os .Dt VOP_SETEXTATTR 9 .Sh NAME @@ -36,7 +36,7 @@ .In sys/vnode.h .In sys/extattr.h .Ft int -.Fn VOP_SETEXTATTR "struct vnode *vp" "int attrnamespace" "const char *name" "struct uio *uio" "struct ucred *cred" "struct thread *td" +.Fn VOP_SETEXTATTR "struct vnode *vp" "int attrnamespace" "const char *name" "struct uio *uio" "struct ucred *cred" .Sh DESCRIPTION This vnode call may be used to set specific named extended attribute for a file or directory. @@ -54,9 +54,6 @@ Pointer to a null-terminated character string cont The location of the data to be read or written. .It Fa cred The user credentials to use in authorizing the request. -.It Fa td -The thread setting the extended attribute. -.El .Pp The uio structure is used in a manner similar to the argument of the same name in Index: share/man/man9/VOP_LISTEXTATTR.9 =================================================================== --- share/man/man9/VOP_LISTEXTATTR.9 (revision 199789) +++ share/man/man9/VOP_LISTEXTATTR.9 (working copy) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 19, 2005 +.Dd November 30, 2009 .Os .Dt VOP_LISTEXTATTR 9 .Sh NAME @@ -47,7 +47,6 @@ .Fa "struct uio *uio" .Fa "size_t *size" .Fa "struct ucred *cred" -.Fa "struct thread *td" .Fc .Sh DESCRIPTION This vnode call may be used to retrieve a list of named extended attributes @@ -81,9 +80,6 @@ when is not, and vise versa. .It Fa cred The user credentials to use in authorizing the request. -.It Fa td -The thread requesting the extended attribute. -.El .Pp The .Fa cred Index: sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c =================================================================== --- sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c (revision 199789) +++ sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c (working copy) @@ -1477,7 +1477,6 @@ _xfs_getextattr( struct uio *a_uio; size_t *a_size; struct ucred *a_cred; - struct thread *a_td; } */ *ap) { int error; @@ -1485,7 +1484,7 @@ _xfs_getextattr( int size; error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, - ap->a_cred, ap->a_td, VREAD); + ap->a_cred, VREAD); if (error) return (error); @@ -1519,7 +1518,6 @@ _xfs_listextattr( struct uio *a_uio; size_t *a_size; struct ucred *a_cred; - struct thread *a_td; } */ *ap) { int error; @@ -1532,7 +1530,7 @@ _xfs_listextattr( int xfs_flags = ATTR_KERNAMELS; error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, - ap->a_cred, ap->a_td, VREAD); + ap->a_cred, VREAD); if (error) return (error); @@ -1595,7 +1593,6 @@ vop_setextattr { IN const char *a_name; INOUT struct uio *a_uio; IN struct ucred *a_cred; - IN struct thread *a_td; }; */ { @@ -1616,7 +1613,7 @@ vop_setextattr { return (EINVAL); error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, - ap->a_cred, ap->a_td, VWRITE); + ap->a_cred, VWRITE); if (error) return (error); @@ -1648,7 +1645,6 @@ vop_deleteextattr { IN int a_attrnamespace; IN const char *a_name; IN struct ucred *a_cred; - IN struct thread *a_td; }; */ { @@ -1661,7 +1657,7 @@ vop_deleteextattr { return (EINVAL); error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, - ap->a_cred, ap->a_td, VWRITE); + ap->a_cred, VWRITE); if (error) return (error); Index: sys/ufs/ufs/ufs_extattr.c =================================================================== --- sys/ufs/ufs/ufs_extattr.c (revision 199789) +++ sys/ufs/ufs/ufs_extattr.c (working copy) @@ -822,7 +822,6 @@ vop_getextattr { INOUT struct uio *a_uio; OUT size_t *a_size; IN struct ucred *a_cred; - IN struct thread *a_td; }; */ { @@ -830,12 +829,12 @@ vop_getextattr { struct ufsmount *ump = VFSTOUFS(mp); int error; - ufs_extattr_uepm_lock(ump, ap->a_td); + ufs_extattr_uepm_lock(ump); error = ufs_extattr_get(ap->a_vp, ap->a_attrnamespace, ap->a_name, - ap->a_uio, ap->a_size, ap->a_cred, ap->a_td); + ap->a_uio, ap->a_size, ap->a_cred); - ufs_extattr_uepm_unlock(ump, ap->a_td); + ufs_extattr_uepm_unlock(ump); return (error); } @@ -846,7 +845,7 @@ vop_getextattr { */ static int ufs_extattr_get(struct vnode *vp, int attrnamespace, const char *name, - struct uio *uio, size_t *size, struct ucred *cred, struct thread *td) + struct uio *uio, size_t *size, struct ucred *cred) { struct ufs_extattr_list_entry *attribute; struct ufs_extattr_header ueh; @@ -865,7 +864,7 @@ ufs_extattr_get(struct vnode *vp, int attrnamespac if (strlen(name) == 0) return (EINVAL); - error = extattr_check_cred(vp, attrnamespace, cred, td, VREAD); + error = extattr_check_cred(vp, attrnamespace, cred, VREAD); if (error) return (error); @@ -900,7 +899,7 @@ ufs_extattr_get(struct vnode *vp, int attrnamespac local_aio.uio_iovcnt = 1; local_aio.uio_rw = UIO_READ; local_aio.uio_segflg = UIO_SYSSPACE; - local_aio.uio_td = td; + local_aio.uio_td = curthread; local_aio.uio_offset = base_offset; local_aio.uio_resid = sizeof(struct ufs_extattr_header); @@ -992,7 +991,6 @@ vop_deleteextattr { IN int a_attrnamespace; IN const char *a_name; IN struct ucred *a_cred; - IN struct thread *a_td; }; */ { @@ -1000,14 +998,13 @@ vop_deleteextattr { struct ufsmount *ump = VFSTOUFS(mp); int error; - ufs_extattr_uepm_lock(ump, ap->a_td); + ufs_extattr_uepm_lock(ump); error = ufs_extattr_rm(ap->a_vp, ap->a_attrnamespace, ap->a_name, - ap->a_cred, ap->a_td); + ap->a_cred); + ufs_extattr_uepm_unlock(ump); - ufs_extattr_uepm_unlock(ump, ap->a_td); - return (error); } @@ -1023,7 +1020,6 @@ vop_setextattr { IN const char *a_name; INOUT struct uio *a_uio; IN struct ucred *a_cred; - IN struct thread *a_td; }; */ { @@ -1031,7 +1027,7 @@ vop_setextattr { struct ufsmount *ump = VFSTOUFS(mp); int error; - ufs_extattr_uepm_lock(ump, ap->a_td); + ufs_extattr_uepm_lock(ump); /* * XXX: No longer a supported way to delete extended attributes. @@ -1040,9 +1036,9 @@ vop_setextattr { return (EINVAL); error = ufs_extattr_set(ap->a_vp, ap->a_attrnamespace, ap->a_name, - ap->a_uio, ap->a_cred, ap->a_td); + ap->a_uio, ap->a_cred); - ufs_extattr_uepm_unlock(ump, ap->a_td); + ufs_extattr_uepm_unlock(ump); return (error); } @@ -1053,7 +1049,7 @@ vop_setextattr { */ static int ufs_extattr_set(struct vnode *vp, int attrnamespace, const char *name, - struct uio *uio, struct ucred *cred, struct thread *td) + struct uio *uio, struct ucred *cred) { struct ufs_extattr_list_entry *attribute; struct ufs_extattr_header ueh; @@ -1072,7 +1068,7 @@ ufs_extattr_set(struct vnode *vp, int attrnamespac if (!ufs_extattr_valid_attrname(attrnamespace, name)) return (EINVAL); - error = extattr_check_cred(vp, attrnamespace, cred, td, VWRITE); + error = extattr_check_cred(vp, attrnamespace, cred, VWRITE); if (error) return (error); @@ -1109,7 +1105,7 @@ ufs_extattr_set(struct vnode *vp, int attrnamespac local_aio.uio_iovcnt = 1; local_aio.uio_rw = UIO_WRITE; local_aio.uio_segflg = UIO_SYSSPACE; - local_aio.uio_td = td; + local_aio.uio_td = curthread; local_aio.uio_offset = base_offset; local_aio.uio_resid = sizeof(struct ufs_extattr_header); @@ -1161,7 +1157,7 @@ vopunlock_exit: */ static int ufs_extattr_rm(struct vnode *vp, int attrnamespace, const char *name, - struct ucred *cred, struct thread *td) + struct ucred *cred) { struct ufs_extattr_list_entry *attribute; struct ufs_extattr_header ueh; @@ -1180,7 +1176,7 @@ ufs_extattr_rm(struct vnode *vp, int attrnamespace if (!ufs_extattr_valid_attrname(attrnamespace, name)) return (EINVAL); - error = extattr_check_cred(vp, attrnamespace, cred, td, VWRITE); + error = extattr_check_cred(vp, attrnamespace, cred, VWRITE); if (error) return (error); @@ -1207,7 +1203,7 @@ ufs_extattr_rm(struct vnode *vp, int attrnamespace local_aio.uio_iovcnt = 1; local_aio.uio_rw = UIO_READ; local_aio.uio_segflg = UIO_SYSSPACE; - local_aio.uio_td = td; + local_aio.uio_td = curthread; local_aio.uio_offset = base_offset; local_aio.uio_resid = sizeof(struct ufs_extattr_header); @@ -1253,7 +1249,7 @@ ufs_extattr_rm(struct vnode *vp, int attrnamespace local_aio.uio_iovcnt = 1; local_aio.uio_rw = UIO_WRITE; local_aio.uio_segflg = UIO_SYSSPACE; - local_aio.uio_td = td; + local_aio.uio_td = curthread; local_aio.uio_offset = base_offset; local_aio.uio_resid = sizeof(struct ufs_extattr_header); Index: sys/ufs/ffs/ffs_vnops.c =================================================================== --- sys/ufs/ffs/ffs_vnops.c (revision 199789) +++ sys/ufs/ffs/ffs_vnops.c (working copy) @@ -1208,7 +1208,7 @@ ffs_findextattr(u_char *ptr, u_int length, int nsp } static int -ffs_rdextattr(u_char **p, struct vnode *vp, struct thread *td, int extra) +ffs_rdextattr(u_char **p, struct vnode *vp, int extra) { struct inode *ip; struct ufs2_dinode *dp; @@ -1235,7 +1235,7 @@ static int luio.uio_resid = easize; luio.uio_segflg = UIO_SYSSPACE; luio.uio_rw = UIO_READ; - luio.uio_td = td; + luio.uio_td = curthread; error = ffs_extread(vp, &luio, IO_EXT | IO_SYNC); if (error) { @@ -1276,7 +1276,7 @@ ffs_unlock_ea(struct vnode *vp) } static int -ffs_open_ea(struct vnode *vp, struct ucred *cred, struct thread *td) +ffs_open_ea(struct vnode *vp, struct ucred *cred) { struct inode *ip; struct ufs2_dinode *dp; @@ -1291,7 +1291,7 @@ static int return (0); } dp = ip->i_din2; - error = ffs_rdextattr(&ip->i_ea_area, vp, td, 0); + error = ffs_rdextattr(&ip->i_ea_area, vp, 0); if (error) { ffs_unlock_ea(vp); return (error); @@ -1307,7 +1307,7 @@ static int * Vnode extattr transaction commit/abort */ static int -ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred, struct thread *td) +ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred) { struct inode *ip; struct uio luio; @@ -1336,10 +1336,10 @@ static int luio.uio_resid = ip->i_ea_len; luio.uio_segflg = UIO_SYSSPACE; luio.uio_rw = UIO_WRITE; - luio.uio_td = td; + luio.uio_td = curthread; /* XXX: I'm not happy about truncating to zero size */ if (ip->i_ea_len < dp->di_extsize) - error = ffs_truncate(vp, 0, IO_EXT, cred, td); + error = ffs_truncate(vp, 0, IO_EXT, cred, curthread); error = ffs_extwrite(vp, &luio, IO_EXT | IO_SYNC, cred); } if (--ip->i_ea_refs == 0) { @@ -1391,7 +1391,6 @@ struct vop_openextattr_args { struct vnodeop_desc *a_desc; struct vnode *a_vp; IN struct ucred *a_cred; - IN struct thread *a_td; }; */ { @@ -1404,7 +1403,7 @@ struct vop_openextattr_args { if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK) return (EOPNOTSUPP); - return (ffs_open_ea(ap->a_vp, ap->a_cred, ap->a_td)); + return (ffs_open_ea(ap->a_vp, ap->a_cred)); } @@ -1419,7 +1418,6 @@ struct vop_closeextattr_args { struct vnode *a_vp; int a_commit; IN struct ucred *a_cred; - IN struct thread *a_td; }; */ { @@ -1435,7 +1433,7 @@ struct vop_closeextattr_args { if (ap->a_commit && (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY)) return (EROFS); - return (ffs_close_ea(ap->a_vp, ap->a_commit, ap->a_cred, ap->a_td)); + return (ffs_close_ea(ap->a_vp, ap->a_commit, ap->a_cred)); } /* @@ -1449,7 +1447,6 @@ vop_deleteextattr { IN int a_attrnamespace; IN const char *a_name; IN struct ucred *a_cred; - IN struct thread *a_td; }; */ { @@ -1472,7 +1469,7 @@ vop_deleteextattr { return (EROFS); error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, - ap->a_cred, ap->a_td, VWRITE); + ap->a_cred, VWRITE); if (error) { /* @@ -1484,7 +1481,7 @@ vop_deleteextattr { return (error); } - error = ffs_open_ea(ap->a_vp, ap->a_cred, ap->a_td); + error = ffs_open_ea(ap->a_vp, ap->a_cred); if (error) return (error); @@ -1499,7 +1496,7 @@ vop_deleteextattr { if (olen == -1) { /* delete but nonexistent */ free(eae, M_TEMP); - ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td); + ffs_close_ea(ap->a_vp, 0, ap->a_cred); return(ENOATTR); } bcopy(p, &ul, sizeof ul); @@ -1510,7 +1507,7 @@ vop_deleteextattr { } if (easize > NXADDR * fs->fs_bsize) { free(eae, M_TEMP); - ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td); + ffs_close_ea(ap->a_vp, 0, ap->a_cred); if (ip->i_ea_area != NULL && ip->i_ea_error == 0) ip->i_ea_error = ENOSPC; return(ENOSPC); @@ -1519,7 +1516,7 @@ vop_deleteextattr { ip->i_ea_area = eae; ip->i_ea_len = easize; free(p, M_TEMP); - error = ffs_close_ea(ap->a_vp, 1, ap->a_cred, ap->a_td); + error = ffs_close_ea(ap->a_vp, 1, ap->a_cred); return(error); } @@ -1536,7 +1533,6 @@ vop_getextattr { INOUT struct uio *a_uio; OUT size_t *a_size; IN struct ucred *a_cred; - IN struct thread *a_td; }; */ { @@ -1553,11 +1549,11 @@ vop_getextattr { return (EOPNOTSUPP); error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, - ap->a_cred, ap->a_td, VREAD); + ap->a_cred, VREAD); if (error) return (error); - error = ffs_open_ea(ap->a_vp, ap->a_cred, ap->a_td); + error = ffs_open_ea(ap->a_vp, ap->a_cred); if (error) return (error); @@ -1575,7 +1571,7 @@ vop_getextattr { } else error = ENOATTR; - ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td); + ffs_close_ea(ap->a_vp, 0, ap->a_cred); return(error); } @@ -1591,7 +1587,6 @@ vop_listextattr { INOUT struct uio *a_uio; OUT size_t *a_size; IN struct ucred *a_cred; - IN struct thread *a_td; }; */ { @@ -1609,11 +1604,11 @@ vop_listextattr { return (EOPNOTSUPP); error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, - ap->a_cred, ap->a_td, VREAD); + ap->a_cred, VREAD); if (error) return (error); - error = ffs_open_ea(ap->a_vp, ap->a_cred, ap->a_td); + error = ffs_open_ea(ap->a_vp, ap->a_cred); if (error) return (error); eae = ip->i_ea_area; @@ -1639,7 +1634,7 @@ vop_listextattr { error = uiomove(p, ealen + 1, ap->a_uio); } } - ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td); + ffs_close_ea(ap->a_vp, 0, ap->a_cred); return(error); } @@ -1655,7 +1650,6 @@ vop_setextattr { IN const char *a_name; INOUT struct uio *a_uio; IN struct ucred *a_cred; - IN struct thread *a_td; }; */ { @@ -1682,7 +1676,7 @@ vop_setextattr { return (EROFS); error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, - ap->a_cred, ap->a_td, VWRITE); + ap->a_cred, VWRITE); if (error) { /* @@ -1694,7 +1688,7 @@ vop_setextattr { return (error); } - error = ffs_open_ea(ap->a_vp, ap->a_cred, ap->a_td); + error = ffs_open_ea(ap->a_vp, ap->a_cred); if (error) return (error); @@ -1728,7 +1722,7 @@ vop_setextattr { } if (easize > NXADDR * fs->fs_bsize) { free(eae, M_TEMP); - ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td); + ffs_close_ea(ap->a_vp, 0, ap->a_cred); if (ip->i_ea_area != NULL && ip->i_ea_error == 0) ip->i_ea_error = ENOSPC; return(ENOSPC); @@ -1745,7 +1739,7 @@ vop_setextattr { error = uiomove(p, ealen, ap->a_uio); if (error) { free(eae, M_TEMP); - ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td); + ffs_close_ea(ap->a_vp, 0, ap->a_cred); if (ip->i_ea_area != NULL && ip->i_ea_error == 0) ip->i_ea_error = error; return(error); @@ -1757,7 +1751,7 @@ vop_setextattr { ip->i_ea_area = eae; ip->i_ea_len = easize; free(p, M_TEMP); - error = ffs_close_ea(ap->a_vp, 1, ap->a_cred, ap->a_td); + error = ffs_close_ea(ap->a_vp, 1, ap->a_cred); return(error); } Index: sys/kern/vfs_vnops.c =================================================================== --- sys/kern/vfs_vnops.c (revision 199789) +++ sys/kern/vfs_vnops.c (working copy) @@ -1216,8 +1216,7 @@ vn_extattr_get(struct vnode *vp, int ioflg, int at ASSERT_VOP_LOCKED(vp, "IO_NODELOCKED with no vp lock held"); /* authorize attribute retrieval as kernel */ - error = VOP_GETEXTATTR(vp, attrnamespace, attrname, &auio, NULL, NULL, - td); + error = VOP_GETEXTATTR(vp, attrnamespace, attrname, &auio, NULL, NULL); if ((ioflg & IO_NODELOCKED) == 0) VOP_UNLOCK(vp, 0); @@ -1261,7 +1260,7 @@ vn_extattr_set(struct vnode *vp, int ioflg, int at ASSERT_VOP_LOCKED(vp, "IO_NODELOCKED with no vp lock held"); /* authorize attribute setting as kernel */ - error = VOP_SETEXTATTR(vp, attrnamespace, attrname, &auio, NULL, td); + error = VOP_SETEXTATTR(vp, attrnamespace, attrname, &auio, NULL); if ((ioflg & IO_NODELOCKED) == 0) { vn_finished_write(mp); @@ -1287,10 +1286,10 @@ vn_extattr_rm(struct vnode *vp, int ioflg, int att ASSERT_VOP_LOCKED(vp, "IO_NODELOCKED with no vp lock held"); /* authorize attribute removal as kernel */ - error = VOP_DELETEEXTATTR(vp, attrnamespace, attrname, NULL, td); + error = VOP_DELETEEXTATTR(vp, attrnamespace, attrname, NULL); if (error == EOPNOTSUPP) error = VOP_SETEXTATTR(vp, attrnamespace, attrname, NULL, - NULL, td); + NULL); if ((ioflg & IO_NODELOCKED) == 0) { vn_finished_write(mp); Index: sys/kern/vfs_extattr.c =================================================================== --- sys/kern/vfs_extattr.c (revision 199789) +++ sys/kern/vfs_extattr.c (working copy) @@ -198,7 +198,7 @@ extattr_set_vp(struct vnode *vp, int attrnamespace #endif error = VOP_SETEXTATTR(vp, attrnamespace, attrname, &auio, - td->td_ucred, td); + td->td_ucred); cnt -= auio.uio_resid; td->td_retval[0] = cnt; @@ -375,7 +375,7 @@ extattr_get_vp(struct vnode *vp, int attrnamespace #endif error = VOP_GETEXTATTR(vp, attrnamespace, attrname, auiop, sizep, - td->td_ucred, td); + td->td_ucred); if (auiop != NULL) { cnt -= auio.uio_resid; @@ -527,11 +527,10 @@ extattr_delete_vp(struct vnode *vp, int attrnamesp goto done; #endif - error = VOP_DELETEEXTATTR(vp, attrnamespace, attrname, td->td_ucred, - td); + error = VOP_DELETEEXTATTR(vp, attrnamespace, attrname, td->td_ucred); if (error == EOPNOTSUPP) error = VOP_SETEXTATTR(vp, attrnamespace, attrname, NULL, - td->td_ucred, td); + td->td_ucred); #ifdef MAC done: #endif @@ -690,7 +689,7 @@ extattr_list_vp(struct vnode *vp, int attrnamespac #endif error = VOP_LISTEXTATTR(vp, attrnamespace, auiop, sizep, - td->td_ucred, td); + td->td_ucred); if (auiop != NULL) { cnt -= auio.uio_resid; Index: sys/kern/vnode_if.src =================================================================== --- sys/kern/vnode_if.src (revision 199789) +++ sys/kern/vnode_if.src (working copy) @@ -523,7 +523,6 @@ vop_closeextattr { IN struct vnode *vp; IN int commit; IN struct ucred *cred; - IN struct thread *td; }; @@ -536,7 +535,6 @@ vop_getextattr { INOUT struct uio *uio; OUT size_t *size; IN struct ucred *cred; - IN struct thread *td; }; @@ -548,7 +546,6 @@ vop_listextattr { INOUT struct uio *uio; OUT size_t *size; IN struct ucred *cred; - IN struct thread *td; }; @@ -557,7 +554,6 @@ vop_listextattr { vop_openextattr { IN struct vnode *vp; IN struct ucred *cred; - IN struct thread *td; }; @@ -568,7 +564,6 @@ vop_deleteextattr { IN int attrnamespace; IN const char *name; IN struct ucred *cred; - IN struct thread *td; }; @@ -580,7 +575,6 @@ vop_setextattr { IN const char *name; INOUT struct uio *uio; IN struct ucred *cred; - IN struct thread *td; }; Index: sys/kern/vfs_subr.c =================================================================== --- sys/kern/vfs_subr.c (revision 199789) +++ sys/kern/vfs_subr.c (working copy) @@ -3638,7 +3638,7 @@ privcheck: */ int extattr_check_cred(struct vnode *vp, int attrnamespace, struct ucred *cred, - struct thread *td, accmode_t accmode) + accmode_t accmode) { /* @@ -3656,7 +3656,7 @@ extattr_check_cred(struct vnode *vp, int attrnames /* Potentially should be: return (EPERM); */ return (priv_check_cred(cred, PRIV_VFS_EXTATTR_SYSTEM, 0)); case EXTATTR_NAMESPACE_USER: - return (VOP_ACCESS(vp, accmode, cred, td)); + return (VOP_ACCESS(vp, accmode, cred, curthread)); default: return (EPERM); } Index: sys/fs/unionfs/union_vnops.c =================================================================== --- sys/fs/unionfs/union_vnops.c (revision 199789) +++ sys/fs/unionfs/union_vnops.c (working copy) @@ -2147,7 +2147,7 @@ unionfs_openextattr(struct vop_openextattr_args *a (tvp == unp->un_lowervp && (unp->un_flag & UNIONFS_OPENEXTL))) return (EBUSY); - error = VOP_OPENEXTATTR(tvp, ap->a_cred, ap->a_td); + error = VOP_OPENEXTATTR(tvp, ap->a_cred); if (error == 0) { vn_lock(vp, LK_UPGRADE | LK_RETRY); @@ -2183,7 +2183,7 @@ unionfs_closeextattr(struct vop_closeextattr_args if (tvp == NULLVP) return (EOPNOTSUPP); - error = VOP_CLOSEEXTATTR(tvp, ap->a_commit, ap->a_cred, ap->a_td); + error = VOP_CLOSEEXTATTR(tvp, ap->a_commit, ap->a_cred); if (error == 0) { vn_lock(vp, LK_UPGRADE | LK_RETRY); @@ -2217,7 +2217,7 @@ unionfs_getextattr(struct vop_getextattr_args *ap) return (EOPNOTSUPP); return (VOP_GETEXTATTR(vp, ap->a_attrnamespace, ap->a_name, - ap->a_uio, ap->a_size, ap->a_cred, ap->a_td)); + ap->a_uio, ap->a_size, ap->a_cred)); } static int @@ -2229,7 +2229,6 @@ unionfs_setextattr(struct vop_setextattr_args *ap) struct vnode *lvp; struct vnode *ovp; struct ucred *cred; - struct thread *td; KASSERT_UNIONFS_VNODE(ap->a_vp); @@ -2239,7 +2238,6 @@ unionfs_setextattr(struct vop_setextattr_args *ap) lvp = unp->un_lowervp; ovp = NULLVP; cred = ap->a_cred; - td = ap->a_td; UNIONFS_INTERNAL_DEBUG("unionfs_setextattr: enter (un_flag=%x)\n", unp->un_flag); @@ -2255,12 +2253,12 @@ unionfs_setextattr(struct vop_setextattr_args *ap) return (EOPNOTSUPP); if (ovp == lvp && lvp->v_type == VREG) { - VOP_CLOSEEXTATTR(lvp, 0, cred, td); + VOP_CLOSEEXTATTR(lvp, 0, cred); if (uvp == NULLVP && - (error = unionfs_copyfile(unp, 1, cred, td)) != 0) { + (error = unionfs_copyfile(unp, 1, cred, curthread)) != 0) { unionfs_setextattr_reopen: if ((unp->un_flag & UNIONFS_OPENEXTL) && - VOP_OPENEXTATTR(lvp, cred, td)) { + VOP_OPENEXTATTR(lvp, cred)) { #ifdef DIAGNOSTIC panic("unionfs: VOP_OPENEXTATTR failed"); #endif @@ -2269,7 +2267,7 @@ unionfs_setextattr_reopen: goto unionfs_setextattr_abort; } uvp = unp->un_uppervp; - if ((error = VOP_OPENEXTATTR(uvp, cred, td)) != 0) + if ((error = VOP_OPENEXTATTR(uvp, cred)) != 0) goto unionfs_setextattr_reopen; unp->un_flag &= ~UNIONFS_OPENEXTL; unp->un_flag |= UNIONFS_OPENEXTU; @@ -2278,7 +2276,7 @@ unionfs_setextattr_reopen: if (ovp == uvp) error = VOP_SETEXTATTR(ovp, ap->a_attrnamespace, ap->a_name, - ap->a_uio, cred, td); + ap->a_uio, cred); unionfs_setextattr_abort: UNIONFS_INTERNAL_DEBUG("unionfs_setextattr: leave (%d)\n", error); @@ -2306,7 +2304,7 @@ unionfs_listextattr(struct vop_listextattr_args *a return (EOPNOTSUPP); return (VOP_LISTEXTATTR(vp, ap->a_attrnamespace, ap->a_uio, - ap->a_size, ap->a_cred, ap->a_td)); + ap->a_size, ap->a_cred)); } static int @@ -2318,7 +2316,6 @@ unionfs_deleteextattr(struct vop_deleteextattr_arg struct vnode *lvp; struct vnode *ovp; struct ucred *cred; - struct thread *td; KASSERT_UNIONFS_VNODE(ap->a_vp); @@ -2328,7 +2325,6 @@ unionfs_deleteextattr(struct vop_deleteextattr_arg lvp = unp->un_lowervp; ovp = NULLVP; cred = ap->a_cred; - td = ap->a_td; UNIONFS_INTERNAL_DEBUG("unionfs_deleteextattr: enter (un_flag=%x)\n", unp->un_flag); @@ -2344,12 +2340,12 @@ unionfs_deleteextattr(struct vop_deleteextattr_arg return (EOPNOTSUPP); if (ovp == lvp && lvp->v_type == VREG) { - VOP_CLOSEEXTATTR(lvp, 0, cred, td); + VOP_CLOSEEXTATTR(lvp, 0, cred); if (uvp == NULLVP && - (error = unionfs_copyfile(unp, 1, cred, td)) != 0) { + (error = unionfs_copyfile(unp, 1, cred, curthread)) != 0) { unionfs_deleteextattr_reopen: if ((unp->un_flag & UNIONFS_OPENEXTL) && - VOP_OPENEXTATTR(lvp, cred, td)) { + VOP_OPENEXTATTR(lvp, cred)) { #ifdef DIAGNOSTIC panic("unionfs: VOP_OPENEXTATTR failed"); #endif @@ -2358,7 +2354,7 @@ unionfs_deleteextattr_reopen: goto unionfs_deleteextattr_abort; } uvp = unp->un_uppervp; - if ((error = VOP_OPENEXTATTR(uvp, cred, td)) != 0) + if ((error = VOP_OPENEXTATTR(uvp, cred)) != 0) goto unionfs_deleteextattr_reopen; unp->un_flag &= ~UNIONFS_OPENEXTL; unp->un_flag |= UNIONFS_OPENEXTU; @@ -2367,7 +2363,7 @@ unionfs_deleteextattr_reopen: if (ovp == uvp) error = VOP_DELETEEXTATTR(ovp, ap->a_attrnamespace, ap->a_name, - ap->a_cred, ap->a_td); + ap->a_cred); unionfs_deleteextattr_abort: UNIONFS_INTERNAL_DEBUG("unionfs_deleteextattr: leave (%d)\n", error); Index: sys/fs/smbfs/smbfs_vnops.c =================================================================== --- sys/fs/smbfs/smbfs_vnops.c (revision 199789) +++ sys/fs/smbfs/smbfs_vnops.c (working copy) @@ -888,12 +888,10 @@ smbfs_getextattr(struct vop_getextattr_args *ap) IN char *a_name; INOUT struct uio *a_uio; IN struct ucred *a_cred; - IN struct thread *a_td; }; */ { struct vnode *vp = ap->a_vp; - struct thread *td = ap->a_td; struct ucred *cred = ap->a_cred; struct uio *uio = ap->a_uio; const char *name = ap->a_name; @@ -902,7 +900,7 @@ smbfs_getextattr(struct vop_getextattr_args *ap) char buf[10]; int i, attr, error; - error = VOP_ACCESS(vp, VREAD, cred, td); + error = VOP_ACCESS(vp, VREAD, cred, curthread); if (error) return error; error = VOP_GETATTR(vp, &vattr, cred); Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c (revision 199789) +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c (working copy) @@ -4566,12 +4566,10 @@ vop_getextattr { INOUT struct uio *a_uio; OUT size_t *a_size; IN struct ucred *a_cred; - IN struct thread *a_td; }; */ { zfsvfs_t *zfsvfs = VTOZ(ap->a_vp)->z_zfsvfs; - struct thread *td = ap->a_td; struct nameidata nd; char attrname[255]; struct vattr va; @@ -4579,7 +4577,7 @@ vop_getextattr { int error, flags; error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, - ap->a_cred, ap->a_td, VREAD); + ap->a_cred, VREAD); if (error != 0) return (error); @@ -4590,7 +4588,7 @@ vop_getextattr { ZFS_ENTER(zfsvfs); - error = zfs_lookup(ap->a_vp, NULL, &xvp, NULL, 0, ap->a_cred, td, + error = zfs_lookup(ap->a_vp, NULL, &xvp, NULL, 0, ap->a_cred, curthread, LOOKUP_XATTR); if (error != 0) { ZFS_EXIT(zfsvfs); @@ -4599,7 +4597,7 @@ vop_getextattr { flags = FREAD; NDINIT_ATVP(&nd, LOOKUP, NOFOLLOW | MPSAFE, UIO_SYSSPACE, attrname, - xvp, td); + xvp, curthread); error = vn_open_cred(&nd, &flags, 0, 0, ap->a_cred, NULL); vp = nd.ni_vp; NDFREE(&nd, NDF_ONLY_PNBUF); @@ -4618,7 +4616,7 @@ vop_getextattr { error = VOP_READ(vp, ap->a_uio, IO_UNIT | IO_SYNC, ap->a_cred); VOP_UNLOCK(vp, 0); - vn_close(vp, flags, ap->a_cred, td); + vn_close(vp, flags, ap->a_cred, curthread); ZFS_EXIT(zfsvfs); return (error); @@ -4635,12 +4633,10 @@ vop_deleteextattr { IN int a_attrnamespace; IN const char *a_name; IN struct ucred *a_cred; - IN struct thread *a_td; }; */ { zfsvfs_t *zfsvfs = VTOZ(ap->a_vp)->z_zfsvfs; - struct thread *td = ap->a_td; struct nameidata nd; char attrname[255]; struct vattr va; @@ -4648,7 +4644,7 @@ vop_deleteextattr { int error, flags; error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, - ap->a_cred, ap->a_td, VWRITE); + ap->a_cred, VWRITE); if (error != 0) return (error); @@ -4659,7 +4655,7 @@ vop_deleteextattr { ZFS_ENTER(zfsvfs); - error = zfs_lookup(ap->a_vp, NULL, &xvp, NULL, 0, ap->a_cred, td, + error = zfs_lookup(ap->a_vp, NULL, &xvp, NULL, 0, ap->a_cred, curthread, LOOKUP_XATTR); if (error != 0) { ZFS_EXIT(zfsvfs); @@ -4667,7 +4663,7 @@ vop_deleteextattr { } NDINIT_ATVP(&nd, DELETE, NOFOLLOW | LOCKPARENT | LOCKLEAF | MPSAFE, - UIO_SYSSPACE, attrname, xvp, td); + UIO_SYSSPACE, attrname, xvp, curthread); error = namei(&nd); vp = nd.ni_vp; NDFREE(&nd, NDF_ONLY_PNBUF); @@ -4701,12 +4697,10 @@ vop_setextattr { IN const char *a_name; INOUT struct uio *a_uio; IN struct ucred *a_cred; - IN struct thread *a_td; }; */ { zfsvfs_t *zfsvfs = VTOZ(ap->a_vp)->z_zfsvfs; - struct thread *td = ap->a_td; struct nameidata nd; char attrname[255]; struct vattr va; @@ -4714,7 +4708,7 @@ vop_setextattr { int error, flags; error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, - ap->a_cred, ap->a_td, VWRITE); + ap->a_cred, VWRITE); if (error != 0) return (error); @@ -4725,7 +4719,7 @@ vop_setextattr { ZFS_ENTER(zfsvfs); - error = zfs_lookup(ap->a_vp, NULL, &xvp, NULL, 0, ap->a_cred, td, + error = zfs_lookup(ap->a_vp, NULL, &xvp, NULL, 0, ap->a_cred, curthread, LOOKUP_XATTR | CREATE_XATTR_DIR); if (error != 0) { ZFS_EXIT(zfsvfs); @@ -4734,7 +4728,7 @@ vop_setextattr { flags = FFLAGS(O_WRONLY | O_CREAT); NDINIT_ATVP(&nd, LOOKUP, NOFOLLOW | MPSAFE, UIO_SYSSPACE, attrname, - xvp, td); + xvp, curthread); error = vn_open_cred(&nd, &flags, 0600, 0, ap->a_cred, NULL); vp = nd.ni_vp; NDFREE(&nd, NDF_ONLY_PNBUF); @@ -4750,7 +4744,7 @@ vop_setextattr { VOP_WRITE(vp, ap->a_uio, IO_UNIT | IO_SYNC, ap->a_cred); VOP_UNLOCK(vp, 0); - vn_close(vp, flags, ap->a_cred, td); + vn_close(vp, flags, ap->a_cred, curthread); ZFS_EXIT(zfsvfs); return (error); @@ -4768,12 +4762,10 @@ vop_listextattr { INOUT struct uio *a_uio; OUT size_t *a_size; IN struct ucred *a_cred; - IN struct thread *a_td; }; */ { zfsvfs_t *zfsvfs = VTOZ(ap->a_vp)->z_zfsvfs; - struct thread *td = ap->a_td; struct nameidata nd; char attrprefix[16]; u_char dirbuf[sizeof(struct dirent)]; @@ -4786,7 +4778,7 @@ vop_listextattr { int done, error, eof, pos; error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, - ap->a_cred, ap->a_td, VREAD); + ap->a_cred, VREAD); if (error != 0) return (error); @@ -4801,7 +4793,7 @@ vop_listextattr { if (sizep != NULL) *sizep = 0; - error = zfs_lookup(ap->a_vp, NULL, &xvp, NULL, 0, ap->a_cred, td, + error = zfs_lookup(ap->a_vp, NULL, &xvp, NULL, 0, ap->a_cred, curthread, LOOKUP_XATTR); if (error != 0) { ZFS_EXIT(zfsvfs); @@ -4815,7 +4807,7 @@ vop_listextattr { } NDINIT_ATVP(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | LOCKSHARED | MPSAFE, - UIO_SYSSPACE, ".", xvp, td); + UIO_SYSSPACE, ".", xvp, curthread); error = namei(&nd); vp = nd.ni_vp; NDFREE(&nd, NDF_ONLY_PNBUF); @@ -4827,7 +4819,7 @@ vop_listextattr { auio.uio_iov = &aiov; auio.uio_iovcnt = 1; auio.uio_segflg = UIO_SYSSPACE; - auio.uio_td = td; + auio.uio_td = curthread; auio.uio_rw = UIO_READ; auio.uio_offset = 0; Index: sys/security/mac/mac_vfs.c =================================================================== --- sys/security/mac/mac_vfs.c (revision 199789) +++ sys/security/mac/mac_vfs.c (working copy) @@ -284,7 +284,7 @@ mac_vnode_create_extattr(struct ucred *cred, struc ASSERT_VOP_LOCKED(dvp, "mac_vnode_create_extattr"); ASSERT_VOP_LOCKED(vp, "mac_vnode_create_extattr"); - error = VOP_OPENEXTATTR(vp, cred, curthread); + error = VOP_OPENEXTATTR(vp, cred); if (error == EOPNOTSUPP) { if (ea_warn_once == 0) { printf("Warning: transactions not supported " @@ -298,11 +298,11 @@ mac_vnode_create_extattr(struct ucred *cred, struc dvp->v_label, vp, vp->v_label, cnp); if (error) { - VOP_CLOSEEXTATTR(vp, 0, NOCRED, curthread); + VOP_CLOSEEXTATTR(vp, 0, NOCRED); return (error); } - error = VOP_CLOSEEXTATTR(vp, 1, NOCRED, curthread); + error = VOP_CLOSEEXTATTR(vp, 1, NOCRED); if (error == EOPNOTSUPP) error = 0; @@ -317,7 +317,7 @@ mac_vnode_setlabel_extattr(struct ucred *cred, str ASSERT_VOP_LOCKED(vp, "mac_vnode_setlabel_extattr"); - error = VOP_OPENEXTATTR(vp, cred, curthread); + error = VOP_OPENEXTATTR(vp, cred); if (error == EOPNOTSUPP) { if (ea_warn_once == 0) { printf("Warning: transactions not supported " @@ -331,11 +331,11 @@ mac_vnode_setlabel_extattr(struct ucred *cred, str intlabel); if (error) { - VOP_CLOSEEXTATTR(vp, 0, NOCRED, curthread); + VOP_CLOSEEXTATTR(vp, 0, NOCRED); return (error); } - error = VOP_CLOSEEXTATTR(vp, 1, NOCRED, curthread); + error = VOP_CLOSEEXTATTR(vp, 1, NOCRED); if (error == EOPNOTSUPP) error = 0; Index: sys/sys/extattr.h =================================================================== --- sys/sys/extattr.h (revision 199789) +++ sys/sys/extattr.h (working copy) @@ -61,11 +61,10 @@ #include #define EXTATTR_MAXNAMELEN NAME_MAX -struct thread; struct ucred; struct vnode; int extattr_check_cred(struct vnode *vp, int attrnamespace, - struct ucred *cred, struct thread *td, accmode_t accmode); + struct ucred *cred, accmode_t accmode); #else #include