Whamcloud - gitweb
LU-7340 mdd: changelogs garbage collection
[fs/lustre-release.git] / lustre / include / uapi / linux / lustre / lustre_idl.h
index 0b44ba4..7efdab8 100644 (file)
 # include <linux/lustre/lustre_ver.h>
 #endif
 
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
 /*
  *  GENERAL STUFF
  */
@@ -733,7 +737,7 @@ struct ptlrpc_body_v2 {
 #define OBD_CONNECT_LARGE_ACL          0x200ULL /* more than 32 ACL entries */
 #define OBD_CONNECT_TRUNCLOCK           0x400ULL /*locks on server for punch */
 #define OBD_CONNECT_TRANSNO             0x800ULL /*replay sends init transno */
-#define OBD_CONNECT_IBITS              0x1000ULL /*support for inodebits locks*/
+#define OBD_CONNECT_IBITS             0x1000ULL /* not checked in 2.11+ */
 #define OBD_CONNECT_BARRIER           0x2000ULL /* write barrier */
 #define OBD_CONNECT_ATTRFID            0x4000ULL /*Server can GetAttr By Fid*/
 #define OBD_CONNECT_NODEVOH            0x8000ULL /*No open hndl on specl nodes*/
@@ -886,8 +890,9 @@ struct ptlrpc_body_v2 {
 #define MGS_CONNECT_SUPPORTED2 0
 
 /* Features required for this version of the client to work with server */
-#define CLIENT_CONNECT_MDT_REQD (OBD_CONNECT_IBITS | OBD_CONNECT_FID | \
-                                 OBD_CONNECT_FULL20)
+#define CLIENT_CONNECT_MDT_REQD (OBD_CONNECT_FID |     \
+                                OBD_CONNECT_ATTRFID |  \
+                                OBD_CONNECT_FULL20)
 
 /* This structure is used for both request and reply.
  *
@@ -1174,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 */
@@ -1580,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 */
@@ -1857,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,10 +1889,11 @@ enum mds_op_bias {
        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_LAYOUT_MERGE | MDS_CLOSE_RESYNC_DONE)
 
 /* instance of mdt_reint_rec */
 struct mdt_rec_create {
@@ -2025,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
@@ -2683,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;
@@ -2728,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 {
@@ -2797,12 +2837,15 @@ enum llog_flag {
        LLOG_F_IS_PLAIN         = 0x4,
        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_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 */
@@ -2922,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;
 
@@ -3204,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 */
@@ -3218,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));
 
 /**
@@ -3229,7 +3271,7 @@ struct layout_intent {
  */
 struct hsm_progress_kernel {
        /* Field taken from struct hsm_progress */
-       lustre_fid              hpk_fid;
+       struct lu_fid           hpk_fid;
        __u64                   hpk_cookie;
        struct hsm_extent       hpk_extent;
        __u16                   hpk_flags;
@@ -3384,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 */
@@ -3518,5 +3569,9 @@ struct ladvise_hdr {
        struct lu_ladvise       lah_advise[0];  /* advices in this header */
 };
 
+#if defined(__cplusplus)
+}
+#endif
+
 #endif
 /** @} lustreidl */