/* For licensing information, see the file 'LICENCE' in this directory.  */
int jffs2_init_security(struct inode *inode, struct inode *dir)
/* For licensing information, see the file 'LICENCE' in this directory.  */
int jffs2_init_security(struct inode *inode, struct inode *dir)
{
	int rc;
	size_t len;
	void *value;
	char *name;
	rc = security_inode_init_security(inode, dir, &name, &value, &len);
	if (rc) {
		if (rc == -EOPNOTSUPP)
			return 0;
		return rc;
	}
	rc = do_jffs2_setxattr(inode, JFFS2_XPREFIX_SECURITY, name, value, len, 0);
	kfree(name);
	kfree(value);
	return rc;
}