+int mdd_declare_llog_cancel(const struct lu_env *env, struct mdd_device *mdd,
+ struct thandle *handle)
+{
+ int rc;
+
+
+ /* XXX: this is a temporary solution to declare llog changes
+ * will be fixed in 2.3 with new llog implementation */
+
+ LASSERT(mdd->mdd_capa);
+
+ /* the llog record could be canceled either by modifying
+ * the plain llog's header or by destroying the llog itself
+ * when this record is the last one in it, it can't be known
+ * here, but the catlog's header will also be modified for
+ * the second case, then the first case can be covered and
+ * is no need to declare it */
+
+ /* destroy empty plain log */
+ rc = dt_declare_destroy(env, mdd->mdd_capa, handle);
+ if (rc)
+ return rc;
+
+ /* record the catlog's header if an empty plain log was destroyed */
+ rc = dt_declare_record_write(env, mdd->mdd_capa,
+ sizeof(struct llog_logid_rec), 0, handle);
+ return rc;
+}
+