* \retval negative value on error
*/
static int ofd_stack_init(const struct lu_env *env,
- struct ofd_device *m, struct lustre_cfg *cfg)
+ struct ofd_device *m, struct lustre_cfg *cfg,
+ u32 *lmd_flags)
{
const char *dev = lustre_cfg_string(cfg, 0);
struct lu_device *d;
}
lmd = s2lsi(lmi->lmi_sb)->lsi_lmd;
- if (lmd != NULL && lmd->lmd_flags & LMD_FLG_SKIP_LFSCK)
- m->ofd_skip_lfsck = 1;
+ if (lmd) {
+ if (lmd->lmd_flags & LMD_FLG_SKIP_LFSCK)
+ m->ofd_skip_lfsck = 1;
+ if (lmd->lmd_flags & LMD_FLG_NO_PRECREATE)
+ m->ofd_no_precreate = 1;
+ *lmd_flags = lmd->lmd_flags;
+ }
/* find bottom osd */
OBD_ALLOC(osdname, MTI_NAME_MAXLEN);
RETURN(rc);
}
+static void ofd_object_free_rcu(struct rcu_head *head)
+{
+ struct ofd_object *of = container_of(head, struct ofd_object,
+ ofo_header.loh_rcu);
+
+ kmem_cache_free(ofd_object_kmem, of);
+}
+
/**
* Implementation of lu_object_operations::loo_object_free.
*
lu_object_fini(o);
lu_object_header_fini(h);
- OBD_SLAB_FREE_PTR(of, ofd_object_kmem);
+ OBD_FREE_PRE(of, sizeof(*of), "slab-freed");
+ call_rcu(&of->ofo_header.loh_rcu, ofd_object_free_rcu);
EXIT;
}
if (OBD_FAIL_CHECK(OBD_FAIL_OST_EROFS))
RETURN(-EROFS);
+ if (ofd->ofd_no_precreate)
+ return -EPERM;
+
repbody = req_capsule_server_get(tsi->tsi_pill, &RMF_OST_BODY);
if (repbody == NULL)
RETURN(-ENOMEM);
out:
mutex_unlock(&oseq->os_create_lock);
out_nolock:
- if (rc == 0) {
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 8, 53, 0)
- struct ofd_thread_info *info = ofd_info(tsi->tsi_env);
- struct lu_fid *fid = &info->fti_fid;
-
- /* For compatible purpose, it needs to convert back to
- * OST ID before put it on wire. */
- *fid = rep_oa->o_oi.oi_fid;
- fid_to_ostid(fid, &rep_oa->o_oi);
-#endif
+ if (rc == 0)
rep_oa->o_valid |= OBD_MD_FLID | OBD_MD_FLGROUP;
- }
ofd_seq_put(tsi->tsi_env, oseq);
out_sem:
struct lu_fid fid;
struct nm_config_file *nodemap_config;
struct obd_device_target *obt;
+ u32 lmd_flags = 0;
int rc;
ENTRY;
if (info == NULL)
RETURN(-EFAULT);
- rc = ofd_stack_init(env, m, cfg);
+ rc = ofd_stack_init(env, m, cfg, &lmd_flags);
if (rc) {
CERROR("%s: can't init device stack, rc %d\n",
obd->obd_name, rc);
if (rc)
GOTO(err_free_ns, rc);
+ if (lmd_flags & LMD_FLG_SKIP_LFSCK)
+ m->ofd_skip_lfsck = 1;
+ if (lmd_flags & LMD_FLG_LOCAL_RECOV)
+ m->ofd_lut.lut_local_recovery = 1;
+
rc = ofd_tunables_init(m);
if (rc)
GOTO(err_fini_lut, rc);