Whamcloud - gitweb
LU-14459 mdt: support fixed directory layout
[fs/lustre-release.git] / lustre / include / uapi / linux / lustre / lustre_user.h
index 723e47f..7fa3564 100644 (file)
@@ -633,6 +633,7 @@ struct ll_ioc_lease_id {
 #define LL_IOC_PCC_DETACH              _IOW('f', 252, struct lu_pcc_detach)
 #define LL_IOC_PCC_DETACH_BY_FID       _IOW('f', 252, struct lu_pcc_detach_fid)
 #define LL_IOC_PCC_STATE               _IOR('f', 252, struct lu_pcc_state)
+#define LL_IOC_PROJECT                 _IOW('f', 253, struct lu_project)
 
 #ifndef        FS_IOC_FSGETXATTR
 /*
@@ -1004,7 +1005,7 @@ static __attribute__((unused)) const char *mdt_hash_name[] = {
        "crush",
 };
 
-#define LMV_HASH_TYPE_DEFAULT LMV_HASH_TYPE_FNV_1A_64
+#define LMV_HASH_TYPE_DEFAULT LMV_HASH_TYPE_CRUSH
 
 /* 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,
@@ -1019,6 +1020,9 @@ static inline bool lmv_is_known_hash_type(__u32 type)
               (type & LMV_HASH_TYPE_MASK) == LMV_HASH_TYPE_CRUSH;
 }
 
+/* fixed layout, such directories won't split automatically */
+/* NB, update LMV_HASH_FLAG_KNOWN when adding new flag */
+#define LMV_HASH_FLAG_FIXED            0x02000000
 #define LMV_HASH_FLAG_MERGE            0x04000000
 #define LMV_HASH_FLAG_SPLIT            0x08000000
 
@@ -1033,6 +1037,8 @@ static inline bool lmv_is_known_hash_type(__u32 type)
 #define LMV_HASH_FLAG_LAYOUT_CHANGE    \
        (LMV_HASH_FLAG_MIGRATION | LMV_HASH_FLAG_SPLIT | LMV_HASH_FLAG_MERGE)
 
+#define LMV_HASH_FLAG_KNOWN            0xfe000000
+
 /* both SPLIT and MIGRATION are set for directory split */
 static inline bool lmv_hash_is_splitting(__u32 hash)
 {
@@ -1567,7 +1573,7 @@ enum changelog_rec_type {
        CL_RESYNC   = 22, /* FLR: file was resync-ed */
        CL_GETXATTR = 23,
        CL_DN_OPEN  = 24, /* denied open */
-       CL_LAST
+       CL_LAST,
 };
 
 static inline const char *changelog_type2str(int type) {
@@ -2669,6 +2675,21 @@ struct lu_pcc_state {
        char    pccs_path[PATH_MAX];
 };
 
+enum lu_project_type {
+       LU_PROJECT_NONE = 0,
+       LU_PROJECT_SET,
+       LU_PROJECT_GET,
+       LU_PROJECT_MAX
+};
+
+struct lu_project {
+       __u32   project_type; /* enum lu_project_type */
+       __u32   project_id;
+       __u32   project_xflags;
+       __u32   project_reserved;
+       char    project_name[NAME_MAX + 1];
+};
+
 struct fid_array {
        __u32 fa_nr;
        /* make header's size equal lu_fid */