struct thandle *th;
int rc;
+ if (osp->opd_storage->dd_rdonly)
+ RETURN(0);
+
th = dt_trans_create(env, osp->opd_storage);
if (IS_ERR(th))
RETURN(PTR_ERR(th));
LASSERT(osp->opd_connect_mdt);
+ if (osp->opd_storage->dd_rdonly)
+ RETURN(0);
+
OBD_ALLOC_PTR(osp->opd_update);
if (osp->opd_update == NULL)
RETURN(-ENOMEM);
if (!osp->opd_connect_mdt) {
/* Initialize last id from the storage - will be
* used in orphan cleanup. */
- rc = osp_last_used_init(env, osp);
- if (rc)
- GOTO(out_fid, rc);
-
+ if (!osp->opd_storage->dd_rdonly) {
+ rc = osp_last_used_init(env, osp);
+ if (rc)
+ GOTO(out_fid, rc);
+ }
/* Initialize precreation thread, it handles new
* connections as well. */