Beispiel #1
0
/*
 * Called by UFS when an inode is no longer active and should have its
 * attributes stripped.
 */
void
ufs_extattr_vnode_inactive(struct vnode *vp, struct thread *td)
{
	struct ufs_extattr_list_entry *uele;
	struct mount *mp = vp->v_mount;
	struct ufsmount *ump = VFSTOUFS(mp);

	/*
	 * In that case, we cannot lock. We should not have any active vnodes
	 * on the fs if this is not yet initialized but is going to be, so
	 * this can go unlocked.
	 */
	if (!(ump->um_extattr.uepm_flags & UFS_EXTATTR_UEPM_INITIALIZED))
		return;

	ufs_extattr_uepm_lock(ump);

	if (!(ump->um_extattr.uepm_flags & UFS_EXTATTR_UEPM_STARTED)) {
		ufs_extattr_uepm_unlock(ump);
		return;
	}

	LIST_FOREACH(uele, &ump->um_extattr.uepm_list, uele_entries)
		ufs_extattr_rm(vp, uele->uele_attrnamespace,
		    uele->uele_attrname, NULL, td);

	ufs_extattr_uepm_unlock(ump);
}
Beispiel #2
0
/*
 * Vnode operation to remove a named attribute.
 */
int
ufs_deleteextattr(struct vop_deleteextattr_args *ap)
/*
vop_deleteextattr {
	IN struct vnode *a_vp;
	IN int a_attrnamespace;
	IN const char *a_name;
	IN struct ucred *a_cred;
	IN struct thread *a_td;
};
*/
{
	struct mount *mp = ap->a_vp->v_mount;
	struct ufsmount *ump = VFSTOUFS(mp); 
	int error;

	ufs_extattr_uepm_lock(ump);

	error = ufs_extattr_rm(ap->a_vp, ap->a_attrnamespace, ap->a_name,
	    ap->a_cred, ap->a_td);


	ufs_extattr_uepm_unlock(ump);

	return (error);
}
Beispiel #3
0
/*
 * Vnode operation to set a named attribute.
 */
int
ufs_vop_setextattr(void *v)
{
	struct vop_setextattr_args /* {
		IN struct vnode *a_vp;
		IN int a_attrnamespace;
		IN const char *a_name;
		INOUT struct uio *a_uio;
		IN struct ucred *a_cred;
		IN struct proc *a_p;
	} */ *ap = v;
	struct mount	*mp = ap->a_vp->v_mount;
	struct ufsmount	*ump = VFSTOUFS(mp); 

	int	error;

	ufs_extattr_uepm_lock(ump, ap->a_p);

	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);
	else
		error = ufs_extattr_rm(ap->a_vp, ap->a_attrnamespace,
		    ap->a_name, ap->a_cred, ap->a_p);

	ufs_extattr_uepm_unlock(ump, ap->a_p);

	return (error);
}