Whamcloud - gitweb
LU-11111 lfsck: skip orphan processing
[fs/lustre-release.git] / lustre / include / uapi / linux / lustre / lustre_idl.h
index 8dafb71..f7d9a01 100644 (file)
@@ -173,12 +173,14 @@ extern void lustre_loa_init(struct lustre_ost_attrs *loa,
                            const struct lu_fid *fid,
                            __u32 compat, __u32 incompat);
 
-/* copytool uses a 32b bitmask field to encode archive-Ids during register
- * with MDT thru kuc.
+/* copytool can use any nonnegative integer to represent archive-Ids during
+ * register with MDT thru kuc.
  * archive num = 0 => all
- * archive num from 1 to 32
+ * archive num from 1 to MAX_U32
  */
-#define LL_HSM_MAX_ARCHIVE (sizeof(__u32) * 8)
+#define LL_HSM_ORIGIN_MAX_ARCHIVE      (sizeof(__u32) * 8)
+/* the max count of archive ids that one agent can support */
+#define LL_HSM_MAX_ARCHIVES_PER_AGENT  1024
 
 /**
  * HSM on-disk attributes stored in a separate xattr.
@@ -532,12 +534,15 @@ static inline size_t lu_dirent_calc_size(size_t namelen, __u16 attr)
 
        if (attr & LUDA_TYPE) {
                const size_t align = sizeof(struct luda_type) - 1;
-                size = (sizeof(struct lu_dirent) + namelen + align) & ~align;
-                size += sizeof(struct luda_type);
-        } else
-                size = sizeof(struct lu_dirent) + namelen;
 
-        return (size + 7) & ~7;
+               size = (sizeof(struct lu_dirent) + namelen + 1 + align) &
+                      ~align;
+               size += sizeof(struct luda_type);
+       } else {
+               size = sizeof(struct lu_dirent) + namelen + 1;
+       }
+
+       return (size + 7) & ~7;
 }
 
 #define MDS_DIR_END_OFF 0xfffffffffffffffeULL
@@ -828,6 +833,7 @@ struct ptlrpc_body_v2 {
 #define OBD_CONNECT2_WBC_INTENTS       0x40ULL /* create/unlink/... intents for wbc, also operations under client-held parent locks */
 #define OBD_CONNECT2_LOCK_CONVERT      0x80ULL /* IBITS lock convert support */
 #define OBD_CONNECT2_ARCHIVE_ID_ARRAY  0x100ULL /* store HSM archive_id in array */
+#define OBD_CONNECT2_SELINUX_POLICY    0x400ULL /* has client SELinux policy */
 
 /* XXX README XXX:
  * Please DO NOT add flag values here before first ensuring that this same
@@ -881,7 +887,8 @@ struct ptlrpc_body_v2 {
 #define MDT_CONNECT_SUPPORTED2 (OBD_CONNECT2_FILE_SECCTX | OBD_CONNECT2_FLR | \
                                 OBD_CONNECT2_SUM_STATFS | \
                                OBD_CONNECT2_LOCK_CONVERT | \
-                               OBD_CONNECT2_DIR_MIGRATE)
+                               OBD_CONNECT2_DIR_MIGRATE | \
+                               OBD_CONNECT2_ARCHIVE_ID_ARRAY)
 
 #define OST_CONNECT_SUPPORTED  (OBD_CONNECT_SRVLOCK | OBD_CONNECT_GRANT | \
                                OBD_CONNECT_REQPORTAL | OBD_CONNECT_VERSION | \
@@ -1138,7 +1145,11 @@ struct lov_mds_md_v1 {            /* LOV EA mds/wire data (little-endian) */
        struct lov_ost_data_v1 lmm_objects[0]; /* per-stripe data */
 };
 
-#define MAX_MD_SIZE (sizeof(struct lov_mds_md) + 4 * sizeof(struct lov_ost_data))
+#define MAX_MD_SIZE_OLD (sizeof(struct lov_mds_md) +                   \
+                        4 * sizeof(struct lov_ost_data))
+#define MAX_MD_SIZE (sizeof(struct lov_comp_md_v1) +                   \
+                    4 * (sizeof(struct lov_comp_md_entry_v1) +         \
+                         MAX_MD_SIZE_OLD))
 #define MIN_MD_SIZE (sizeof(struct lov_mds_md) + 1 * sizeof(struct lov_ost_data))
 
 /* This is the default MDT reply size allocated, should the striping be bigger,
@@ -1706,17 +1717,17 @@ enum {
 enum {
        /* these should be identical to their EXT4_*_FL counterparts, they are
         * redefined here only to avoid dragging in fs/ext4/ext4.h */
-       LUSTRE_SYNC_FL = 0x00000008, /* Synchronous updates */
-       LUSTRE_IMMUTABLE_FL = 0x00000010, /* Immutable file */
-       LUSTRE_APPEND_FL = 0x00000020, /* writes to file may only append */
-       LUSTRE_NODUMP_FL = 0x00000040, /* do not dump file */
-       LUSTRE_NOATIME_FL = 0x00000080, /* do not update atime */
-       LUSTRE_INDEX_FL = 0x00001000, /* hash-indexed directory */
-       LUSTRE_DIRSYNC_FL = 0x00010000, /* dirsync behaviour (dir only) */
-       LUSTRE_TOPDIR_FL = 0x00020000, /* Top of directory hierarchies*/
-       LUSTRE_DIRECTIO_FL = 0x00100000, /* Use direct i/o */
-       LUSTRE_INLINE_DATA_FL = 0x10000000, /* Inode has inline data. */
-       LUSTRE_PROJINHERIT_FL = 0x20000000, /* Create with parents projid */
+       LUSTRE_SYNC_FL          = 0x00000008, /* Synchronous updates */
+       LUSTRE_IMMUTABLE_FL     = 0x00000010, /* Immutable file */
+       LUSTRE_APPEND_FL        = 0x00000020, /* file writes may only append */
+       LUSTRE_NODUMP_FL        = 0x00000040, /* do not dump file */
+       LUSTRE_NOATIME_FL       = 0x00000080, /* do not update atime */
+       LUSTRE_INDEX_FL         = 0x00001000, /* hash-indexed directory */
+       LUSTRE_DIRSYNC_FL       = 0x00010000, /* dirsync behaviour (dir only) */
+       LUSTRE_TOPDIR_FL        = 0x00020000, /* Top of directory hierarchies*/
+       LUSTRE_DIRECTIO_FL      = 0x00100000, /* Use direct i/o */
+       LUSTRE_INLINE_DATA_FL   = 0x10000000, /* Inode has inline data. */
+       LUSTRE_PROJINHERIT_FL   = 0x20000000, /* Create with parents projid */
 
        /* These flags will not be identical to any EXT4_*_FL counterparts,
         * and only reserved for lustre purpose. Note: these flags might
@@ -1725,10 +1736,10 @@ enum {
         * wired by la_flags see osd_attr_get().
         * 2. If these flags needs to be stored into inode, they will be
         * stored in LMA. see LMAI_XXXX */
-       LUSTRE_ORPHAN_FL = 0x00002000,
-       LUSTRE_SET_SYNC_FL = 0x00040000, /* Synchronous setattr on OSTs */
+       LUSTRE_ORPHAN_FL        = 0x00002000,
+       LUSTRE_SET_SYNC_FL      = 0x00040000, /* Synchronous setattr on OSTs */
 
-       LUSTRE_LMA_FL_MASKS = LUSTRE_ORPHAN_FL,
+       LUSTRE_LMA_FL_MASKS     = LUSTRE_ORPHAN_FL,
 };
 
 #ifndef FS_XFLAG_SYNC
@@ -1904,6 +1915,7 @@ struct mdt_rec_setattr {
 #define MDS_ATTR_PROJID            0x10000ULL  /* = 65536 */
 #define MDS_ATTR_LSIZE      0x20000ULL /* = 131072 */
 #define MDS_ATTR_LBLOCKS    0x40000ULL /* = 262144 */
+#define MDS_ATTR_OVERRIDE      0x2000000ULL /* = 33554432 */
 
 enum mds_op_bias {
 /*     MDS_CHECK_SPLIT         = 1 << 0, obsolete before 2.3.58 */
@@ -2096,7 +2108,8 @@ struct mdt_rec_resync {
        __u32           rs_padding6;    /* rr_flags */
        __u32           rs_padding7;    /* rr_flags_h */
        __u32           rs_padding8;    /* rr_umask */
-       __u32           rs_padding9;    /* rr_padding_4 */
+       __u16           rs_mirror_id;
+       __u16           rs_padding9;    /* rr_padding_4 */
 };
 
 /*
@@ -2130,7 +2143,8 @@ struct mdt_rec_reint {
        __u32           rr_flags;
        __u32           rr_flags_h;
        __u32           rr_umask;
-       __u32           rr_padding_4; /* also fix lustre_swab_mdt_rec_reint */
+       __u16           rr_mirror_id;
+       __u16           rr_padding_4; /* also fix lustre_swab_mdt_rec_reint */
 };
 
 /* lmv structures */
@@ -2902,6 +2916,11 @@ enum llog_flag {
                          LLOG_F_EXT_X_OMODE | LLOG_F_EXT_X_XATTR,
 };
 
+/* means first record of catalog */
+enum {
+       LLOG_CAT_FIRST = -1,
+};
+
 /* On-disk header structure of each log object, stored in little endian order */
 #define LLOG_MIN_CHUNK_SIZE    8192
 #define LLOG_HEADER_SIZE        (96) /* sizeof (llog_log_hdr) + sizeof(llh_tail)
@@ -3560,6 +3579,19 @@ struct llog_update_record {
        */
 };
 
+/* sepol string format is:
+ * <1-digit for SELinux status>:<policy name>:<policy version>:<policy hash>
+ */
+/* Max length of the sepol string
+ * Should be large enough to contain a sha512sum of the policy
+ */
+#define SELINUX_MODE_LEN 1
+#define SELINUX_POLICY_VER_LEN 3 /* 3 chars to leave room for the future */
+#define SELINUX_POLICY_HASH_LEN 64
+#define LUSTRE_NODEMAP_SEPOL_LENGTH (SELINUX_MODE_LEN + NAME_MAX + \
+                                    SELINUX_POLICY_VER_LEN + \
+                                    SELINUX_POLICY_HASH_LEN + 3)
+
 /* nodemap records, uses 32 byte record length */
 #define LUSTRE_NODEMAP_NAME_LENGTH 16
 struct nodemap_cluster_rec {