+ /* objid gap may require to destroy several objects in row */
+ count = lur->lur_count + 1;
+
+ while (count > 0) {
+ rc = filter_destroy(exp, oa, NULL, NULL, NULL, NULL);
+ if (rc == 0)
+ CDEBUG(D_RPCTRACE, "object "LPU64" is destroyed\n",
+ oid);
+ else if (rc != -ENOENT)
+ CEMERG("error destroying object "LPU64": %d\n",
+ oid, rc);
+ else
+ rc = 0;
+ count--;
+ oid++;
+ }
+ OBDO_FREE(oa);
+
+ RETURN(rc);
+}
+
+/* Callback for processing the setattr log record received from MDS by
+ * llog_client_api. */
+static int filter_recov_log_setattr_cb(struct llog_ctxt *ctxt,
+ struct llog_rec_hdr *rec,
+ struct llog_cookie *cookie)
+{
+ struct obd_device *obd = ctxt->loc_obd;
+ struct obd_export *exp = obd->obd_self_export;
+ struct obd_info oinfo = { { { 0 } } };
+ obd_id oid;
+ int rc = 0;
+ ENTRY;
+
+ OBDO_ALLOC(oinfo.oi_oa);
+ if (oinfo.oi_oa == NULL)
+ RETURN(-ENOMEM);
+
+ if (rec->lrh_type == MDS_SETATTR_REC) {
+ struct llog_setattr_rec *lsr = (struct llog_setattr_rec *)rec;
+
+ oinfo.oi_oa->o_id = lsr->lsr_oid;
+ oinfo.oi_oa->o_gr = lsr->lsr_ogr;
+ oinfo.oi_oa->o_uid = lsr->lsr_uid;
+ oinfo.oi_oa->o_gid = lsr->lsr_gid;
+ } else {
+ struct llog_setattr64_rec *lsr = (struct llog_setattr64_rec *)rec;
+
+ oinfo.oi_oa->o_id = lsr->lsr_oid;
+ oinfo.oi_oa->o_gr = lsr->lsr_ogr;
+ oinfo.oi_oa->o_uid = lsr->lsr_uid;
+ oinfo.oi_oa->o_gid = lsr->lsr_gid;
+ }
+
+ oinfo.oi_oa->o_valid |= (OBD_MD_FLID | OBD_MD_FLUID | OBD_MD_FLGID |
+ OBD_MD_FLCOOKIE);
+ oinfo.oi_oa->o_valid = OBD_MD_FLID | OBD_MD_FLGROUP;
+ oinfo.oi_oa->o_lcookie = *cookie;
+ oid = oinfo.oi_oa->o_id;
+
+ rc = filter_setattr(exp, &oinfo, NULL);
+ OBDO_FREE(oinfo.oi_oa);