Whamcloud - gitweb
b=14340
[fs/lustre-release.git] / lustre / include / lustre / lustre_idl.h
index 6b2bf7c..72c1999 100644 (file)
@@ -351,16 +351,18 @@ static inline int lu_fid_eq(const struct lu_fid *f0,
  */
 struct lu_dirent {
         struct lu_fid lde_fid;
-        __u32         lde_hash;
+        __u64         lde_hash;
         __u16         lde_reclen;
         __u16         lde_namelen;
+        __u32         lde_pad0;
         char          lde_name[0];
 };
 
 struct lu_dirpage {
-        __u32            ldp_hash_start;
-        __u32            ldp_hash_end;
+        __u64            ldp_hash_start;
+        __u64            ldp_hash_end;
         __u16            ldp_flags;
+        __u16            ldp_pad;
         __u32            ldp_pad0;
         struct lu_dirent ldp_entries[0];
 };
@@ -398,7 +400,7 @@ static inline int lu_dirent_size(struct lu_dirent *ent)
         return le16_to_cpu(ent->lde_reclen);
 }
 
-#define DIR_END_OFF              0xfffffffeUL
+#define DIR_END_OFF              0xfffffffffffffffeULL
 
 struct lustre_handle {
         __u64 cookie;
@@ -549,8 +551,10 @@ extern void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb);
 #define OBD_CONNECT_LRU_RESIZE 0x02000000ULL /* Lru resize feature. */
 #define OBD_CONNECT_MDS_MDS    0x04000000ULL /* MDS-MDS connection*/
 #define OBD_CONNECT_REAL       0x08000000ULL /* real connection */
-#define OBD_CONNECT_FID        0x10000000ULL /* FID is supported by server */
+#define OBD_CONNECT_CHANGE_QS  0x10000000ULL /*shrink/enlarge qunit size
+                                              *b=10600 */
 #define OBD_CONNECT_CKSUM      0x20000000ULL /* support several cksum algos */
+#define OBD_CONNECT_FID        0x40000000ULL /* FID is supported by server */
 
 /* also update obd_connect_names[] for lprocfs_rd_connect_flags()
  * and lustre/utils/wirecheck.c */
@@ -576,7 +580,7 @@ extern void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb);
                                 OBD_CONNECT_TRUNCLOCK | OBD_CONNECT_INDEX | \
                                 OBD_CONNECT_BRW_SIZE | OBD_CONNECT_QUOTA64 | \
                                 OBD_CONNECT_OSS_CAPA | OBD_CONNECT_CANCELSET | \
-                                OBD_CONNECT_FID | \
+                                OBD_CONNECT_FID | OBD_CONNECT_CKSUM | \
                                 LRU_RESIZE_CONNECT_FLAG)
 #define ECHO_CONNECT_SUPPORTED (0)
 #define MGS_CONNECT_SUPPORTED  (OBD_CONNECT_VERSION | OBD_CONNECT_FID)
@@ -605,14 +609,25 @@ struct obd_connect_data {
         __u32 ocd_nllg;          /* non-local-lustre-group */
         __u64 ocd_transno;       /* first transno from client to be replayed */
         __u32 ocd_group;         /* MDS group on OST */
-        __u32 padding1;          /* also fix lustre_swab_connect */
+        __u32 ocd_cksum_types;   /* supported checksum algorithms */
+        __u64 padding1;          /* also fix lustre_swab_connect */
         __u64 padding2;          /* also fix lustre_swab_connect */
-        __u64 padding3;          /* also fix lustre_swab_connect */
 };
 
 extern void lustre_swab_connect(struct obd_connect_data *ocd);
 
 /*
+ * 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.
+ */
+typedef enum {
+        OBD_CKSUM_CRC32 = 0x00000001,
+        OBD_CKSUM_ADLER = 0x00000002,
+} cksum_type_t;
+
+/*
  *   OST requests: OBDO & OBD request records
  */
 
@@ -672,6 +687,13 @@ typedef uint32_t        obd_count;
 #define OBD_FL_TRUNCLOCK     (0x00000800)
 
 /*
+ * Checksum types
+ */
+#define OBD_FL_CKSUM_CRC32    (0x00001000)
+#define OBD_FL_CKSUM_ADLER    (0x00002000)
+#define OBD_FL_CKSUM_ALL      (OBD_FL_CKSUM_CRC32 | OBD_FL_CKSUM_ADLER)
+
+/*
  * This should not be smaller than sizeof(struct lustre_handle) + sizeof(struct
  * llog_cookie) + sizeof(struct ll_fid). Nevertheless struct ll_fid is not
  * longer stored in o_inline, we keep this just for case.
@@ -851,6 +873,8 @@ struct obd_statfs {
 };
 
 extern void lustre_swab_obd_statfs (struct obd_statfs *os);
+#define OBD_STATFS_NODELAY      0x0001  /* requests should be send without delay
+                                         * and resends for avoid deadlocks */
 
 /* ost_body.data values for OST_BRW */
 
@@ -1650,6 +1674,8 @@ typedef enum {
         LCK_MAXMODE
 } ldlm_mode_t;
 
+#define LCK_MODE_NUM    7
+
 typedef enum {
         LDLM_PLAIN     = 10,
         LDLM_EXTENT    = 11,
@@ -1666,6 +1692,12 @@ struct ldlm_extent {
         __u64 gid;
 };
 
+static inline int ldlm_extent_overlap(struct ldlm_extent *ex1,
+                                      struct ldlm_extent *ex2)
+{
+        return (ex1->start <= ex2->end) && (ex2->start <= ex1->end);
+}
+
 struct ldlm_inodebits {
         __u64 bits;
 };