+ } else {
+ fid->f_seq = 0;
+ osp_objseq_buf_prep(&osi->osi_lb, &osi->osi_off, &fid->f_seq,
+ osp->opd_index);
+ rc = osp_write_local_file(env, osp, dto, &osi->osi_lb,
+ osi->osi_off);
+ }
+ osp->opd_last_used_seq_file = dto;
+ RETURN(0);
+out:
+ /* object will be released in device cleanup path */
+ CERROR("%s: can't initialize lov_seq: rc = %d\n",
+ osp->opd_obd->obd_name, rc);
+ lu_object_put(env, &dto->do_lu);
+ osp->opd_last_used_seq_file = NULL;
+ RETURN(rc);
+}
+
+static int osp_last_used_init(const struct lu_env *env, struct osp_device *osp)
+{
+ struct osp_thread_info *osi = osp_env_info(env);
+ int rc;
+ ENTRY;
+
+ fid_zero(&osp->opd_last_used_fid);
+ rc = osp_init_last_objid(env, osp);
+ if (rc < 0) {
+ CERROR("%s: Can not get ids %d from old objid!\n",
+ osp->opd_obd->obd_name, rc);
+ RETURN(rc);
+ }
+
+ rc = osp_init_last_seq(env, osp);
+ if (rc < 0) {
+ CERROR("%s: Can not get ids %d from old objid!\n",
+ osp->opd_obd->obd_name, rc);
+ GOTO(out, rc);
+ }