+ if (list_empty(&ctxt->loc_handle->u.chd.chd_head)) {
+ CDEBUG(D_HA, "there is no record related to ctxt %p\n", ctxt);
+ RETURN(0);
+ }
+
+ /* FIXME what value for gen->conn_cnt */
+ LLOG_GEN_INC(ctxt->loc_gen);
+
+ /* first add llog_gen_rec */
+ OBD_ALLOC(lgr, sizeof(*lgr));
+ if (!lgr)
+ RETURN(-ENOMEM);
+ lgr->lgr_hdr.lrh_len = lgr->lgr_tail.lrt_len = sizeof(*lgr);
+ lgr->lgr_hdr.lrh_type = LLOG_GEN_REC;
+ lgr->lgr_gen = ctxt->loc_gen;
+ rc = llog_add(ctxt, &lgr->lgr_hdr, NULL, NULL, 1);
+ OBD_FREE(lgr, sizeof(*lgr));
+ if (rc != 1)
+ RETURN(rc);
+