}
EXPORT_SYMBOL(mds_lov_prepare_objids);
-/*
- * write llog orphan record about lost ost object,
- * Special lsm is allocated with single stripe, caller should deallocated it
- * after use
- */
-static int mds_log_lost_precreated(struct obd_device *obd,
- struct lov_stripe_md **lsmp, int *stripes,
- obd_id id, obd_count count, int idx)
-{
- struct lov_stripe_md *lsm = *lsmp;
- int rc;
- ENTRY;
-
- if (*lsmp == NULL) {
- rc = obd_alloc_memmd(obd->u.mds.mds_lov_exp, &lsm);
- if (rc < 0)
- RETURN(rc);
- /* need only one stripe, save old value */
- *stripes = lsm->lsm_stripe_count;
- lsm->lsm_stripe_count = 1;
- *lsmp = lsm;
- }
-
- lsm->lsm_oinfo[0]->loi_id = id;
- lsm->lsm_oinfo[0]->loi_seq = mdt_to_obd_objseq(obd->u.mds.mds_id);
- lsm->lsm_oinfo[0]->loi_ost_idx = idx;
-
- rc = mds_log_op_orphan(obd, lsm, count);
- RETURN(rc);
-}
-
void mds_lov_update_objids(struct obd_device *obd, struct lov_mds_md *lmm)
{
struct mds_obd *mds = &obd->u.mds;
int j;
struct lov_ost_data_v1 *obj;
- struct lov_stripe_md *lsm = NULL;
- int stripes = 0;
int count;
ENTRY;
" - new "LPU64" old "LPU64"\n", i, id, data[idx]);
if (id > data[idx]) {
int lost = id - data[idx] - 1;
- /* we might have lost precreated objects due to VBR */
if (lost > 0 && obd->obd_recovering) {
- CDEBUG(D_HA, "Gap in objids is %u\n", lost);
- if (!obd->obd_version_recov)
- CERROR("Unexpected gap in objids\n");
- /* lsm is allocated if NULL */
- mds_log_lost_precreated(obd, &lsm, &stripes,
- data[idx]+1, lost, i);
+ CDEBUG(obd->obd_version_recov ? D_HA:D_WARNING,
+ "Gap in objids for OST%d, "
+ "next id on disk: "LPU64", "
+ "id to be allocated: "LPU64", "
+ "lost: %d\n", i, data[idx], id, lost);
}
data[idx] = id;
cfs_bitmap_set(mds->mds_lov_page_dirty, page);
}
}
- if (lsm) {
- /* restore stripes number */
- lsm->lsm_stripe_count = stripes;
- obd_free_memmd(mds->mds_lov_exp, &lsm);
- }
EXIT;
return;
}
struct obd_export *exp = ctxt->loc_obd->obd_self_export;
struct llog_unlink_rec *lur;
struct obdo *oa;
- obd_id oid;
obd_count count;
int rc = 0;
ENTRY;
oa->o_seq = lur->lur_oseq;
oa->o_valid = OBD_MD_FLID | OBD_MD_FLGROUP;
oa->o_lcookie = *cookie;
- oid = oa->o_id;
/* objid gap may require to destroy several objects in row */
count = lur->lur_count + 1;
rc = filter_destroy(exp, oa, NULL, NULL, NULL, NULL);
if (rc == 0)
CDEBUG(D_RPCTRACE, "object "LPU64" is destroyed\n",
- oid);
+ oa->o_id);
else if (rc != -ENOENT)
CEMERG("error destroying object "LPU64": %d\n",
- oid, rc);
+ oa->o_id, rc);
else
rc = 0;
count--;
- oid++;
+ oa->o_id++;
}
OBDO_FREE(oa);