-static int llog_client_prev_block(struct llog_handle *loghandle,
- int prev_idx, void *buf, int len)
+static int llog_client_destroy(struct llog_handle *loghandle)
+{
+ struct obd_import *imp = loghandle->lgh_ctxt->loc_imp;
+ struct ptlrpc_request *req = NULL;
+ struct llogd_body *body;
+ int size[] = { sizeof(struct ptlrpc_body), sizeof(*body) };
+ int rc;
+ ENTRY;
+
+ req = ptlrpc_prep_req(imp, LUSTRE_LOG_VERSION,
+ LLOG_ORIGIN_HANDLE_DESTROY, 2, size, NULL);
+ if (!req)
+ RETURN(-ENOMEM);
+
+ body = lustre_msg_buf(req->rq_reqmsg, REQ_REC_OFF, sizeof(*body));
+ body->lgd_logid = loghandle->lgh_id;
+ body->lgd_llh_flags = loghandle->lgh_hdr->llh_flags;
+
+ ptlrpc_req_set_repsize(req, 2, size);
+ rc = ptlrpc_queue_wait(req);
+
+ ptlrpc_req_finished(req);
+ RETURN(rc);
+}
+
+
+static int llog_client_next_block(struct llog_handle *loghandle,
+ int *cur_idx, int next_idx,
+ __u64 *cur_offset, void *buf, int len)