Whamcloud - gitweb
LU-7340 mdd: changelogs garbage collection
[fs/lustre-release.git] / lustre / include / uapi / linux / lustre / lustre_idl.h
index 8008aee..7efdab8 100644 (file)
 # include <linux/lustre/lustre_ver.h>
 #endif
 
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
 /*
  *  GENERAL STUFF
  */
 #define MDC_REPLY_PORTAL               10
 //#define MDC_BULK_PORTAL              11
 #define MDS_REQUEST_PORTAL             12
-//#define MDS_REPLY_PORTAL             13
+#define MDS_IO_PORTAL                  13
 #define MDS_BULK_PORTAL                14
 #define LDLM_CB_REQUEST_PORTAL         15
 #define LDLM_CB_REPLY_PORTAL           16
@@ -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*/
@@ -845,10 +849,12 @@ struct ptlrpc_body_v2 {
                                OBD_CONNECT_FLOCK_DEAD | \
                                OBD_CONNECT_DISP_STRIPE | OBD_CONNECT_LFSCK | \
                                OBD_CONNECT_OPEN_BY_FID | \
-                               OBD_CONNECT_DIR_STRIPE | \
-                               OBD_CONNECT_BULK_MBITS | \
+                               OBD_CONNECT_DIR_STRIPE | OBD_CONNECT_GRANT | \
+                               OBD_CONNECT_TRUNCLOCK | OBD_CONNECT_SRVLOCK | \
+                               OBD_CONNECT_BULK_MBITS | OBD_CONNECT_CKSUM | \
                                OBD_CONNECT_MULTIMODRPCS | \
                                OBD_CONNECT_SUBTREE | OBD_CONNECT_LARGE_ACL | \
+                               OBD_CONNECT_GRANT_PARAM | \
                                OBD_CONNECT_FLAGS2)
 
 #define MDT_CONNECT_SUPPORTED2 OBD_CONNECT2_FILE_SECCTX
@@ -884,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.
  *
@@ -1091,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"
@@ -1168,9 +1176,11 @@ lov_mds_md_max_stripe_count(size_t buf_size, __u32 lmm_magic)
 #define OBD_MD_FLUID       (0x00000200ULL) /* user ID */
 #define OBD_MD_FLGID       (0x00000400ULL) /* group ID */
 #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_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 */
@@ -1251,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. */
@@ -1366,6 +1379,7 @@ union lquota_id {
        struct lu_fid   qid_fid; /* FID for per-directory quota */
        __u64           qid_uid; /* user identifier */
        __u64           qid_gid; /* group identifier */
+       __u64           qid_projid; /* project identifier */
 };
 
 /* quotactl management */
@@ -1562,7 +1576,7 @@ typedef enum {
  * Do not exceed 63
  */
 
-typedef enum {
+enum mds_reint_op {
        REINT_SETATTR  = 1,
        REINT_CREATE   = 2,
        REINT_LINK     = 3,
@@ -1572,8 +1586,9 @@ typedef enum {
        REINT_SETXATTR = 7,
        REINT_RMENTRY  = 8,
        REINT_MIGRATE  = 9,
-        REINT_MAX
-} mds_reint_t, mdt_reint_t;
+       REINT_RESYNC   = 10,
+       REINT_MAX
+};
 
 /* the disposition of the intent outlines what was executed */
 #define DISP_IT_EXECD        0x00000001
@@ -1609,10 +1624,13 @@ typedef enum {
  * will grant LOOKUP_LOCK. */
 #define MDS_INODELOCK_PERM   0x000010
 #define MDS_INODELOCK_XATTR  0x000020  /* extended attributes */
+#define MDS_INODELOCK_DOM    0x000040 /* Data for data-on-mdt files */
 
-#define MDS_INODELOCK_MAXSHIFT 5
+#define MDS_INODELOCK_MAXSHIFT 6
 /* This FULL lock is useful to take on unlink sort of operations */
 #define MDS_INODELOCK_FULL ((1<<(MDS_INODELOCK_MAXSHIFT+1))-1)
+/* DOM lock shouldn't be canceled early, use this macro for ELC */
+#define MDS_INODELOCK_ELC (MDS_INODELOCK_FULL & ~MDS_INODELOCK_DOM)
 
 /* NOTE: until Lustre 1.8.7/2.1.1 the fid_ver() was packed into name[2],
  * but was moved into name[1] along with the OID to avoid consuming the
@@ -1729,9 +1747,9 @@ struct mdt_body {
        __u32   mbo_uid_h; /* high 32-bits of uid, for FUID */
        __u32   mbo_gid_h; /* high 32-bits of gid, for FUID */
        __u32   mbo_projid;
-       __u64   mbo_padding_6; /* also fix lustre_swab_mdt_body */
-       __u64   mbo_padding_7;
-       __u64   mbo_padding_8;
+       __u64   mbo_dom_size; /* size of DOM component */
+       __u64   mbo_dom_blocks; /* blocks consumed by DOM component */
+       __u64   mbo_padding_8; /* also fix lustre_swab_mdt_body */
        __u64   mbo_padding_9;
        __u64   mbo_padding_10;
 }; /* 216 */
@@ -1846,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,
@@ -1868,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;
@@ -2010,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
@@ -2365,6 +2418,8 @@ enum ldlm_intent_flags {
        IT_QUOTA_DQACQ = 0x00000800,
        IT_QUOTA_CONN  = 0x00001000,
        IT_SETXATTR    = 0x00002000,
+       IT_GLIMPSE     = 0x00004000,
+       IT_BRW         = 0x00008000,
 };
 
 struct ldlm_intent {
@@ -2666,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;
@@ -2711,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 {
@@ -2780,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 */
@@ -2905,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;
 
@@ -3187,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 */
@@ -3201,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));
 
 /**
@@ -3212,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;
@@ -3367,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 */
@@ -3501,5 +3569,9 @@ struct ladvise_hdr {
        struct lu_ladvise       lah_advise[0];  /* advices in this header */
 };
 
+#if defined(__cplusplus)
+}
+#endif
+
 #endif
 /** @} lustreidl */