-int ofd_record_write(const struct lu_env *env, struct ofd_device *ofd,
- struct dt_object *dt, struct lu_buf *buf, loff_t *off)
-{
- struct thandle *th;
- int rc;
-
- ENTRY;
-
- LASSERT(dt);
-
- th = dt_trans_create(env, ofd->ofd_osd);
- if (IS_ERR(th))
- RETURN(PTR_ERR(th));
-
- rc = dt_declare_record_write(env, dt, buf, *off, th);
- if (rc == 0) {
- rc = dt_trans_start_local(env, ofd->ofd_osd, th);
- if (rc == 0)
- rc = dt_record_write(env, dt, buf, off, th);
- }
- dt_trans_stop(env, ofd->ofd_osd, th);
-
- RETURN(rc);
-}
-
+/**
+ * Restrict precreate batch count by its upper limit.
+ *
+ * The precreate batch count is a number of precreates to do in
+ * single transaction. It has upper limit - ofd_device::ofd_precreate_batch
+ * value which shouldn't be exceeded.
+ *
+ * \param[in] ofd OFD device
+ * \param[in] int number of updates in the batch
+ *
+ * \retval \a batch limited by ofd_device::ofd_precreate_batch
+ */