- /*
- * XXX: In fact here would be nice to protect cmm->cmm_targets but we
- * can't use spinlock here and do something complex is no time for that,
- * especially taking into account that split will be removed after
- * acceptance. So we suppose no changes to targets should happen this
- * time.
- */
- list_for_each_entry_safe(mc, tmp, &cmm->cmm_targets, mc_linkage) {
- /* Allocate slave fid on mds @mc->mc_num. */
- rc = obd_fid_alloc(mc->mc_desc.cl_exp, &fids[mc->mc_num], NULL);
- if (rc > 0) {
- rc = fld_client_create(ls->ls_client_fld,
- fid_seq(&fids[mc->mc_num]),
- mc->mc_num, env);
- if (rc) {
- CERROR("Can't create fld entry, "
- "rc %d\n", rc);
- }
- } else if (rc < 0) {
- RETURN(rc);
- }
- }
- RETURN(rc);
-}
-#else
-static int cmm_slave_fids_alloc(const struct lu_env *env,
- struct cmm_device *cmm,
- struct lu_fid *fids)
-{
- struct mdc_device *mc, *tmp;
- int rc = 0, i = 0;
-
- /*
- * XXX: In fact here would be nice to protect cmm->cmm_targets but we
- * can't use spinlock here and do something complex is no time for that,
- * especially taking into account that split will be removed after
- * acceptance. So we suppose no changes to targets should happen this
- * time.
- */
- list_for_each_entry_safe(mc, tmp, &cmm->cmm_targets, mc_linkage) {
- /* Allocate slave fid on mds @mc->mc_num. */
- rc = obd_fid_alloc(mc->mc_desc.cl_exp, &fids[i], NULL);
- if (rc > 0) {
- struct lu_site *ls;
-
- ls = cmm->cmm_md_dev.md_lu_dev.ld_site;
- rc = fld_client_create(ls->ls_client_fld,
- fid_seq(&fids[i]),
- mc->mc_num, env);
- if (rc)
- CERROR("Can't create fld entry, rc %d\n", rc);
-
- }
-
- if (rc < 0)
- break;
- i++;
- }
- RETURN(rc);
-}
-#endif