Whamcloud - gitweb
LU-7340 mdd: changelogs garbage collection
[fs/lustre-release.git] / lustre / include / uapi / linux / lustre / lustre_idl.h
index d198605..7efdab8 100644 (file)
@@ -1098,6 +1098,7 @@ struct lov_mds_md_v1 {            /* LOV EA mds/wire data (little-endian) */
 #define XATTR_TRUSTED_PREFIX    "trusted."
 #define XATTR_SECURITY_PREFIX   "security."
 
+#define XATTR_NAME_SOM         "trusted.som"
 #define XATTR_NAME_LOV          "trusted.lov"
 #define XATTR_NAME_LMA          "trusted.lma"
 #define XATTR_NAME_LMV          "trusted.lmv"
@@ -1178,7 +1179,8 @@ lov_mds_md_max_stripe_count(size_t buf_size, __u32 lmm_magic)
 #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_FLINLINE    (0x00008000ULL)  inline data. used until 1.6.5 */
+#define OBD_MD_LAYOUT_VERSION (0x00008000ULL) /* layout version for
+                                              * OST objects */
 #define OBD_MD_FLRDEV      (0x00010000ULL) /* device number */
 #define OBD_MD_FLEASIZE    (0x00020000ULL) /* extended attribute data */
 #define OBD_MD_LINKNAME    (0x00040000ULL) /* symbolic link target */
@@ -1259,6 +1261,9 @@ struct hsm_state_set {
 #define OBD_BRW_READ            0x01
 #define OBD_BRW_WRITE           0x02
 #define OBD_BRW_RWMASK          (OBD_BRW_READ | OBD_BRW_WRITE)
+#define OBD_BRW_NDELAY         0x04 /* Non-delay RPC should be issued for
+                                     * this page. Non-delay RPCs have bit
+                                     * rq_no_delay set. */
 #define OBD_BRW_SYNC            0x08 /* this page is a part of synchronous
                                       * transfer and is not accounted in
                                       * the grant. */
@@ -1581,7 +1586,8 @@ enum mds_reint_op {
        REINT_SETXATTR = 7,
        REINT_RMENTRY  = 8,
        REINT_MIGRATE  = 9,
-        REINT_MAX
+       REINT_RESYNC   = 10,
+       REINT_MAX
 };
 
 /* the disposition of the intent outlines what was executed */
@@ -1858,11 +1864,13 @@ struct mdt_rec_setattr {
                                              */
 #define MDS_OPEN_RELEASE   02000000000000ULL /* Open the file for HSM release */
 
+#define MDS_OPEN_RESYNC    04000000000000ULL /* FLR: file resync */
+
 /* lustre internal open flags, which should not be set from user space */
 #define MDS_OPEN_FL_INTERNAL (MDS_OPEN_HAS_EA | MDS_OPEN_HAS_OBJS |    \
                              MDS_OPEN_OWNEROVERRIDE | MDS_OPEN_LOCK |  \
                              MDS_OPEN_BY_FID | MDS_OPEN_LEASE |        \
-                             MDS_OPEN_RELEASE)
+                             MDS_OPEN_RELEASE | MDS_OPEN_RESYNC)
 
 enum mds_op_bias {
        MDS_CHECK_SPLIT         = 1 << 0,
@@ -1880,8 +1888,13 @@ enum mds_op_bias {
        MDS_HSM_RELEASE         = 1 << 12,
        MDS_RENAME_MIGRATE      = 1 << 13,
        MDS_CLOSE_LAYOUT_SWAP   = 1 << 14,
+       MDS_CLOSE_LAYOUT_MERGE  = 1 << 15,
+       MDS_CLOSE_RESYNC_DONE   = 1 << 16,
 };
 
+#define MDS_CLOSE_INTENT (MDS_HSM_RELEASE | MDS_CLOSE_LAYOUT_SWAP |    \
+                         MDS_CLOSE_LAYOUT_MERGE | MDS_CLOSE_RESYNC_DONE)
+
 /* instance of mdt_reint_rec */
 struct mdt_rec_create {
         __u32           cr_opcode;
@@ -2022,6 +2035,34 @@ struct mdt_rec_setxattr {
         __u32           sx_padding_11;  /* rr_padding_4 */
 };
 
+/* instance of mdt_reint_rec
+ * FLR: for file resync MDS_REINT_RESYNC RPC. */
+struct mdt_rec_resync {
+       __u32           rs_opcode;
+       __u32           rs_cap;
+       __u32           rs_fsuid;
+       __u32           rs_fsuid_h;
+       __u32           rs_fsgid;
+       __u32           rs_fsgid_h;
+       __u32           rs_suppgid1;
+       __u32           rs_suppgid1_h;
+       __u32           rs_suppgid2;
+       __u32           rs_suppgid2_h;
+       struct lu_fid   rs_fid;
+       __u8            rs_padding0[sizeof(struct lu_fid)];
+       struct lustre_handle rs_handle; /* rr_mtime */
+       __s64           rs_padding1;    /* rr_atime */
+       __s64           rs_padding2;    /* rr_ctime */
+       __u64           rs_padding3;    /* rr_size */
+       __u64           rs_padding4;    /* rr_blocks */
+       __u32           rs_bias;
+       __u32           rs_padding5;    /* rr_mode */
+       __u32           rs_padding6;    /* rr_flags */
+       __u32           rs_padding7;    /* rr_flags_h */
+       __u32           rs_padding8;    /* rr_umask */
+       __u32           rs_padding9;    /* rr_padding_4 */
+};
+
 /*
  * mdt_rec_reint is the template for all mdt_reint_xxx structures.
  * Do NOT change the size of various members, otherwise the value
@@ -2680,7 +2721,7 @@ struct llog_setattr64_rec_v2 {
        __u32                   lsr_gid_h;
        __u64                   lsr_valid;
        __u32                   lsr_projid;
-       __u32                   lsr_padding1;
+       __u32                   lsr_layout_version;
        __u64                   lsr_padding2;
        __u64                   lsr_padding3;
        struct llog_rec_tail    lsr_tail;
@@ -2725,11 +2766,13 @@ struct llog_changelog_rec {
 #define CHANGELOG_USER_PREFIX "cl"
 
 struct llog_changelog_user_rec {
-        struct llog_rec_hdr   cur_hdr;
-        __u32                 cur_id;
-        __u32                 cur_padding;
-        __u64                 cur_endrec;
-        struct llog_rec_tail  cur_tail;
+       struct llog_rec_hdr   cur_hdr;
+       __u32                 cur_id;
+       /* only intended to be used in relative time comparisons to
+        * detect idle users */
+       __u32                 cur_time;
+       __u64                 cur_endrec;
+       struct llog_rec_tail  cur_tail;
 } __attribute__((packed));
 
 enum agent_req_status {
@@ -2795,12 +2838,14 @@ enum llog_flag {
        LLOG_F_EXT_JOBID        = 0x8,
        LLOG_F_IS_FIXSIZE       = 0x10,
        LLOG_F_EXT_EXTRA_FLAGS  = 0x20,
+       LLOG_F_EXT_X_UIDGID     = 0x40,
 
        /* Note: Flags covered by LLOG_F_EXT_MASK will be inherited from
         * catlog to plain log, so do not add LLOG_F_IS_FIXSIZE here,
         * because the catlog record is usually fixed size, but its plain
         * log record can be variable */
-       LLOG_F_EXT_MASK = LLOG_F_EXT_JOBID | LLOG_F_EXT_EXTRA_FLAGS,
+       LLOG_F_EXT_MASK = LLOG_F_EXT_JOBID | LLOG_F_EXT_EXTRA_FLAGS |
+                         LLOG_F_EXT_X_UIDGID,
 };
 
 /* On-disk header structure of each log object, stored in little endian order */
@@ -2920,7 +2965,7 @@ struct obdo {
         *
         * sizeof(ost_layout) + sieof(__u32) == sizeof(llog_cookie). */
        struct ost_layout       o_layout;
-       __u32                   o_padding_3;
+       __u32                   o_layout_version;
        __u32                   o_uid_h;
        __u32                   o_gid_h;
 
@@ -3202,7 +3247,7 @@ struct getparent {
        char            gp_name[0];     /**< zero-terminated link name */
 } __attribute__((packed));
 
-enum {
+enum layout_intent_opc {
        LAYOUT_INTENT_ACCESS    = 0,    /** generic access */
        LAYOUT_INTENT_READ      = 1,    /** not used */
        LAYOUT_INTENT_WRITE     = 2,    /** write file, for comp layout */
@@ -3216,8 +3261,7 @@ enum {
 struct layout_intent {
        __u32 li_opc;   /* intent operation for enqueue, read, write etc */
        __u32 li_flags;
-       __u64 li_start;
-       __u64 li_end;
+       struct lu_extent li_extent;
 } __attribute__((packed));
 
 /**
@@ -3382,11 +3426,20 @@ struct mdc_swap_layouts {
        __u64           msl_flags;
 } __attribute__((packed));
 
+#define INLINE_RESYNC_ARRAY_SIZE       15
+struct close_data_resync_done {
+       __u32   resync_count;
+       __u32   resync_ids_inline[INLINE_RESYNC_ARRAY_SIZE];
+};
+
 struct close_data {
        struct lustre_handle    cd_handle;
        struct lu_fid           cd_fid;
        __u64                   cd_data_version;
-       __u64                   cd_reserved[8];
+       union {
+               __u64                           cd_reserved[8];
+               struct close_data_resync_done   cd_resync;
+       };
 };
 
 /* Update llog format */