- CDEBUG(D_HA,
- "%s: reserve %d objects in group "LPU64" at "LPU64"\n",
- ofd_obd(ofd)->obd_name, diff, oa->o_seq, next_id);
- for (i = 0; i < diff; i++) {
- rc = ofd_precreate_object(env, ofd, next_id + i,
- oa->o_seq);
- if (rc)
+ while (diff > 0) {
+ next_id = ofd_last_id(ofd, oa->o_seq) + 1;
+ count = ofd_precreate_batch(ofd, diff);
+
+ CDEBUG(D_HA, "%s: reserve %d objects in group "LPU64
+ " at "LPU64"\n", ofd_obd(ofd)->obd_name,
+ count, oa->o_seq, next_id);
+
+ if (cfs_time_after(jiffies, enough_time)) {
+ LCONSOLE_WARN("%s: Slow creates, %d/%d objects"
+ " created at a rate of %d/s\n",
+ ofd_obd(ofd)->obd_name,
+ created, diff + created,
+ created / DISK_TIMEOUT);
+ break;
+ }
+
+ rc = ofd_precreate_objects(env, ofd, next_id,
+ oa->o_seq, count);
+ if (rc > 0) {
+ created += rc;
+ diff -= rc;
+ } else if (rc < 0) {