Whamcloud - gitweb
LU-12263 build: push depreciation of LMV_HASH_FLAG_DEAD to 2.12.55
[fs/lustre-release.git] / lustre / include / uapi / linux / lustre / lustre_idl.h
index a600a39..28e008d 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,10 @@ 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 */
+#define OBD_CONNECT2_LSOM              0x800ULL /* LSOM support */
+#define OBD_CONNECT2_PCC               0x1000ULL /* Persistent Client Cache */
+#define OBD_CONNECT2_PLAIN_LAYOUT      0x2000ULL /* Plain Directory Layout */
 
 /* XXX README XXX:
  * Please DO NOT add flag values here before first ensuring that this same
@@ -881,7 +890,10 @@ 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 | \
+                               OBD_CONNECT2_SELINUX_POLICY | \
+                               OBD_CONNECT2_LSOM)
 
 #define OST_CONNECT_SUPPORTED  (OBD_CONNECT_SRVLOCK | OBD_CONNECT_GRANT | \
                                OBD_CONNECT_REQPORTAL | OBD_CONNECT_VERSION | \
@@ -1075,6 +1087,9 @@ enum obdo_flags {
                              OBD_FL_CKSUM_CRC32C | OBD_FL_CKSUM_T10IP512 |
                              OBD_FL_CKSUM_T10IP4K | OBD_FL_CKSUM_T10CRC512 |
                              OBD_FL_CKSUM_T10CRC4K,
+
+       OBD_FL_NO_QUOTA_ALL = OBD_FL_NO_USRQUOTA | OBD_FL_NO_GRPQUOTA |
+                             OBD_FL_NO_PRJQUOTA,
 };
 
 /*
@@ -1138,7 +1153,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,
@@ -1233,20 +1252,19 @@ lov_mds_md_max_stripe_count(size_t buf_size, __u32 lmm_magic)
 #define OBD_MD_FLFLAGS     (0x00000800ULL) /* flags word */
 #define OBD_MD_DOM_SIZE    (0X00001000ULL) /* Data-on-MDT component size */
 #define OBD_MD_FLNLINK     (0x00002000ULL) /* link count */
-#define OBD_MD_FLGENER     (0x00004000ULL) /* generation number */
-#define OBD_MD_LAYOUT_VERSION (0x00008000ULL) /* layout version for
-                                              * OST objects */
+#define OBD_MD_FLPARENT    (0x00004000ULL) /* parent FID */
+#define OBD_MD_LAYOUT_VERSION (0x00008000ULL) /* OST object layout version */
 #define OBD_MD_FLRDEV      (0x00010000ULL) /* device number */
 #define OBD_MD_FLEASIZE    (0x00020000ULL) /* extended attribute data */
 #define OBD_MD_LINKNAME    (0x00040000ULL) /* symbolic link target */
 #define OBD_MD_FLHANDLE    (0x00080000ULL) /* file/lock handle */
 #define OBD_MD_FLCKSUM     (0x00100000ULL) /* bulk data checksum */
-#define OBD_MD_FLQOS       (0x00200000ULL) /* quality of service stats */
-/*     OBD_MD_FLCOOKIE    (0x00800000ULL)    obsolete in 2.8 */
+/*     OBD_MD_FLQOS       (0x00200000ULL) has never been used */
+/*     OBD_MD_FLCOOKIE    (0x00800000ULL) obsolete in 2.8 */
 #define OBD_MD_FLPRJQUOTA  (0x00400000ULL) /* over quota flags sent from ost */
 #define OBD_MD_FLGROUP     (0x01000000ULL) /* group */
 #define OBD_MD_FLFID       (0x02000000ULL) /* ->ost write inline fid */
-#define OBD_MD_FLEPOCH     (0x04000000ULL) /* ->ost write with ioepoch */
+/*     OBD_MD_FLEPOCH     (0x04000000ULL) obsolete 2.7.50 */
                                            /* ->mds if epoch opens or closes */
 #define OBD_MD_FLGRANT     (0x08000000ULL) /* ost preallocation space grant */
 #define OBD_MD_FLDIREA     (0x10000000ULL) /* dir's extended attribute data */
@@ -1255,7 +1273,7 @@ lov_mds_md_max_stripe_count(size_t buf_size, __u32 lmm_magic)
 #define OBD_MD_FLMODEASIZE (0x80000000ULL) /* EA size will be changed */
 
 #define OBD_MD_MDS         (0x0000000100000000ULL) /* where an inode lives on */
-#define OBD_MD_REINT       (0x0000000200000000ULL) /* reintegrate oa */
+/*     OBD_MD_REINT       (0x0000000200000000ULL) obsolete 1.8 */
 #define OBD_MD_MEA         (0x0000000400000000ULL) /* CMD split EA  */
 #define OBD_MD_TSTATE      (0x0000000800000000ULL) /* transient state field */
 
@@ -1264,8 +1282,8 @@ lov_mds_md_max_stripe_count(size_t buf_size, __u32 lmm_magic)
 #define OBD_MD_FLXATTRRM     (0x0000004000000000ULL) /* xattr remove */
 #define OBD_MD_FLACL         (0x0000008000000000ULL) /* ACL */
 #define OBD_MD_FLAGSTATFS    (0x0000010000000000ULL) /* aggregated statfs */
-#define OBD_MD_FLMDSCAPA     (0x0000020000000000ULL) /* MDS capability */
-#define OBD_MD_FLOSSCAPA     (0x0000040000000000ULL) /* OSS capability */
+/*     OBD_MD_FLMDSCAPA     (0x0000020000000000ULL) obsolete 2.7.54 */
+/*     OBD_MD_FLOSSCAPA     (0x0000040000000000ULL) obsolete 2.7.54 */
 /*      OBD_MD_FLCKSPLIT     (0x0000080000000000ULL) obsolete 2.3.58*/
 #define OBD_MD_FLCROSSREF    (0x0000100000000000ULL) /* Cross-ref case */
 #define OBD_MD_FLGETATTRLOCK (0x0000200000000000ULL) /* Get IOEpoch attributes
@@ -1281,6 +1299,7 @@ lov_mds_md_max_stripe_count(size_t buf_size, __u32 lmm_magic)
 #define OBD_MD_DEFAULT_MEA   (0x0040000000000000ULL) /* default MEA */
 #define OBD_MD_FLOSTLAYOUT   (0x0080000000000000ULL) /* contain ost_layout */
 #define OBD_MD_FLPROJID      (0x0100000000000000ULL) /* project ID */
+#define OBD_MD_SECCTX        (0x0200000000000000ULL) /* embed security xattr */
 
 #define OBD_MD_FLALLQUOTA (OBD_MD_FLUSRQUOTA | \
                           OBD_MD_FLGRPQUOTA | \
@@ -1290,7 +1309,7 @@ lov_mds_md_max_stripe_count(size_t buf_size, __u32 lmm_magic)
                          OBD_MD_FLCTIME | OBD_MD_FLSIZE  | OBD_MD_FLBLKSZ | \
                          OBD_MD_FLMODE  | OBD_MD_FLTYPE  | OBD_MD_FLUID   | \
                          OBD_MD_FLGID   | OBD_MD_FLFLAGS | OBD_MD_FLNLINK | \
-                         OBD_MD_FLGENER | OBD_MD_FLRDEV  | OBD_MD_FLGROUP | \
+                         OBD_MD_FLPARENT | OBD_MD_FLRDEV  | OBD_MD_FLGROUP | \
                          OBD_MD_FLPROJID)
 
 #define OBD_MD_FLXATTRALL (OBD_MD_FLXATTR | OBD_MD_FLXATTRLS)
@@ -1707,17 +1726,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
@@ -1726,10 +1745,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
@@ -1802,7 +1821,7 @@ enum md_transient_state {
 struct mdt_body {
        struct lu_fid mbo_fid1;
        struct lu_fid mbo_fid2;
-       struct lustre_handle mbo_handle;
+       struct lustre_handle mbo_open_handle;
        __u64   mbo_valid;
        __u64   mbo_size; /* Offset, in the case of MDS_READPAGE */
        __s64   mbo_mtime;
@@ -1839,7 +1858,7 @@ struct mdt_body {
 }; /* 216 */
 
 struct mdt_ioepoch {
-       struct lustre_handle mio_handle;
+       struct lustre_handle mio_open_handle;
        __u64 mio_unused1; /* was ioepoch */
        __u32 mio_unused2; /* was flags */
        __u32 mio_padding;
@@ -1905,6 +1924,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 */
@@ -1934,32 +1954,32 @@ enum mds_op_bias {
 
 /* instance of mdt_reint_rec */
 struct mdt_rec_create {
-        __u32           cr_opcode;
-        __u32           cr_cap;
-        __u32           cr_fsuid;
-        __u32           cr_fsuid_h;
-        __u32           cr_fsgid;
-        __u32           cr_fsgid_h;
-        __u32           cr_suppgid1;
-        __u32           cr_suppgid1_h;
-        __u32           cr_suppgid2;
-        __u32           cr_suppgid2_h;
-        struct lu_fid   cr_fid1;
-        struct lu_fid   cr_fid2;
-        struct lustre_handle cr_old_handle; /* handle in case of open replay */
+       __u32           cr_opcode;
+       __u32           cr_cap;
+       __u32           cr_fsuid;
+       __u32           cr_fsuid_h;
+       __u32           cr_fsgid;
+       __u32           cr_fsgid_h;
+       __u32           cr_suppgid1;
+       __u32           cr_suppgid1_h;
+       __u32           cr_suppgid2;
+       __u32           cr_suppgid2_h;
+       struct lu_fid   cr_fid1;
+       struct lu_fid   cr_fid2;
+       struct lustre_handle cr_open_handle_old; /* in case of open replay */
        __s64           cr_time;
-        __u64           cr_rdev;
-        __u64           cr_ioepoch;
-        __u64           cr_padding_1;   /* rr_blocks */
-        __u32           cr_mode;
-        __u32           cr_bias;
-        /* use of helpers set/get_mrc_cr_flags() is needed to access
-         * 64 bits cr_flags [cr_flags_l, cr_flags_h], this is done to
-         * extend cr_flags size without breaking 1.8 compat */
-        __u32           cr_flags_l;     /* for use with open, low  32 bits  */
-        __u32           cr_flags_h;     /* for use with open, high 32 bits */
-        __u32           cr_umask;       /* umask for create */
-        __u32           cr_padding_4;   /* rr_padding_4 */
+       __u64           cr_rdev;
+       __u64           cr_ioepoch;
+       __u64           cr_padding_1;   /* rr_blocks */
+       __u32           cr_mode;
+       __u32           cr_bias;
+       /* use of helpers set/get_mrc_cr_flags() is needed to access
+        * 64 bits cr_flags [cr_flags_l, cr_flags_h], this is done to
+        * extend cr_flags size without breaking 1.8 compat */
+       __u32           cr_flags_l;     /* for use with open, low  32 bits  */
+       __u32           cr_flags_h;     /* for use with open, high 32 bits */
+       __u32           cr_umask;       /* umask for create */
+       __u32           cr_padding_4;   /* rr_padding_4 */
 };
 
 /* instance of mdt_reint_rec */
@@ -2087,7 +2107,7 @@ struct mdt_rec_resync {
        __u32           rs_suppgid2_h;
        struct lu_fid   rs_fid;
        __u8            rs_padding0[sizeof(struct lu_fid)];
-       struct lustre_handle rs_handle; /* rr_mtime */
+       struct lustre_handle rs_lease_handle;   /* rr_mtime */
        __s64           rs_padding1;    /* rr_atime */
        __s64           rs_padding2;    /* rr_ctime */
        __u64           rs_padding3;    /* rr_size */
@@ -2097,7 +2117,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 */
 };
 
 /*
@@ -2131,7 +2152,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 */
@@ -2191,7 +2213,7 @@ struct lmv_mds_md_v1 {
 
 #define LMV_HASH_FLAG_MIGRATION        0x80000000
 
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 11, 56, 0)
+#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 12, 55, 0)
 /* Since lustre 2.8, this flag will not be needed, instead this DEAD
  * and orphan flags will be stored in LMA (see LMAI_ORPHAN)
  * Keep this flag just for LFSCK, because it still might meet such
@@ -2903,6 +2925,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)
@@ -3561,6 +3588,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 {