Whamcloud - gitweb
LU-1267 lfsck: enhance API for MDT-OST consistency
[fs/lustre-release.git] / lustre / include / lustre_update.h
index 1829cf6..e23c66e 100644 (file)
 #define UPDATE_BUFFER_SIZE     8192
 struct update_request {
        struct dt_device        *ur_dt;
-       cfs_list_t              ur_list;    /* attached itself to thandle */
-       int                     ur_flags;
-       int                     ur_rc;      /* request result */
-       int                     ur_batchid; /* Current batch(trans) id */
-       struct update_buf       *ur_buf;   /* Holding the update req */
+       struct list_head         ur_list; /* attached itself to thandle */
+       int                      ur_flags;
+       int                      ur_rc; /* request result */
+       int                      ur_batchid; /* Current batch(trans) id */
+       struct update_buf       *ur_buf; /* Holding the update req */
+       struct list_head         ur_cb_items;
 };
 
 static inline unsigned long update_size(struct update *update)
@@ -157,13 +158,15 @@ static inline void update_insert_reply(struct update_reply *reply, void *data,
        reply->ur_lens[index] = data_len + sizeof(int);
 }
 
-static inline int update_get_reply_buf(struct update_reply *reply, void **buf,
-                                      int index)
+static inline int update_get_reply_buf(struct update_reply *reply,
+                                      struct lu_buf *lbuf, int index)
 {
        char *ptr;
        int  size = 0;
        int  result;
 
+       LASSERT(lbuf != NULL);
+
        ptr = update_get_buf_internal(reply, index, &size);
        LASSERT(ptr != NULL);
        result = *(int *)ptr;
@@ -172,8 +175,11 @@ static inline int update_get_reply_buf(struct update_reply *reply, void **buf,
                return result;
 
        LASSERT(size >= sizeof(int));
-       *buf = ptr + sizeof(int);
-       return size - sizeof(int);
+
+       lbuf->lb_buf = ptr + sizeof(int);
+       lbuf->lb_len = size - sizeof(int);
+
+       return 0;
 }
 
 static inline int update_get_reply_result(struct update_reply *reply,
@@ -187,6 +193,9 @@ static inline int update_get_reply_result(struct update_reply *reply,
        return *(int *)ptr;
 }
 
-#endif
-
+static inline void update_inc_batchid(struct update_request *update)
+{
+       update->ur_batchid++;
+}
 
+#endif