FreeBSD/sys/ufs/ufs/ufs_extattr.c
/*
 * Disable extended attribute support on an FS.
 */
Disable extended attribute support on an FS.
Disable extended attribute support on an FS .
static int
ufs_extattr_disable(struct ufsmount *ump, int attrnamespace,
    const char *attrname, struct thread *td)
{
	struct ufs_extattr_list_entry *uele;
	int error = 0;
	if (!ufs_extattr_valid_attrname(attrnamespace, attrname))
		return (EINVAL);
	uele = ufs_extattr_find_attr(ump, attrnamespace, attrname);
	if (!uele)
		return (ENOATTR);
	LIST_REMOVE(uele, uele_entries);
	vn_lock(uele->uele_backing_vnode, LK_SHARED | LK_RETRY);
	ASSERT_VOP_LOCKED(uele->uele_backing_vnode, "ufs_extattr_disable");
	VOP_UNLOCK(uele->uele_backing_vnode, 0);
	error = vn_close(uele->uele_backing_vnode, FREAD|FWRITE,
	    td->td_ucred, td);
	free(uele, M_UFS_EXTATTR);
	return (error);
}
static int ufs_extattr_disable ( struct ufsmount * ump , int attrnamespace , const char * attrname , struct thread * td ) { struct ufs_extattr_list_entry * uele ; int error = 0 ; if ( ! ufs_extattr_valid_attrname ( attrnamespace , attrname ) ) return ( EINVAL ) ; uele = ufs_extattr_find_attr ( ump , attrnamespace , attrname ) ; if ( ! uele ) return ( ENOATTR ) ; LIST_REMOVE ( uele , uele_entries ) ; vn_lock ( uele -> uele_backing_vnode , LK_SHARED | LK_RETRY ) ; ASSERT_VOP_LOCKED ( uele -> uele_backing_vnode , " " ) ; VOP_UNLOCK ( uele -> uele_backing_vnode , 0 ) ; error = vn_close ( uele -> uele_backing_vnode , FREAD | FWRITE , td -> td_ucred , td ) ; free ( uele , M_UFS_EXTATTR ) ; return ( error ) ; }
Disable extended attribute support on an FS.
Disable extended attribute support on an FS .