Whamcloud - gitweb
LU-7991 quota: project quota against ZFS backend
[fs/lustre-release.git] / lustre / include / uapi / linux / lustre / lustre_idl.h
index 530e058..a845ecf 100644 (file)
@@ -713,7 +713,7 @@ struct ptlrpc_body_v2 {
 #define MSG_CONNECT_RECOVERING  0x00000001
 #define MSG_CONNECT_RECONNECT   0x00000002
 #define MSG_CONNECT_REPLAYABLE  0x00000004
 #define MSG_CONNECT_RECOVERING  0x00000001
 #define MSG_CONNECT_RECONNECT   0x00000002
 #define MSG_CONNECT_REPLAYABLE  0x00000004
-//#define MSG_CONNECT_PEER        0x8
+/* #define MSG_CONNECT_PEER        0x00000008 removed 1.5 */
 #define MSG_CONNECT_LIBCLIENT   0x00000010
 #define MSG_CONNECT_INITIAL     0x00000020
 #define MSG_CONNECT_ASYNC       0x00000040
 #define MSG_CONNECT_LIBCLIENT   0x00000010
 #define MSG_CONNECT_INITIAL     0x00000020
 #define MSG_CONNECT_ASYNC       0x00000040
@@ -794,13 +794,15 @@ struct ptlrpc_body_v2 {
                                                         RPCs in parallel */
 #define OBD_CONNECT_DIR_STRIPE  0x400000000000000ULL /* striped DNE dir */
 #define OBD_CONNECT_SUBTREE    0x800000000000000ULL /* fileset mount */
                                                         RPCs in parallel */
 #define OBD_CONNECT_DIR_STRIPE  0x400000000000000ULL /* striped DNE dir */
 #define OBD_CONNECT_SUBTREE    0x800000000000000ULL /* fileset mount */
-#define OBD_CONNECT_LOCK_AHEAD  0x1000000000000000ULL /* lock ahead */
+#define OBD_CONNECT_LOCKAHEAD_OLD 0x1000000000000000ULL /* Old Cray lockahead */
+
 /** bulk matchbits is sent within ptlrpc_body */
 #define OBD_CONNECT_BULK_MBITS  0x2000000000000000ULL
 #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 */
 /** bulk matchbits is sent within ptlrpc_body */
 #define OBD_CONNECT_BULK_MBITS  0x2000000000000000ULL
 #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 */
 
 /* XXX README XXX:
  * Please DO NOT add flag values here before first ensuring that this same
 
 /* XXX README XXX:
  * Please DO NOT add flag values here before first ensuring that this same
@@ -867,8 +869,9 @@ struct ptlrpc_body_v2 {
                                OBD_CONNECT_LAYOUTLOCK | OBD_CONNECT_FID | \
                                OBD_CONNECT_PINGLESS | OBD_CONNECT_LFSCK | \
                                OBD_CONNECT_BULK_MBITS | \
                                OBD_CONNECT_LAYOUTLOCK | OBD_CONNECT_FID | \
                                OBD_CONNECT_PINGLESS | OBD_CONNECT_LFSCK | \
                                OBD_CONNECT_BULK_MBITS | \
-                               OBD_CONNECT_GRANT_PARAM)
-#define OST_CONNECT_SUPPORTED2 0
+                               OBD_CONNECT_GRANT_PARAM | OBD_CONNECT_FLAGS2)
+
+#define OST_CONNECT_SUPPORTED2 OBD_CONNECT2_LOCKAHEAD
 
 #define ECHO_CONNECT_SUPPORTED 0
 #define ECHO_CONNECT_SUPPORTED2 0
 
 #define ECHO_CONNECT_SUPPORTED 0
 #define ECHO_CONNECT_SUPPORTED2 0
@@ -1046,10 +1049,10 @@ enum obdo_flags {
  * those *_DEF magics are only used on server side internally, they
  * won't be put on wire or disk.
  */
  * those *_DEF magics are only used on server side internally, they
  * won't be put on wire or disk.
  */
-#define LOV_MAGIC_DEF          0x10000000
-#define LOV_MAGIC_V1_DEF       (LOV_MAGIC_DEF | LOV_MAGIC_V1)
-#define LOV_MAGIC_V3_DEF       (LOV_MAGIC_DEF | LOV_MAGIC_V3)
-#define LOV_MAGIC_COMP_V1_DEF  (LOV_MAGIC_DEF | LOV_MAGIC_COMP_V1)
+#define LOV_MAGIC_DEFINED              0x10000000
+#define LOV_MAGIC_V1_DEFINED           (LOV_MAGIC_DEFINED | LOV_MAGIC_V1)
+#define LOV_MAGIC_V3_DEFINED           (LOV_MAGIC_DEFINED | LOV_MAGIC_V3)
+#define LOV_MAGIC_COMP_V1_DEFINED      (LOV_MAGIC_DEFINED | LOV_MAGIC_COMP_V1)
 
 #define lov_pattern(pattern)           (pattern & ~LOV_PATTERN_F_MASK)
 #define lov_pattern_flags(pattern)     (pattern & LOV_PATTERN_F_MASK)
 
 #define lov_pattern(pattern)           (pattern & ~LOV_PATTERN_F_MASK)
 #define lov_pattern_flags(pattern)     (pattern & LOV_PATTERN_F_MASK)
@@ -1271,6 +1274,13 @@ struct hsm_state_set {
                               OBD_BRW_OVER_GRPQUOTA | \
                               OBD_BRW_OVER_PRJQUOTA)
 
                               OBD_BRW_OVER_GRPQUOTA | \
                               OBD_BRW_OVER_PRJQUOTA)
 
+#define OBD_BRW_LOCAL1 0x80000000UL    /*
+                                        * osd-ldiskfs internal,
+                                        * page mapped to real block
+                                        */
+
+#define OBD_BRW_LOCALS (OBD_BRW_LOCAL1)
+
 #define OBD_OBJECT_EOF LUSTRE_EOF
 
 #define OST_MIN_PRECREATE 32
 #define OBD_OBJECT_EOF LUSTRE_EOF
 
 #define OST_MIN_PRECREATE 32
@@ -1356,6 +1366,7 @@ union lquota_id {
        struct lu_fid   qid_fid; /* FID for per-directory quota */
        __u64           qid_uid; /* user identifier */
        __u64           qid_gid; /* group identifier */
        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 */
 };
 
 /* quotactl management */
@@ -1552,7 +1563,7 @@ typedef enum {
  * Do not exceed 63
  */
 
  * Do not exceed 63
  */
 
-typedef enum {
+enum mds_reint_op {
        REINT_SETATTR  = 1,
        REINT_CREATE   = 2,
        REINT_LINK     = 3,
        REINT_SETATTR  = 1,
        REINT_CREATE   = 2,
        REINT_LINK     = 3,
@@ -1563,7 +1574,7 @@ typedef enum {
        REINT_RMENTRY  = 8,
        REINT_MIGRATE  = 9,
         REINT_MAX
        REINT_RMENTRY  = 8,
        REINT_MIGRATE  = 9,
         REINT_MAX
-} mds_reint_t, mdt_reint_t;
+};
 
 /* the disposition of the intent outlines what was executed */
 #define DISP_IT_EXECD        0x00000001
 
 /* the disposition of the intent outlines what was executed */
 #define DISP_IT_EXECD        0x00000001
@@ -2036,17 +2047,17 @@ struct mdt_rec_reint {
 
 /* lmv structures */
 struct lmv_desc {
 
 /* lmv structures */
 struct lmv_desc {
-        __u32 ld_tgt_count;                /* how many MDS's */
-        __u32 ld_active_tgt_count;         /* how many active */
-        __u32 ld_default_stripe_count;     /* how many objects are used */
-       __u32 ld_pattern;                  /* default hash pattern */
-        __u64 ld_default_hash_size;
-        __u64 ld_padding_1;                /* also fix lustre_swab_lmv_desc */
-        __u32 ld_padding_2;                /* also fix lustre_swab_lmv_desc */
-        __u32 ld_qos_maxage;               /* in second */
-        __u32 ld_padding_3;                /* also fix lustre_swab_lmv_desc */
-        __u32 ld_padding_4;                /* also fix lustre_swab_lmv_desc */
-        struct obd_uuid ld_uuid;
+       __u32 ld_tgt_count;             /* how many MDS's */
+       __u32 ld_active_tgt_count;      /* how many active */
+       __u32 ld_default_stripe_count;  /* how many objects are used */
+       __u32 ld_pattern;               /* default hash pattern */
+       __u64 ld_default_hash_size;
+       __u64 ld_padding_1;             /* also fix lustre_swab_lmv_desc */
+       __u32 ld_padding_2;             /* also fix lustre_swab_lmv_desc */
+       __u32 ld_qos_maxage;            /* in second */
+       __u32 ld_padding_3;             /* also fix lustre_swab_lmv_desc */
+       __u32 ld_padding_4;             /* also fix lustre_swab_lmv_desc */
+       struct obd_uuid ld_uuid;
 };
 
 /* LMV layout EA, and it will be stored both in master and slave object */
 };
 
 /* LMV layout EA, and it will be stored both in master and slave object */
@@ -2084,7 +2095,7 @@ struct lmv_mds_md_v1 {
 
 #define LMV_HASH_FLAG_MIGRATION        0x80000000
 
 
 #define LMV_HASH_FLAG_MIGRATION        0x80000000
 
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 10, 56, 0)
+#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 11, 56, 0)
 /* Since lustre 2.8, this flag will not be needed, instead this DEAD
  * and orphan flags will be stored in LMA (see LMAI_ORPHAN)
  * Keep this flag just for LFSCK, because it still might meet such
 /* Since lustre 2.8, this flag will not be needed, instead this DEAD
  * and orphan flags will be stored in LMA (see LMAI_ORPHAN)
  * Keep this flag just for LFSCK, because it still might meet such
@@ -2217,17 +2228,17 @@ typedef enum {
 
 /* LOV settings descriptor (should only contain static info) */
 struct lov_desc {
 
 /* LOV settings descriptor (should only contain static info) */
 struct lov_desc {
-        __u32 ld_tgt_count;                /* how many OBD's */
-        __u32 ld_active_tgt_count;         /* how many active */
-        __u32 ld_default_stripe_count;     /* how many objects are used */
-        __u32 ld_pattern;                  /* default PATTERN_RAID0 */
-        __u64 ld_default_stripe_size;      /* in bytes */
-        __u64 ld_default_stripe_offset;    /* in bytes */
-        __u32 ld_padding_0;                /* unused */
-        __u32 ld_qos_maxage;               /* in second */
-        __u32 ld_padding_1;                /* also fix lustre_swab_lov_desc */
-        __u32 ld_padding_2;                /* also fix lustre_swab_lov_desc */
-        struct obd_uuid ld_uuid;
+       __u32 ld_tgt_count;             /* how many OBD's */
+       __u32 ld_active_tgt_count;      /* how many active */
+       __s32 ld_default_stripe_count;  /* how many objects are used */
+       __u32 ld_pattern;               /* default PATTERN_RAID0 */
+       __u64 ld_default_stripe_size;   /* in bytes */
+       __s64 ld_default_stripe_offset; /* starting OST index */
+       __u32 ld_padding_0;             /* unused */
+       __u32 ld_qos_maxage;            /* in second */
+       __u32 ld_padding_1;             /* also fix lustre_swab_lov_desc */
+       __u32 ld_padding_2;             /* also fix lustre_swab_lov_desc */
+       struct obd_uuid ld_uuid;
 };
 
 #define ld_magic ld_active_tgt_count       /* for swabbing from llogs */
 };
 
 #define ld_magic ld_active_tgt_count       /* for swabbing from llogs */
@@ -2291,6 +2302,12 @@ struct ldlm_extent {
         __u64 gid;
 };
 
         __u64 gid;
 };
 
+static inline bool ldlm_extent_equal(const struct ldlm_extent *ex1,
+                                   const struct ldlm_extent *ex2)
+{
+       return ex1->start == ex2->start && ex1->end == ex2->end;
+}
+
 struct ldlm_inodebits {
         __u64 bits;
        __u64 try_bits; /* optional bits to try */
 struct ldlm_inodebits {
         __u64 bits;
        __u64 try_bits; /* optional bits to try */