/* Most of the permission checking is done by xattr_permission in the vfs. The local file system is responsible for handling the system.* namespace. We also need to verify that this is a namespace that we recognize.  */
static int can_set_xattr(struct inode *inode, const char *name, const void *value, size_t value_len)
/* Most of the permission checking is done by xattr_permission in the vfs. The local file system is responsible for handling the system.* namespace. We also need to verify that this is a namespace that we recognize.  */
static int can_set_xattr(struct inode *inode, const char *name, const void *value, size_t value_len)
{
	if (!strncmp(name, XATTR_SYSTEM_PREFIX, XATTR_SYSTEM_PREFIX_LEN))
		return can_set_system_xattr(inode, name, value, value_len);
	if (strncmp(name, XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN) &&
	    strncmp(name, XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN) &&
	    strncmp(name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN) &&
	    strncmp(name, XATTR_OS2_PREFIX, XATTR_OS2_PREFIX_LEN))
		return -EOPNOTSUPP;
	return 0;
}