Whamcloud - gitweb
LU-6349 ptlrpc: remove LUSTRE_MSG_MAGIC_V1 support
[fs/lustre-release.git] / lustre / include / lustre / lustre_idl.h
index 7e82994..7b7555f 100644 (file)
 #define PTL_RPC_MSG_REPLY   4713
 
 /* DON'T use swabbed values of MAGIC as magic! */
-#define LUSTRE_MSG_MAGIC_V1 0x0BD00BD0
 #define LUSTRE_MSG_MAGIC_V2 0x0BD00BD3
-
-#define LUSTRE_MSG_MAGIC_V1_SWABBED 0xD00BD00B
 #define LUSTRE_MSG_MAGIC_V2_SWABBED 0xD30BD00B
 
 #define LUSTRE_MSG_MAGIC LUSTRE_MSG_MAGIC_V2
 #define LUSTRE_LOG_VERSION  0x00050000
 #define LUSTRE_MGS_VERSION  0x00060000
 
-/* TODO: All obd_* typedefs will be removed in last patch in series */
-typedef __u64 obd_id;
-typedef __u64 obd_seq;
-typedef __s64 obd_time;
-typedef __u64 obd_size;
-typedef __u64 obd_off;
-typedef __u64 obd_blocks;
-typedef __u64 obd_valid;
-typedef __u32 obd_blksize;
-typedef __u32 obd_mode;
-typedef __u32 obd_uid;
-typedef __u32 obd_gid;
-typedef __u32 obd_flag;
-typedef __u32 obd_count;
-
 /**
  * Describes a range of sequence, lsr_start is included but lsr_end is
  * not in the range.
@@ -369,6 +351,13 @@ extern void lustre_som_swab(struct som_attrs *attrs);
 
 #define SOM_INCOMPAT_SUPP 0x0
 
+/* copytool uses a 32b bitmask field to encode archive-Ids during register
+ * with MDT thru kuc.
+ * archive num = 0 => all
+ * archive num from 1 to 32
+ */
+#define LL_HSM_MAX_ARCHIVE (sizeof(__u32) * 8)
+
 /**
  * HSM on-disk attributes stored in a separate xattr.
  */
@@ -484,6 +473,12 @@ enum dot_lustre_oid {
        FID_OID_DOT_LUSTRE_LPF  = 3UL,
 };
 
+/** OID for FID_SEQ_ROOT */
+enum root_oid {
+       FID_OID_ROOT            = 1UL,
+       FID_OID_ECHO_ROOT       = 2UL,
+};
+
 static inline bool fid_seq_is_mdt0(__u64 seq)
 {
        return seq == FID_SEQ_OST_MDT0;
@@ -554,14 +549,21 @@ static inline bool fid_is_mdt0(const struct lu_fid *fid)
 static inline void lu_root_fid(struct lu_fid *fid)
 {
        fid->f_seq = FID_SEQ_ROOT;
-       fid->f_oid = 1;
+       fid->f_oid = FID_OID_ROOT;
+       fid->f_ver = 0;
+}
+
+static inline void lu_echo_root_fid(struct lu_fid *fid)
+{
+       fid->f_seq = FID_SEQ_ROOT;
+       fid->f_oid = FID_OID_ECHO_ROOT;
        fid->f_ver = 0;
 }
 
 /**
  * Check if a fid is igif or not.
  * \param fid the fid to be tested.
- * \return true if the fid is a igif; otherwise false.
+ * \return true if the fid is an igif; otherwise false.
  */
 static inline bool fid_seq_is_igif(__u64 seq)
 {
@@ -576,7 +578,7 @@ static inline bool fid_is_igif(const struct lu_fid *fid)
 /**
  * Check if a fid is idif or not.
  * \param fid the fid to be tested.
- * \return true if the fid is a idif; otherwise false.
+ * \return true if the fid is an idif; otherwise false.
  */
 static inline bool fid_seq_is_idif(__u64 seq)
 {
@@ -832,8 +834,8 @@ static inline bool fid_is_last_id(const struct lu_fid *fid)
 }
 
 /**
- * Get inode number from a igif.
- * \param fid a igif to get inode number from.
+ * Get inode number from an igif.
+ * \param fid an igif to get inode number from.
  * \return inode number for the igif.
  */
 static inline ino_t lu_igif_ino(const struct lu_fid *fid)
@@ -844,8 +846,8 @@ static inline ino_t lu_igif_ino(const struct lu_fid *fid)
 extern void lustre_swab_ost_id(struct ost_id *oid);
 
 /**
- * Get inode generation from a igif.
- * \param fid a igif to get inode generation from.
+ * Get inode generation from an igif.
+ * \param fid an igif to get inode generation from.
  * \return inode generation for the igif.
  */
 static inline __u32 lu_igif_gen(const struct lu_fid *fid)
@@ -980,7 +982,7 @@ enum lu_dirent_attrs {
        LUDA_TYPE               = 0x0002,
        LUDA_64BITHASH          = 0x0004,
 
-       /* The following attrs are used for MDT interanl only,
+       /* The following attrs are used for MDT internal only,
         * not visible to client */
 
        /* Verify the dirent consistency */
@@ -1169,8 +1171,10 @@ struct ptlrpc_body_v3 {
        __u32 pb_version;
        __u32 pb_opc;
        __u32 pb_status;
-       __u64 pb_last_xid;
-       __u64 pb_last_seen;
+       __u64 pb_last_xid; /* highest replied XID without lower unreplied XID */
+       __u16 pb_tag;      /* virtual slot idx for multiple modifying RPCs */
+       __u16 pb_padding0;
+       __u32 pb_padding1;
        __u64 pb_last_committed;
        __u64 pb_transno;
        __u32 pb_flags;
@@ -1194,8 +1198,10 @@ struct ptlrpc_body_v2 {
         __u32 pb_version;
         __u32 pb_opc;
         __u32 pb_status;
-        __u64 pb_last_xid;
-        __u64 pb_last_seen;
+       __u64 pb_last_xid; /* highest replied XID without lower unreplied XID */
+       __u16 pb_tag;      /* virtual slot idx for multiple modifying RPCs */
+       __u16 pb_padding0;
+       __u32 pb_padding1;
         __u64 pb_last_committed;
         __u64 pb_transno;
         __u32 pb_flags;
@@ -1335,6 +1341,8 @@ extern void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb);
                                                       name in request */
 #define OBD_CONNECT_LFSCK      0x40000000000000ULL/* support online LFSCK */
 #define OBD_CONNECT_UNLINK_CLOSE 0x100000000000000ULL/* close file in unlink */
+#define OBD_CONNECT_MULTIMODRPCS 0x200000000000000ULL /* support multiple modify
+                                                        RPCs in parallel */
 #define OBD_CONNECT_DIR_STRIPE  0x400000000000000ULL /* striped DNE dir */
 
 /* XXX README XXX:
@@ -1414,25 +1422,6 @@ extern void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb);
  *
  * If we eventually have separate connect data for different types, which we
  * almost certainly will, then perhaps we stick a union in here. */
-struct obd_connect_data_v1 {
-       __u64 ocd_connect_flags; /* OBD_CONNECT_* per above */
-       __u32 ocd_version;       /* lustre release version number */
-       __u32 ocd_grant;         /* initial cache grant amount (bytes) */
-       __u32 ocd_index;         /* LOV index to connect to */
-       __u32 ocd_brw_size;      /* Maximum BRW size in bytes, must be 2^n */
-        __u64 ocd_ibits_known;   /* inode bits this client understands */
-        __u8  ocd_blocksize;     /* log2 of the backend filesystem blocksize */
-        __u8  ocd_inodespace;    /* log2 of the per-inode space consumption */
-        __u16 ocd_grant_extent;  /* per-extent grant overhead, in 1K blocks */
-        __u32 ocd_unused;        /* also fix lustre_swab_connect */
-        __u64 ocd_transno;       /* first transno from client to be replayed */
-        __u32 ocd_group;         /* MDS group on OST */
-        __u32 ocd_cksum_types;   /* supported checksum algorithms */
-        __u32 ocd_max_easize;    /* How big LOV EA can be on MDS */
-        __u32 ocd_instance;      /* also fix lustre_swab_connect */
-        __u64 ocd_maxbytes;      /* Maximum stripe size in bytes */
-};
-
 struct obd_connect_data {
        __u64 ocd_connect_flags; /* OBD_CONNECT_* per above */
        __u32 ocd_version;       /* lustre release version number */
@@ -1454,7 +1443,9 @@ struct obd_connect_data {
          * if the corresponding flag in ocd_connect_flags is set. Accessing
          * any field after ocd_maxbytes on the receiver without a valid flag
          * may result in out-of-bound memory access and kernel oops. */
-        __u64 padding1;          /* added 2.1.0. also fix lustre_swab_connect */
+       __u16 ocd_maxmodrpcs;    /* Maximum modify RPCs in parallel */
+       __u16 padding0;          /* added 2.1.0. also fix lustre_swab_connect */
+       __u32 padding1;          /* added 2.1.0. also fix lustre_swab_connect */
         __u64 padding2;          /* added 2.1.0. also fix lustre_swab_connect */
         __u64 padding3;          /* added 2.1.0. also fix lustre_swab_connect */
         __u64 padding4;          /* added 2.1.0. also fix lustre_swab_connect */
@@ -1704,6 +1695,7 @@ static inline void lmm_oi_cpu_to_le(struct ost_id *dst_oi,
 #define XATTR_NAME_SOM         "trusted.som"
 #define XATTR_NAME_HSM         "trusted.hsm"
 #define XATTR_NAME_LFSCK_BITMAP "trusted.lfsck_bitmap"
+#define XATTR_NAME_DUMMY       "trusted.dummy"
 
 #if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 8, 53, 0)
 # define XATTR_NAME_LFSCK_NAMESPACE_OLD "trusted.lfsck_namespace"
@@ -2255,8 +2247,6 @@ enum md_op_flags {
        MF_GET_MDT_IDX          = (1 << 9),
 };
 
-#define MF_SOM_LOCAL_FLAGS (MF_SOM_CHANGE | MF_EPOCH_OPEN | MF_EPOCH_CLOSE)
-
 #define LUSTRE_BFLAG_UNCOMMITTED_WRITES   0x1
 
 /* these should be identical to their EXT4_*_FL counterparts, they are
@@ -3335,8 +3325,10 @@ struct llog_size_change_rec {
 #define CHANGELOG_MINMASK (1 << CL_MARK)
 /** bits covering all \a changelog_rec_type's */
 #define CHANGELOG_ALLMASK 0XFFFFFFFF
-/** default \a changelog_rec_type mask */
-#define CHANGELOG_DEFMASK CHANGELOG_ALLMASK & ~(1 << CL_ATIME | 1 << CL_CLOSE)
+/** default \a changelog_rec_type mask. Allow all of them, except
+ * CL_ATIME since it can really be time consuming, and not necessary
+ * under normal use. */
+#define CHANGELOG_DEFMASK (CHANGELOG_ALLMASK & ~(1 << CL_ATIME))
 
 /* changelog llog name, needed by client replicators */
 #define CHANGELOG_CATALOG "changelog_catalog"
@@ -3560,19 +3552,12 @@ struct lfsck_request {
        __u16           lr_active;
        __u16           lr_param;
        __u16           lr_async_windows;
-       union {
-               __u32   lr_flags2;
-               __u32   lr_layout_version;
-       };
+       __u32           lr_flags2;
        struct lu_fid   lr_fid;
        struct lu_fid   lr_fid2;
-       union {
-               struct lu_fid   lr_fid3;
-               char            lr_pool_name[LOV_MAXPOOLNAME + 1];
-       };
-       __u32           lr_stripe_count;
-       __u32           lr_hash_type;
-       __u64           lr_padding_3;
+       struct lu_fid   lr_fid3;
+       __u64           lr_padding_1;
+       __u64           lr_padding_2;
 };
 
 void lustre_swab_lfsck_request(struct lfsck_request *lr);
@@ -3597,7 +3582,6 @@ enum lfsck_events {
        LE_PEER_EXIT            = 9,
        LE_CONDITIONAL_DESTROY  = 10,
        LE_PAIRS_VERIFY         = 11,
-       LE_CREATE_ORPHAN        = 12,
        LE_SKIP_NLINK_DECLARE   = 13,
        LE_SKIP_NLINK           = 14,
        LE_SET_LMV_MASTER       = 15,