+ /* we still want to sync changes if no new changes are coming */
+ if (ktime_before(ktime_get(), d->opd_sync_next_commit_cb))
+ GOTO(out, rc);
+
+ if (atomic_read(&d->opd_sync_changes)) {
+ struct thandle *th;
+
+ th = dt_trans_create(env, d->opd_storage);
+ if (IS_ERR(th)) {
+ CERROR("%s: can't sync\n", d->opd_obd->obd_name);
+ GOTO(out, rc);
+ }
+ rc = dt_trans_start_local(env, d->opd_storage, th);
+ if (rc == 0) {
+ CDEBUG(D_OTHER, "%s: sync forced, %d changes\n",
+ d->opd_obd->obd_name,
+ atomic_read(&d->opd_sync_changes));
+ osp_sync_add_commit_cb_1s(env, d, th);
+ dt_trans_stop(env, d->opd_storage, th);
+ }
+ }
+
+out: