Whamcloud - gitweb
b=16461
[fs/lustre-release.git] / lustre / include / lustre / lustre_idl.h
index 21bc557..4169b19 100644 (file)
@@ -174,46 +174,61 @@ typedef __u64 seqno_t;
 struct lu_range {
         __u64 lr_start;
         __u64 lr_end;
+        /** stub for compact fld work. */
+        __u64 lr_padding;
 };
 
-static inline __u64 range_space(struct lu_range *r)
+/**
+ * returns  width of given range \a r
+ */
+
+static inline __u64 range_space(const struct lu_range *range)
 {
-        return r->lr_end - r->lr_start;
+        return range->lr_end - range->lr_start;
 }
 
-static inline void range_zero(struct lu_range *r)
+/**
+ * initialize range to zero
+ */
+static inline void range_init(struct lu_range *range)
 {
-        r->lr_start = r->lr_end = 0;
+        range->lr_start = range->lr_end = 0;
 }
 
-static inline int range_within(struct lu_range *r,
+/**
+ * check if given seq id \a s is within given range \a r
+ */
+static inline int range_within(struct lu_range *range,
                                __u64 s)
 {
-        return s >= r->lr_start && s < r->lr_end;
+        return s >= range->lr_start && s < range->lr_end;
 }
 
-static inline void range_alloc(struct lu_range *r,
-                               struct lu_range *s,
-                               __u64 w)
+/**
+ * allocate \a w units of sequence from range \a from.
+ */
+static inline void range_alloc(struct lu_range *to,
+                               struct lu_range *from,
+                               __u64 width)
 {
-        r->lr_start = s->lr_start;
-        r->lr_end = s->lr_start + w;
-        s->lr_start += w;
+        to->lr_start = from->lr_start;
+        to->lr_end = from->lr_start + width;
+        from->lr_start += width;
 }
 
-static inline int range_is_sane(struct lu_range *r)
+static inline int range_is_sane(const struct lu_range *range)
 {
-        return (r->lr_end >= r->lr_start);
+        return (range->lr_end >= range->lr_start);
 }
 
-static inline int range_is_zero(struct lu_range *r)
+static inline int range_is_zero(const struct lu_range *range)
 {
-        return (r->lr_start == 0 && r->lr_end == 0);
+        return (range->lr_start == 0 && range->lr_end == 0);
 }
 
-static inline int range_is_exhausted(struct lu_range *r)
+static inline int range_is_exhausted(const struct lu_range *range)
 {
-        return range_space(r) == 0;
+        return range_space(range) == 0;
 }
 
 #define DRANGE "[%#16.16"LPF64"x-%#16.16"LPF64"x]"
@@ -293,7 +308,7 @@ static inline void fid_zero(struct lu_fid *fid)
 /**
  * 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 a igif; otherwise false.
  */
 static inline int fid_is_igif(const struct lu_fid *fid)
 {
@@ -303,7 +318,7 @@ static inline int 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 a idif; otherwise false.
  */
 static inline int fid_is_idif(const struct lu_fid *fid)
 {
@@ -324,7 +339,7 @@ static inline ino_t lu_igif_ino(const struct lu_fid *fid)
  * Get inode generation from a igif.
  * \param fid a igif to get inode generation from.
  * \return inode generation for the igif.
- */ 
+ */
 static inline __u32 lu_igif_gen(const struct lu_fid *fid)
 {
         return fid_oid(fid);
@@ -390,7 +405,6 @@ static inline void fid_be_to_cpu(struct lu_fid *dst, const struct lu_fid *src)
  *
  * Variable size, first byte contains the length of the whole record.
  */
-
 struct lu_fid_pack {
         char fp_len;
         char fp_area[sizeof(struct lu_fid)];
@@ -947,7 +961,7 @@ extern void lustre_swab_obd_statfs (struct obd_statfs *os);
 #define OBD_BRW_CHECK           0x10
 #define OBD_BRW_FROM_GRANT      0x20 /* the osc manages this under llite */
 #define OBD_BRW_GRANTED         0x40 /* the ost manages this */
-#define OBD_BRW_DROP            0x80 /* drop the page after IO */
+#define OBD_BRW_NOCACHE         0x80 /* this page is a part of non-cached IO */
 #define OBD_BRW_NOQUOTA        0x100
 #define OBD_BRW_SRVLOCK        0x200 /* Client holds no lock over this page */
 
@@ -976,7 +990,7 @@ extern void lustre_swab_niobuf_remote (struct niobuf_remote *nbr);
 
 /* lock value block communicated between the filter and llite */
 
-/* OST_LVB_ERR_INIT is needed because the return code in rc is 
+/* OST_LVB_ERR_INIT is needed because the return code in rc is
  * negative, i.e. because ((MASK + rc) & MASK) != MASK. */
 #define OST_LVB_ERR_INIT 0xffbadbad80000000ULL
 #define OST_LVB_ERR_MASK 0xffbadbad00000000ULL
@@ -1725,10 +1739,11 @@ typedef enum {
         LCK_CR      = 16,
         LCK_NL      = 32,
         LCK_GROUP   = 64,
+        LCK_COS     = 128,
         LCK_MAXMODE
 } ldlm_mode_t;
 
-#define LCK_MODE_NUM    7
+#define LCK_MODE_NUM    8
 
 typedef enum {
         LDLM_PLAIN     = 10,