/* If doing a CI lookup and case-insensitive match, dup actual name into args.value. Return EEXIST for success (ie. name found) or an error.  */
int xfs_dir_cilookup_result(struct xfs_da_args *args, const char *name, int len)
/* If doing a CI lookup and case-insensitive match, dup actual name into args.value. Return EEXIST for success (ie. name found) or an error.  */
int xfs_dir_cilookup_result(struct xfs_da_args *args, const char *name, int len)
{
	if (args->cmpresult == XFS_CMP_DIFFERENT)
		return ENOENT;
	if (args->cmpresult != XFS_CMP_CASE ||
					!(args->op_flags & XFS_DA_OP_CILOOKUP))
		return EEXIST;
	args->value = kmem_alloc(len, KM_NOFS | KM_MAYFAIL);
	if (!args->value)
		return ENOMEM;
	memcpy(args->value, name, len);
	args->valuelen = len;
	return EEXIST;
}