FreeBSD/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
/*
 * FreeBSD's extended attributes namespace defines file name prefix for ZFS'
 * extended attribute name:
 *
 *	NAMESPACE	PREFIX	
 *	system		freebsd:system:
 *	user		(none, can be used to access ZFS fsattr(5) attributes
 *			created on Solaris)
 */
FreeBSD's extended attributes namespace defines file name prefix for ZFS'
extended attribute name.

NAMESPACE       PREFIX
system          freebsd:system:
user            (none, can be used to access ZFS fsattr(5) attributes
created on Solaris)
FreeBSD ' s extended attributes namespace defines file name prefix for ZFS ' extended attribute name . NAMESPACE PREFIX system freebsd : system : user ( none can be used to access ZFS fsattr ( 5 ) attributes created on Solaris )
static int
zfs_create_attrname(int attrnamespace, const char *name, char *attrname,
    size_t size)
{
	const char *namespace, *prefix, *suffix;
	if (strchr(name, '/') != NULL)
		return (EINVAL);
	if (strncmp(name, "freebsd:", 8) == 0)
		return (EINVAL);
	bzero(attrname, size);
	switch (attrnamespace) {
	case EXTATTR_NAMESPACE_USER:
#if 0
		prefix = "freebsd:";
		namespace = EXTATTR_NAMESPACE_USER_STRING;
		suffix = ":";
#else
		prefix = namespace = suffix = "";
#endif
		break;
	case EXTATTR_NAMESPACE_SYSTEM:
		prefix = "freebsd:";
		namespace = EXTATTR_NAMESPACE_SYSTEM_STRING;
		suffix = ":";
		break;
	case EXTATTR_NAMESPACE_EMPTY:
	default:
		return (EINVAL);
	}
	if (snprintf(attrname, size, "%s%s%s%s", prefix, namespace, suffix,
	    name) >= size) {
		return (ENAMETOOLONG);
	}
	return (0);
}
static int zfs_create_attrname ( int attrnamespace , const char * name , char * attrname , size_t size ) { const char * namespace , * prefix , * suffix ; if ( strchr ( name , ' ' ) != NULL ) return ( EINVAL ) ; if ( strncmp ( name , " " , 8 ) == 0 ) return ( EINVAL ) ; bzero ( attrname , size ) ; switch ( attrnamespace ) { case EXTATTR_NAMESPACE_USER : #if 0 prefix = " " ; namespace = EXTATTR_NAMESPACE_USER_STRING ; suffix = " " ; #else prefix = namespace = suffix = " " ; #endif break ; case EXTATTR_NAMESPACE_SYSTEM : prefix = " " ; namespace = EXTATTR_NAMESPACE_SYSTEM_STRING ; suffix = " " ; break ; case EXTATTR_NAMESPACE_EMPTY : default : return ( EINVAL ) ; } if ( snprintf ( attrname , size , " " , prefix , namespace , suffix , name ) >= size ) { return ( ENAMETOOLONG ) ; } return ( 0 ) ; }
FreeBSD's extended attributes namespace defines file name prefix for ZFS'
 extended attribute name:
FreeBSD ' s extended attributes namespace defines file name prefix for ZFS ' extended attribute name :
/* We don't allow '/' character in attribute name. */ /* We don't allow attribute names that start with "freebsd:" string. */ /*
		 * This is the default namespace by which we can access all
		 * attributes created on Solaris.
		 */