+ /* cancel them one at a time. I suppose we could store up the cookies
+ and cancel them all at once; probably more efficient, but this is
+ done as a user call, so who cares... */
+ rc = llog_cat_cancel_records(llh->u.phd.phd_cat_handle, 1, &cookie);
+ RETURN(rc < 0 ? rc : 0);
+}
+
+static int llog_changelog_cancel(struct llog_ctxt *ctxt,
+ struct lov_stripe_md *lsm, int count,
+ struct llog_cookie *cookies, int flags)
+{
+ struct llog_handle *cathandle = ctxt->loc_handle;
+ int rc;
+ ENTRY;
+
+ /* This should only be called with the catalog handle */
+ LASSERT(cathandle->lgh_hdr->llh_flags & LLOG_F_IS_CAT);
+
+ rc = llog_cat_process(cathandle, llog_changelog_cancel_cb,
+ (void *)cookies, 0, 0);
+ if (rc >= 0)
+ /* 0 or 1 means we're done */
+ rc = 0;
+ else
+ CERROR("cancel idx %u of catalog "LPX64" rc=%d\n",
+ cathandle->lgh_last_idx, cathandle->lgh_id.lgl_oid, rc);