Whamcloud - gitweb
LU-4690 lod: separate master object with master stripe
[fs/lustre-release.git] / lustre / osp / osp_dev.c
index 38d2de1..0a1cafa 100644 (file)
@@ -1158,14 +1158,20 @@ static int osp_obd_get_info(const struct lu_env *env, struct obd_export *exp,
        RETURN(rc);
 }
 
-int osp_fid_alloc(struct obd_export *exp, struct lu_fid *fid,
-                 struct md_op_data *op_data)
+int osp_fid_alloc(const struct lu_env *env, struct obd_export *exp,
+                 struct lu_fid *fid, struct md_op_data *op_data)
 {
-       struct client_obd *cli = &exp->exp_obd->u.cli;
-       struct lu_client_seq *seq = cli->cl_seq;
-
+       struct client_obd       *cli = &exp->exp_obd->u.cli;
+       struct osp_device       *osp = lu2osp_dev(exp->exp_obd->obd_lu_dev);
+       struct lu_client_seq    *seq = cli->cl_seq;
        ENTRY;
-       RETURN(seq_client_alloc_fid(NULL, seq, fid));
+
+       LASSERT(osp->opd_obd->u.cli.cl_seq != NULL);
+       /* Sigh, fid client is not ready yet */
+       if (osp->opd_obd->u.cli.cl_seq->lcs_exp == NULL)
+               RETURN(-ENOTCONN);
+
+       RETURN(seq_client_alloc_fid(env, seq, fid));
 }
 
 /* context key constructor/destructor: mdt_key_init, mdt_key_fini */