- OBD_ALLOC(lur, sizeof(*lur));
- if (!lur)
- RETURN(-ENOMEM);
- lur->lur_hdr.lrh_len = lur->lur_tail.lrt_len = sizeof(*lur);
- lur->lur_hdr.lrh_type = MDS_UNLINK_REC;
-
- LASSERT(logcookies && numcookies >= lsm->lsm_stripe_count);
-
- /* We need this to serialize llog records between parallel unlinks so
- * we can replay llog records in strict transno and llog order. If
- * and when we want to make this more scalable we need to lock and
- * write records in strictly ost_idx order not lsm order. Consider
- * file 1 on ost_idx [1, 2, 3, 4] and file 2 on ost_idx [3, 4, 1, 2] */
- down(&lov->lov_llog_sem);
- for (i = 0,loi = lsm->lsm_oinfo; i < lsm->lsm_stripe_count; i++,loi++) {
- struct obd_device *child;
- struct llog_ctxt *cctxt;
- struct lov_tgt_desc *tgt;
-
- tgt = lov->tgts + loi->loi_ost_idx;
- if (!lov_tgt_active(lov, tgt, loi->loi_ost_gen)) {
- CWARN("lov_llog_origin_add: ost idx %d inactive.\n",
- loi->loi_ost_idx);
- continue;
+ LASSERTF(logcookies && numcookies >= lsm->lsm_stripe_count,
+ "logcookies %p, numcookies %d lsm->lsm_stripe_count %d \n",
+ logcookies, numcookies, lsm->lsm_stripe_count);
+
+ for (i = 0; i < lsm->lsm_stripe_count; i++) {
+ struct lov_oinfo *loi = lsm->lsm_oinfo[i];
+ struct obd_device *child =
+ lov->lov_tgts[loi->loi_ost_idx]->ltd_exp->exp_obd;
+ struct llog_ctxt *cctxt = llog_get_context(child, ctxt->loc_idx);
+
+ /* fill mds unlink/setattr log record */
+ switch (rec->lrh_type) {
+ case MDS_UNLINK_REC: {
+ struct llog_unlink_rec *lur = (struct llog_unlink_rec *)rec;
+ lur->lur_oid = loi->loi_id;
+ lur->lur_oseq = loi->loi_seq;
+ break;