Whamcloud - gitweb
LU-11213 uapi: change "space" hash type to hash flag
[fs/lustre-release.git] / lustre / include / uapi / linux / lustre / lustre_user.h
index 66c8fd1..a9c7f64 100644 (file)
@@ -810,17 +810,36 @@ enum lmv_hash_type {
        LMV_HASH_TYPE_UNKNOWN   = 0,    /* 0 is reserved for testing purpose */
        LMV_HASH_TYPE_ALL_CHARS = 1,
        LMV_HASH_TYPE_FNV_1A_64 = 2,
-       LMV_HASH_TYPE_SPACE     = 3,    /*
-                                        * distribute subdirs among all MDTs
-                                        * with balanced space usage.
-                                        */
        LMV_HASH_TYPE_MAX,
 };
 
+#define LMV_HASH_TYPE_DEFAULT LMV_HASH_TYPE_FNV_1A_64
+
 #define LMV_HASH_NAME_ALL_CHARS        "all_char"
 #define LMV_HASH_NAME_FNV_1A_64        "fnv_1a_64"
+
+/* not real hash type, but exposed to user as "space" hash type */
 #define LMV_HASH_NAME_SPACE    "space"
 
+/* Right now only the lower part(0-16bits) of lmv_hash_type is being used,
+ * and the higher part will be the flag to indicate the status of object,
+ * for example the object is being migrated. And the hash function
+ * might be interpreted differently with different flags. */
+#define LMV_HASH_TYPE_MASK 0x0000ffff
+
+/* once this is set on a plain directory default layout, newly created
+ * subdirectories will be distributed on all MDTs by space usage.
+ */
+#define LMV_HASH_FLAG_SPACE    0x08000000
+
+/* The striped directory has ever lost its master LMV EA, then LFSCK
+ * re-generated it. This flag is used to indicate such case. It is an
+ * on-disk flag. */
+#define LMV_HASH_FLAG_LOST_LMV 0x10000000
+
+#define LMV_HASH_FLAG_BAD_TYPE 0x20000000
+#define LMV_HASH_FLAG_MIGRATION        0x80000000
+
 extern char *mdt_hash_name[LMV_HASH_TYPE_MAX];
 
 struct lustre_foreign_type {