Whamcloud - gitweb
LU-1943 class: FID_SEQ_LOCAL_NAME set to the Orion value
[fs/lustre-release.git] / lustre / include / lustre / lustre_idl.h
index a41e82a..bae42d0 100644 (file)
@@ -421,13 +421,12 @@ enum fid_seq {
        /* sequence for local pre-defined FIDs listed in local_oid */
         FID_SEQ_LOCAL_FILE = 0x200000001ULL,
         FID_SEQ_DOT_LUSTRE = 0x200000002ULL,
-        /* XXX 0x200000003ULL is reserved for FID_SEQ_LLOG_OBJ */
        /* sequence is used for local named objects FIDs generated
         * by local_object_storage library */
+       FID_SEQ_LOCAL_NAME = 0x200000003ULL,
         FID_SEQ_SPECIAL    = 0x200000004ULL,
         FID_SEQ_QUOTA      = 0x200000005ULL,
         FID_SEQ_QUOTA_GLB  = 0x200000006ULL,
-       FID_SEQ_LOCAL_NAME = 0x200000007ULL,
         FID_SEQ_NORMAL     = 0x200000400ULL,
         FID_SEQ_LOV_DEFAULT= 0xffffffffffffffffULL
 };
@@ -534,6 +533,13 @@ static inline obd_id fid_idif_id(obd_seq seq, __u32 oid, __u32 ver)
         return ((__u64)ver << 48) | ((seq & 0xffff) << 32) | oid;
 }
 
+/* extract ost index from IDIF FID */
+static inline __u32 fid_idif_ost_idx(const struct lu_fid *fid)
+{
+       LASSERT(fid_is_idif(fid));
+       return (fid_seq(fid) >> 16) & 0xffff;
+}
+
 /* unpack an ostid (id/seq) from a wire/disk structure into an IDIF FID */
 static inline void ostid_idif_unpack(struct ost_id *ostid,
                                      struct lu_fid *fid, __u32 ost_idx)
@@ -1383,6 +1389,21 @@ enum obdo_flags {
 #define LOV_MAGIC_JOIN_V1 0x0BD20BD0
 #define LOV_MAGIC_V3      0x0BD30BD0
 
+/*
+ * magic for fully defined striping
+ * the idea is that we should have different magics for striping "hints"
+ * (struct lov_user_md_v[13]) and defined ready-to-use striping (struct
+ * lov_mds_md_v[13]). at the moment the magics are used in wire protocol,
+ * we can't just change it w/o long way preparation, but we still need a
+ * mechanism to allow LOD to differentiate hint versus ready striping.
+ * so, at the moment we do a trick: MDT knows what to expect from request
+ * depending on the case (replay uses ready striping, non-replay req uses
+ * hints), so MDT replaces magic with appropriate one and now LOD can
+ * easily understand what's inside -bzzz
+ */
+#define LOV_MAGIC_V1_DEF  0x0CD10BD0
+#define LOV_MAGIC_V3_DEF  0x0CD30BD0
+
 #define LOV_PATTERN_RAID0 0x001   /* stripes are used round-robin */
 #define LOV_PATTERN_RAID1 0x002   /* stripes are mirrors of each other */
 #define LOV_PATTERN_FIRST 0x100   /* first stripe is not in round-robin */
@@ -1660,6 +1681,8 @@ enum {
         LUSTRE_RES_ID_SEQ_OFF = 0,
         LUSTRE_RES_ID_VER_OID_OFF = 1,
         LUSTRE_RES_ID_WAS_VER_OFF = 2, /* see note above */
+       LUSTRE_RES_ID_QUOTA_SEQ_OFF = 2,
+       LUSTRE_RES_ID_QUOTA_VER_OID_OFF = 3,
         LUSTRE_RES_ID_HSH_OFF = 3
 };
 
@@ -1843,7 +1866,7 @@ struct quota_body {
  * lock (IT_QUOTA_CONN) reply, qb_fid contains slave index file FID. */
 #define qb_slv_fid       qb_fid
 /* qb_usage is the current qunit (in kbytes/inodes) when quota_body is used in
- * acquire reply */
+ * quota reply */
 #define qb_qunit         qb_usage
 
 extern void lustre_swab_quota_body(struct quota_body *b);
@@ -2082,7 +2105,6 @@ enum {
         MDS_CLOSE_CLEANUP = 1 << 6,
         MDS_KEEP_ORPHAN   = 1 << 7,
         MDS_RECOV_OPEN    = 1 << 8,
-        MDS_UNLINK_DESTROY = 1 << 9,  /* Destory ost object in mdd_unlink */
 };
 
 /* instance of mdt_reint_rec */
@@ -2456,15 +2478,52 @@ typedef union {
 
 extern void lustre_swab_ldlm_policy_data (ldlm_wire_policy_data_t *d);
 
+/* Data structures associated with the quota locks */
+
+/* Glimpse descriptor used for the index & per-ID quota locks */
+struct ldlm_gl_lquota_desc {
+       union lquota_id gl_id;    /* quota ID subject to the glimpse */
+       __u64           gl_flags; /* see LQUOTA_FL* below */
+       __u64           gl_ver;   /* new index version */
+       __u64           gl_hardlimit; /* new hardlimit or qunit value */
+       __u64           gl_softlimit; /* new softlimit */
+       __u64           gl_pad1;
+       __u64           gl_pad2;
+};
+#define gl_qunit       gl_hardlimit /* current qunit value used when
+                                     * glimpsing per-ID quota locks */
+
+/* quota glimpse flags */
+#define LQUOTA_FL_EDQUOT 0x1 /* user/group out of quota space on QMT */
+
+/* LVB used with quota (global and per-ID) locks */
+struct lquota_lvb {
+       __u64   lvb_flags;      /* see LQUOTA_FL* above */
+       __u64   lvb_id_may_rel; /* space that might be released later */
+       __u64   lvb_id_rel;     /* space released by the slave for this ID */
+       __u64   lvb_id_qunit;   /* current qunit value */
+       __u64   lvb_pad1;
+};
+
+/* LVB used with global quota lock */
+#define lvb_glb_ver  lvb_id_may_rel /* current version of the global index */
+
 /* Similarly to ldlm_wire_policy_data_t, there is one common swabber for all
  * LVB types. As a result, any new LVB structure must match the fields of the
  * ost_lvb structure. */
 union ldlm_wire_lvb {
-        struct ost_lvb l_ost;
+       struct ost_lvb          l_ost;
+       struct lquota_lvb       l_lquota;
 };
 
 extern void lustre_swab_lvb(union ldlm_wire_lvb *);
 
+union ldlm_gl_desc {
+       struct ldlm_gl_lquota_desc      lquota_desc;
+};
+
+extern void lustre_swab_gl_desc(union ldlm_gl_desc *);
+
 struct ldlm_intent {
         __u64 opc;
 };