Whamcloud - gitweb
LU-10175 ptlrpc: add LOCK_CONVERT connection flag
[fs/lustre-release.git] / lustre / include / uapi / linux / lustre / lustre_idl.h
index f73ae38..1c821a0 100644 (file)
@@ -564,11 +564,6 @@ static inline void lustre_handle_copy(struct lustre_handle *tgt,
        tgt->cookie = src->cookie;
 }
 
-struct lustre_handle_array {
-       unsigned int            count;
-       struct lustre_handle    handles[0];
-};
-
 /* lustre_msg struct magic.  DON'T use swabbed values of MAGIC as magic! */
 enum lustre_msg_magic {
        LUSTRE_MSG_MAGIC_V2             = 0x0BD00BD3,
@@ -671,7 +666,7 @@ struct ptlrpc_body_v3 {
        __u64 pb_padding64_0;
        __u64 pb_padding64_1;
        __u64 pb_padding64_2;
-       char  pb_jobid[LUSTRE_JOBID_SIZE]; /* req: ASCII MPI jobid from env */
+       char  pb_jobid[LUSTRE_JOBID_SIZE]; /* req: ASCII jobid from env + NUL */
 };
 #define ptlrpc_body     ptlrpc_body_v3
 
@@ -808,9 +803,12 @@ struct ptlrpc_body_v2 {
 #define OBD_CONNECT_OBDOPACK    0x4000000000000000ULL /* compact OUT obdo */
 #define OBD_CONNECT_FLAGS2      0x8000000000000000ULL /* second flags word */
 /* ocd_connect_flags2 flags */
-#define OBD_CONNECT2_FILE_SECCTX       0x1ULL /* set file security context at create */
-#define OBD_CONNECT2_LOCKAHEAD 0x2ULL /* ladvise lockahead v2 */
-#define OBD_CONNECT2_FLR       0x20ULL /* FLR support */
+#define OBD_CONNECT2_FILE_SECCTX        0x1ULL /* set file security context at create */
+#define OBD_CONNECT2_LOCKAHEAD          0x2ULL /* ladvise lockahead v2 */
+#define OBD_CONNECT2_DIR_MIGRATE        0x4ULL /* migrate striped dir */
+#define OBD_CONNECT2_FLR               0x20ULL /* FLR support */
+#define OBD_CONNECT2_WBC_INTENTS       0x40ULL /* create/unlink/... intents for wbc, also operations under client-held parent locks */
+#define OBD_CONNECT2_LOCK_CONVERT      0x80ULL /* IBITS lock convert support */
 
 /* XXX README XXX:
  * Please DO NOT add flag values here before first ensuring that this same
@@ -884,7 +882,7 @@ struct ptlrpc_body_v2 {
 
 #define OST_CONNECT_SUPPORTED2 OBD_CONNECT2_LOCKAHEAD
 
-#define ECHO_CONNECT_SUPPORTED 0
+#define ECHO_CONNECT_SUPPORTED (OBD_CONNECT_FID)
 #define ECHO_CONNECT_SUPPORTED2 0
 
 #define MGS_CONNECT_SUPPORTED  (OBD_CONNECT_VERSION | OBD_CONNECT_AT | \
@@ -953,15 +951,37 @@ struct obd_connect_data {
 /*
  * Supported checksum algorithms. Up to 32 checksum types are supported.
  * (32-bit mask stored in obd_connect_data::ocd_cksum_types)
- * Please update DECLARE_CKSUM_NAME/OBD_CKSUM_ALL in obd.h when adding a new
- * algorithm and also the OBD_FL_CKSUM* flags.
+ * Please update DECLARE_CKSUM_NAME in obd_cksum.h when adding a new
+ * algorithm and also the OBD_FL_CKSUM* flags, OBD_CKSUM_ALL flag,
+ * OBD_FL_CKSUM_ALL flag and potentially OBD_CKSUM_T10_ALL flag.
  */
 enum cksum_types {
-        OBD_CKSUM_CRC32 = 0x00000001,
-        OBD_CKSUM_ADLER = 0x00000002,
-        OBD_CKSUM_CRC32C= 0x00000004,
+       OBD_CKSUM_CRC32         = 0x00000001,
+       OBD_CKSUM_ADLER         = 0x00000002,
+       OBD_CKSUM_CRC32C        = 0x00000004,
+       OBD_CKSUM_RESERVED      = 0x00000008,
+       OBD_CKSUM_T10IP512      = 0x00000010,
+       OBD_CKSUM_T10IP4K       = 0x00000020,
+       OBD_CKSUM_T10CRC512     = 0x00000040,
+       OBD_CKSUM_T10CRC4K      = 0x00000080,
 };
 
+#define OBD_CKSUM_T10_ALL (OBD_CKSUM_T10IP512 | OBD_CKSUM_T10IP4K | \
+       OBD_CKSUM_T10CRC512 | OBD_CKSUM_T10CRC4K)
+
+#define OBD_CKSUM_ALL (OBD_CKSUM_CRC32 | OBD_CKSUM_ADLER | OBD_CKSUM_CRC32C | \
+                      OBD_CKSUM_T10_ALL)
+
+/*
+ * The default checksum algorithm used on top of T10PI GRD tags for RPC.
+ * Considering that the checksum-of-checksums is only computing CRC32 on a
+ * 4KB chunk of GRD tags for a 1MB RPC for 512B sectors, or 16KB of GRD
+ * tags for 16MB of 4KB sectors, this is only 1/256 or 1/1024 of the
+ * total data being checksummed, so the checksum type used here should not
+ * affect overall system performance noticeably.
+ */
+#define OBD_CKSUM_T10_TOP OBD_CKSUM_ADLER
+
 /*
  *   OST requests: OBDO & OBD request records
  */
@@ -1006,13 +1026,16 @@ enum obdo_flags {
         OBD_FL_NO_GRPQUOTA  = 0x00000200, /* the object's group is over quota */
         OBD_FL_CREATE_CROW  = 0x00000400, /* object should be create on write */
         OBD_FL_SRVLOCK      = 0x00000800, /* delegate DLM locking to server */
-        OBD_FL_CKSUM_CRC32  = 0x00001000, /* CRC32 checksum type */
-        OBD_FL_CKSUM_ADLER  = 0x00002000, /* ADLER checksum type */
-        OBD_FL_CKSUM_CRC32C = 0x00004000, /* CRC32C checksum type */
-        OBD_FL_CKSUM_RSVD2  = 0x00008000, /* for future cksum types */
-        OBD_FL_CKSUM_RSVD3  = 0x00010000, /* for future cksum types */
-        OBD_FL_SHRINK_GRANT = 0x00020000, /* object shrink the grant */
-        OBD_FL_MMAP         = 0x00040000, /* object is mmapped on the client.
+       OBD_FL_CKSUM_CRC32  = 0x00001000, /* CRC32 checksum type */
+       OBD_FL_CKSUM_ADLER  = 0x00002000, /* ADLER checksum type */
+       OBD_FL_CKSUM_CRC32C = 0x00004000, /* CRC32C checksum type */
+       OBD_FL_CKSUM_T10IP512  = 0x00005000, /* T10PI IP cksum, 512B sector */
+       OBD_FL_CKSUM_T10IP4K   = 0x00006000, /* T10PI IP cksum, 4KB sector */
+       OBD_FL_CKSUM_T10CRC512 = 0x00007000, /* T10PI CRC cksum, 512B sector */
+       OBD_FL_CKSUM_T10CRC4K  = 0x00008000, /* T10PI CRC cksum, 4KB sector */
+       OBD_FL_CKSUM_RSVD3  = 0x00010000, /* for future cksum types */
+       OBD_FL_SHRINK_GRANT = 0x00020000, /* object shrink the grant */
+       OBD_FL_MMAP         = 0x00040000, /* object is mmapped on the client.
                                            * XXX: obsoleted - reserved for old
                                            * clients prior than 2.2 */
         OBD_FL_RECOV_RESEND = 0x00080000, /* recoverable resent */
@@ -1021,10 +1044,15 @@ enum obdo_flags {
        OBD_FL_SHORT_IO     = 0x00400000, /* short io request */
        /* OBD_FL_LOCAL_MASK = 0xF0000000, was local-only flags until 2.10 */
 
-       /* Note that while these checksum values are currently separate bits,
-        * in 2.x we can actually allow all values from 1-31 if we wanted. */
+       /*
+        * Note that while the original checksum values were separate bits,
+        * in 2.x we can actually allow all values from 1-31. T10-PI checksum
+        * types already use values which are not separate bits.
+        */
        OBD_FL_CKSUM_ALL    = OBD_FL_CKSUM_CRC32 | OBD_FL_CKSUM_ADLER |
-                             OBD_FL_CKSUM_CRC32C,
+                             OBD_FL_CKSUM_CRC32C | OBD_FL_CKSUM_T10IP512 |
+                             OBD_FL_CKSUM_T10IP4K | OBD_FL_CKSUM_T10CRC512 |
+                             OBD_FL_CKSUM_T10CRC4K,
 };
 
 /*
@@ -1216,7 +1244,7 @@ lov_mds_md_max_stripe_count(size_t buf_size, __u32 lmm_magic)
 /*     OBD_MD_FLRMTPERM     (0x0000010000000000ULL) remote perm, obsolete */
 #define OBD_MD_FLMDSCAPA     (0x0000020000000000ULL) /* MDS capability */
 #define OBD_MD_FLOSSCAPA     (0x0000040000000000ULL) /* OSS capability */
-#define OBD_MD_FLCKSPLIT     (0x0000080000000000ULL) /* Check split on server */
+/*      OBD_MD_FLCKSPLIT     (0x0000080000000000ULL) obsolete 2.3.58*/
 #define OBD_MD_FLCROSSREF    (0x0000100000000000ULL) /* Cross-ref case */
 #define OBD_MD_FLGETATTRLOCK (0x0000200000000000ULL) /* Get IOEpoch attributes
                                                       * under lock; for xattr
@@ -1299,6 +1327,8 @@ struct hsm_state_set {
 
 #define OBD_BRW_LOCALS (OBD_BRW_LOCAL1)
 
+#define OBD_MAX_GRANT 0x7fffffffUL /* Max grant allowed to one client: 2 GiB */
+
 #define OBD_OBJECT_EOF LUSTRE_EOF
 
 #define OST_MIN_PRECREATE 32
@@ -1731,7 +1761,7 @@ struct mdt_body {
        __s64   mbo_atime;
        __s64   mbo_ctime;
        __u64   mbo_blocks; /* XID, in the case of MDS_READPAGE */
-       __u64   mbo_ioepoch;
+       __u64   mbo_version; /* was mbo_ioepoch before 2.11 */
        __u64   mbo_t_state; /* transient file state defined in
                              * enum md_transient_state
                              * was "ino" until 2.4.0 */
@@ -1744,7 +1774,7 @@ struct mdt_body {
        __u32   mbo_flags;   /* LUSTRE_*_FL file attributes */
        __u32   mbo_rdev;
        __u32   mbo_nlink; /* #bytes to read in the case of MDS_READPAGE */
-       __u32   mbo_unused2; /* was "generation" until 2.4.0 */
+       __u32   mbo_layout_gen; /* was "generation" until 2.4.0 */
        __u32   mbo_suppgid;
        __u32   mbo_eadatasize;
        __u32   mbo_aclsize;
@@ -1827,13 +1857,13 @@ struct mdt_rec_setattr {
 #define MDS_ATTR_PROJID            0x10000ULL  /* = 65536 */
 
 enum mds_op_bias {
-       MDS_CHECK_SPLIT         = 1 << 0,
+/*     MDS_CHECK_SPLIT         = 1 << 0, obsolete before 2.3.58 */
        MDS_CROSS_REF           = 1 << 1,
-       MDS_VTX_BYPASS          = 1 << 2,
+/*     MDS_VTX_BYPASS          = 1 << 2, obsolete since 2.3.54 */
        MDS_PERM_BYPASS         = 1 << 3,
 /*     MDS_SOM                 = 1 << 4, obsolete since 2.8.0 */
        MDS_QUOTA_IGNORE        = 1 << 5,
-       /* Was MDS_CLOSE_CLEANUP (1 << 6), No more used */
+/*     MDS_CLOSE_CLEANUP       = 1 << 6, obsolete since 2.3.51 */
        MDS_KEEP_ORPHAN         = 1 << 7,
        MDS_RECOV_OPEN          = 1 << 8,
        MDS_DATA_MODIFIED       = 1 << 9,
@@ -2317,8 +2347,11 @@ static inline bool ldlm_extent_equal(const struct ldlm_extent *ex1,
 }
 
 struct ldlm_inodebits {
-        __u64 bits;
-       __u64 try_bits; /* optional bits to try */
+       __u64 bits;
+       union {
+               __u64 try_bits; /* optional bits to try */
+               __u64 cancel_bits; /* for lock convert */
+       };
 };
 
 struct ldlm_flock_wire {
@@ -2523,8 +2556,8 @@ struct cfg_marker {
  * Opcodes for multiple servers.
  */
 enum obd_cmd {
-        OBD_PING = 400,
-        OBD_LOG_CANCEL,
+       OBD_PING = 400,
+       OBD_LOG_CANCEL, /* Obsolete since 1.5. */
        OBD_QC_CALLBACK, /* not used since 2.4 */
        OBD_IDX_READ,
         OBD_LAST_OPC
@@ -2768,7 +2801,7 @@ struct llog_agent_req_rec {
                                                 * agent_req_status */
        __u32                   arr_archive_id; /**< backend archive number */
        __u64                   arr_flags;      /**< req flags */
-       __u64                   arr_compound_id;        /**< compound cookie */
+       __u64                   arr_compound_id; /**< compound cookie, ignored */
        __u64                   arr_req_create; /**< req. creation time */
        __u64                   arr_req_change; /**< req. status change time */
        struct hsm_action_item  arr_hai;        /**< req. to the agent */
@@ -2869,17 +2902,17 @@ struct llog_cookie {
 
 /** llog protocol */
 enum llogd_rpc_ops {
-        LLOG_ORIGIN_HANDLE_CREATE       = 501,
-        LLOG_ORIGIN_HANDLE_NEXT_BLOCK   = 502,
-        LLOG_ORIGIN_HANDLE_READ_HEADER  = 503,
-        LLOG_ORIGIN_HANDLE_WRITE_REC    = 504,
-        LLOG_ORIGIN_HANDLE_CLOSE        = 505,
-        LLOG_ORIGIN_CONNECT             = 506,
-       LLOG_CATINFO                    = 507,  /* deprecated */
-        LLOG_ORIGIN_HANDLE_PREV_BLOCK   = 508,
-        LLOG_ORIGIN_HANDLE_DESTROY      = 509,  /* for destroy llog object*/
-        LLOG_LAST_OPC,
-        LLOG_FIRST_OPC                  = LLOG_ORIGIN_HANDLE_CREATE
+       LLOG_ORIGIN_HANDLE_CREATE       = 501,
+       LLOG_ORIGIN_HANDLE_NEXT_BLOCK   = 502,
+       LLOG_ORIGIN_HANDLE_READ_HEADER  = 503,
+       LLOG_ORIGIN_HANDLE_WRITE_REC    = 504, /* Obsolete by 2.1. */
+       LLOG_ORIGIN_HANDLE_CLOSE        = 505, /* Obsolete by 1.8. */
+       LLOG_ORIGIN_CONNECT             = 506, /* Obsolete by 2.4. */
+       LLOG_CATINFO                    = 507, /* Obsolete by 2.3. */
+       LLOG_ORIGIN_HANDLE_PREV_BLOCK   = 508,
+       LLOG_ORIGIN_HANDLE_DESTROY      = 509, /* Obsolete. */
+       LLOG_LAST_OPC,
+       LLOG_FIRST_OPC                  = LLOG_ORIGIN_HANDLE_CREATE
 };
 
 struct llogd_body {
@@ -3304,6 +3337,7 @@ enum update_type {
        OUT_PUNCH               = 14,
        OUT_READ                = 15,
        OUT_NOOP                = 16,
+       OUT_XATTR_LIST          = 17,
        OUT_LAST
 };