+ fsdb = local_file_find_or_create(env, mgs->mgs_los, mgs->mgs_nidtbl_dir,
+ tbl->mn_fsdb->fsdb_name,
+ S_IFREG | S_IRUGO | S_IWUSR);
+ if (IS_ERR(fsdb))
+ RETURN(PTR_ERR(fsdb));
+
+ th = dt_trans_create(env, mgs->mgs_bottom);
+ if (IS_ERR(th))
+ GOTO(out_put, rc = PTR_ERR(th));
+
+ th->th_sync = 1; /* update table synchronously */
+ rc = dt_declare_record_write(env, fsdb, buf.lb_len, off, th);
+ if (rc)
+ GOTO(out, rc);
+
+ rc = dt_trans_start_local(env, mgs->mgs_bottom, th);
+ if (rc)
+ GOTO(out, rc);
+
+ version = cpu_to_le64(tbl->mn_version);
+ rc = dt_record_write(env, fsdb, &buf, &off, th);
+
+out:
+ dt_trans_stop(env, mgs->mgs_bottom, th);
+out_put:
+ lu_object_put(env, &fsdb->do_lu);
+ RETURN(rc);