summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGeorge Melikov <[email protected]>2017-02-03 01:13:41 +0300
committerBrian Behlendorf <[email protected]>2017-02-02 14:13:41 -0800
commit9b7b9cd370ed2ec4c8ee346bcb95cb30ba7e9ba9 (patch)
tree54fc7c65aefc2e3457aafb789794dab0f2f9a753 /include
parent96f1b347f8f726163c105704576110a4a8be4b84 (diff)
OpenZFS 1300 - filename normalization doesn't work for removes
Authored by: Kevin Crowe <[email protected]> Reviewed by: Yuri Pankov <[email protected]> Reviewed by: Pavel Zakharov <[email protected]> Reviewed by: Matt Ahrens <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Ported-by: George Melikov <[email protected]> OpenZFS-issue: https://www.illumos.org/issues/1300 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/8f1750d Closes #5725 Porting notes: - zap_micro.c: all `MT_EXACT` are replaced by `0`
Diffstat (limited to 'include')
-rw-r--r--include/sys/zap.h38
-rw-r--r--include/sys/zap_impl.h3
2 files changed, 13 insertions, 28 deletions
diff --git a/include/sys/zap.h b/include/sys/zap.h
index 513c8f672..43b7fbd26 100644
--- a/include/sys/zap.h
+++ b/include/sys/zap.h
@@ -18,9 +18,11 @@
*
* CDDL HEADER END
*/
+
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright 2017 Nexenta Systems, Inc.
*/
#ifndef _SYS_ZAP_H
@@ -87,22 +89,15 @@ extern "C" {
/*
* Specifies matching criteria for ZAP lookups.
+ * MT_NORMALIZE Use ZAP normalization flags, which can include both
+ * unicode normalization and case-insensitivity.
+ * MT_MATCH_CASE Do case-sensitive lookups even if MT_NORMALIZE is
+ * specified and ZAP normalization flags include
+ * U8_TEXTPREP_TOUPPER.
*/
-typedef enum matchtype
-{
- /* Only find an exact match (non-normalized) */
- MT_EXACT,
- /*
- * If there is an exact match, find that, otherwise find the
- * first normalized match.
- */
- MT_BEST,
- /*
- * Find the "first" normalized (case and Unicode form) match;
- * the designated "first" match will not change as long as the
- * set of entries with this normalization doesn't change.
- */
- MT_FIRST
+typedef enum matchtype {
+ MT_NORMALIZE = 1 << 0,
+ MT_MATCH_CASE = 1 << 1,
} matchtype_t;
typedef enum zap_flags {
@@ -119,19 +114,6 @@ typedef enum zap_flags {
/*
* Create a new zapobj with no attributes and return its object number.
- * MT_EXACT will cause the zap object to only support MT_EXACT lookups,
- * otherwise any matchtype can be used for lookups.
- *
- * normflags specifies what normalization will be done. values are:
- * 0: no normalization (legacy on-disk format, supports MT_EXACT matching
- * only)
- * U8_TEXTPREP_TOLOWER: case normalization will be performed.
- * MT_FIRST/MT_BEST matching will find entries that match without
- * regard to case (eg. looking for "foo" can find an entry "Foo").
- * Eventually, other flags will permit unicode normalization as well.
- *
- * dnodesize specifies the on-disk size of the dnode for the new zapobj.
- * Valid values are multiples of 512 up to DNODE_MAX_SIZE.
*/
uint64_t zap_create(objset_t *ds, dmu_object_type_t ot,
dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx);
diff --git a/include/sys/zap_impl.h b/include/sys/zap_impl.h
index cbe7f3c5b..fb0f1a012 100644
--- a/include/sys/zap_impl.h
+++ b/include/sys/zap_impl.h
@@ -18,10 +18,12 @@
*
* CDDL HEADER END
*/
+
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
* Copyright (c) 2013, 2016 by Delphix. All rights reserved.
+ * Copyright 2017 Nexenta Systems, Inc.
*/
#ifndef _SYS_ZAP_IMPL_H
@@ -188,6 +190,7 @@ typedef struct zap_name {
int zn_key_norm_numints;
uint64_t zn_hash;
matchtype_t zn_matchtype;
+ int zn_normflags;
char zn_normbuf[ZAP_MAXNAMELEN];
} zap_name_t;