Whamcloud - gitweb
LU-10499 pcc: introducing OBD_CONNECT2_PCCRO flag
[fs/lustre-release.git] / lustre / include / uapi / linux / lustre / lustre_idl.h
index 0970619..d9e0f66 100644 (file)
@@ -850,6 +850,11 @@ struct ptlrpc_body_v2 {
 #define OBD_CONNECT2_GETATTR_PFID      0x20000ULL /* pack parent FID in getattr */
 #define OBD_CONNECT2_LSEEK            0x40000ULL /* SEEK_HOLE/DATA RPC */
 #define OBD_CONNECT2_DOM_LVB          0x80000ULL /* pack DOM glimpse data in LVB */
+#define OBD_CONNECT2_REP_MBITS       0x100000ULL /* match reply mbits not xid*/
+#define OBD_CONNECT2_MODE_CONVERT     0x200000ULL /* LDLM mode convert */
+#define OBD_CONNECT2_BATCH_RPC        0x400000ULL /* Multi-RPC batch request */
+#define OBD_CONNECT2_PCCRO           0x800000ULL /* Read-only PCC */
+#define OBD_CONNECT2_ATOMIC_OPEN_LOCK 0x4000000ULL/* request lock on 1st open */
 /* XXX README XXX:
  * Please DO NOT add flag values here before first ensuring that this same
  * flag value is not in use on some other branch.  Please clear any such
@@ -909,7 +914,9 @@ struct ptlrpc_body_v2 {
                                OBD_CONNECT2_CRUSH | \
                                OBD_CONNECT2_ENCRYPT | \
                                OBD_CONNECT2_GETATTR_PFID |\
-                               OBD_CONNECT2_LSEEK | OBD_CONNECT2_DOM_LVB)
+                               OBD_CONNECT2_LSEEK | OBD_CONNECT2_DOM_LVB |\
+                               OBD_CONNECT2_REP_MBITS | \
+                               OBD_CONNECT2_ATOMIC_OPEN_LOCK)
 
 #define OST_CONNECT_SUPPORTED  (OBD_CONNECT_SRVLOCK | OBD_CONNECT_GRANT | \
                                OBD_CONNECT_REQPORTAL | OBD_CONNECT_VERSION | \
@@ -931,17 +938,19 @@ struct ptlrpc_body_v2 {
                                OBD_CONNECT_SHORTIO | OBD_CONNECT_FLAGS2)
 
 #define OST_CONNECT_SUPPORTED2 (OBD_CONNECT2_LOCKAHEAD | OBD_CONNECT2_INC_XID |\
-                               OBD_CONNECT2_ENCRYPT | OBD_CONNECT2_LSEEK)
+                               OBD_CONNECT2_ENCRYPT | OBD_CONNECT2_LSEEK |\
+                               OBD_CONNECT2_REP_MBITS)
 
-#define ECHO_CONNECT_SUPPORTED (OBD_CONNECT_FID)
-#define ECHO_CONNECT_SUPPORTED2 0
+#define ECHO_CONNECT_SUPPORTED (OBD_CONNECT_FID | OBD_CONNECT_FLAGS2)
+#define ECHO_CONNECT_SUPPORTED2 OBD_CONNECT2_REP_MBITS
 
 #define MGS_CONNECT_SUPPORTED  (OBD_CONNECT_VERSION | OBD_CONNECT_AT | \
                                OBD_CONNECT_FULL20 | OBD_CONNECT_IMP_RECOV | \
                                OBD_CONNECT_PINGLESS |\
-                               OBD_CONNECT_BULK_MBITS | OBD_CONNECT_BARRIER)
+                               OBD_CONNECT_BULK_MBITS | OBD_CONNECT_BARRIER | \
+                               OBD_CONNECT_FLAGS2)
 
-#define MGS_CONNECT_SUPPORTED2 0
+#define MGS_CONNECT_SUPPORTED2 OBD_CONNECT2_REP_MBITS
 
 /* Features required for this version of the client to work with server */
 #define CLIENT_CONNECT_MDT_REQD (OBD_CONNECT_FID |     \
@@ -1954,6 +1963,8 @@ enum mds_op_bias {
        MDS_TRUNC_KEEP_LEASE    = 1 << 18,
        MDS_PCC_ATTACH          = 1 << 19,
        MDS_CLOSE_UPDATE_TIMES  = 1 << 20,
+       /* setstripe create only, don't restripe if target exists */
+       MDS_SETSTRIPE_CREATE    = 1 << 21,
 };
 
 #define MDS_CLOSE_INTENT (MDS_HSM_RELEASE | MDS_CLOSE_LAYOUT_SWAP |         \
@@ -2212,14 +2223,6 @@ struct lmv_mds_md_v1 {
        struct lu_fid lmv_stripe_fids[0];       /* FIDs for each stripe */
 };
 
-#define LMV_DEBUG(mask, lmv, msg)                                      \
-       CDEBUG(mask,                                                    \
-              "%s LMV: magic=%#x count=%u index=%u hash=%#x version=%u migrate offset=%u migrate hash=%u.\n",  \
-              msg, (lmv)->lmv_magic, (lmv)->lmv_stripe_count,          \
-              (lmv)->lmv_master_mdt_index, (lmv)->lmv_hash_type,       \
-              (lmv)->lmv_layout_version, (lmv)->lmv_migrate_offset,    \
-              (lmv)->lmv_migrate_hash)
-
 /* stripe count before directory split */
 #define lmv_split_offset       lmv_migrate_offset
 /* stripe count after directory merge */
@@ -2611,20 +2614,20 @@ struct mgs_nidtbl_entry {
         } u;
 };
 
-enum {
-       CONFIG_T_CONFIG  = 0,
-       CONFIG_T_SPTLRPC = 1,
-       CONFIG_T_RECOVER = 2,
-       CONFIG_T_PARAMS  = 3,
-       CONFIG_T_NODEMAP = 4,
-       CONFIG_T_BARRIER = 5,
-       CONFIG_T_MAX
+enum mgs_cfg_type {
+       MGS_CFG_T_CONFIG        = 0,
+       MGS_CFG_T_SPTLRPC       = 1,
+       MGS_CFG_T_RECOVER       = 2,
+       MGS_CFG_T_PARAMS        = 3,
+       MGS_CFG_T_NODEMAP       = 4,
+       MGS_CFG_T_BARRIER       = 5,
+       MGS_CFG_T_MAX
 };
 
 struct mgs_config_body {
        char     mcb_name[MTI_NAME_MAXLEN]; /* logname */
        __u64    mcb_offset;    /* next index of config log to request */
-       __u16    mcb_type;      /* type of log: CONFIG_T_[CONFIG|RECOVER] */
+       __u16    mcb_type;      /* type of log: MGS_CFG_T_[CONFIG|RECOVER] */
        __u8     mcb_nm_cur_pass;
        __u8     mcb_bits;      /* bits unit size of config log */
        __u32    mcb_units;     /* # of units for bulk transfer */
@@ -2733,6 +2736,7 @@ enum llog_op_type {
        /* LLOG_JOIN_REC        = LLOG_OP_MAGIC | 0x50000, obsolete  1.8.0 */
        CHANGELOG_REC           = LLOG_OP_MAGIC | 0x60000,
        CHANGELOG_USER_REC      = LLOG_OP_MAGIC | 0x70000,
+       CHANGELOG_USER_REC2     = LLOG_OP_MAGIC | 0x70002,
        HSM_AGENT_REC           = LLOG_OP_MAGIC | 0x80000,
        UPDATE_REC              = LLOG_OP_MAGIC | 0xa0000,
        LLOG_HDR_MAGIC          = LLOG_OP_MAGIC | 0x45539,
@@ -2833,9 +2837,9 @@ struct llog_size_change_rec {
 #define CHANGELOG_MAGIC 0xca103000
 
 /** \a changelog_rec_type's that can't be masked */
-#define CHANGELOG_MINMASK (1 << CL_MARK)
+#define CHANGELOG_MINMASK BIT(CL_MARK)
 /** bits covering all \a changelog_rec_type's */
-#define CHANGELOG_ALLMASK 0XFFFFFFFF
+#define CHANGELOG_ALLMASK (BIT(CL_LAST) - 1)
 /** 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.
@@ -2843,8 +2847,7 @@ struct llog_size_change_rec {
  * be costly and only necessary for audit purpose.
  */
 #define CHANGELOG_DEFMASK (CHANGELOG_ALLMASK & \
-                          ~(1 << CL_ATIME | 1 << CL_OPEN | 1 << CL_GETXATTR | \
-                            1 << CL_DN_OPEN))
+       ~(BIT(CL_ATIME) | BIT(CL_OPEN) | BIT(CL_GETXATTR) | BIT(CL_DN_OPEN)))
 
 /* changelog llog name, needed by client replicators */
 #define CHANGELOG_CATALOG "changelog_catalog"
@@ -2862,6 +2865,8 @@ struct llog_changelog_rec {
 } __attribute__((packed));
 
 #define CHANGELOG_USER_PREFIX "cl"
+#define CHANGELOG_USER_NAMELEN 16 /* base name including NUL terminator */
+#define CHANGELOG_USER_NAMELEN_FULL 30 /* basename plus 'cl$ID-' prefix */
 
 struct llog_changelog_user_rec {
        struct llog_rec_hdr   cur_hdr;
@@ -2873,6 +2878,21 @@ struct llog_changelog_user_rec {
        struct llog_rec_tail  cur_tail;
 } __attribute__((packed));
 
+/* this is twice the size of CHANGELOG_USER_REC */
+struct llog_changelog_user_rec2 {
+       struct llog_rec_hdr     cur_hdr;
+       __u32                   cur_id;
+       /* only for use in relative time comparisons to detect idle users */
+       __u32                   cur_time;
+       __u64                   cur_endrec;
+       __u32                   cur_mask;
+       __u32                   cur_padding1;
+       char                    cur_name[CHANGELOG_USER_NAMELEN];
+       __u64                   cur_padding2;
+       __u64                   cur_padding3;
+       struct llog_rec_tail    cur_tail;
+} __attribute__((packed));
+
 enum agent_req_status {
        ARS_WAITING,
        ARS_STARTED,