#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)
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;
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,
return *(int *)ptr;
}
-#endif
-
+static inline void update_inc_batchid(struct update_request *update)
+{
+ update->ur_batchid++;
+}
+#endif