int (*o_del_conn)(struct obd_import *imp, struct obd_uuid *uuid);
int (*o_connect)(struct lustre_handle *conn, struct obd_device *src,
struct obd_uuid *cluuid, unsigned long connect_flags);
- int (*o_connect_post)(struct obd_export *exp);
+ int (*o_connect_post)(struct obd_export *exp, unsigned long connect_flags);
int (*o_disconnect)(struct obd_export *exp, int flags);
int (*o_statfs)(struct obd_device *obd, struct obd_statfs *osfs,
RETURN(rc);
}
-static inline int obd_connect_post(struct obd_export *exp)
+static inline int obd_connect_post(struct obd_export *exp, unsigned long flags)
{
int rc;
ENTRY;
if (!OBT(exp->exp_obd) || !OBP((exp->exp_obd), connect_post))
RETURN(0);
OBD_COUNTER_INCREMENT(exp->exp_obd, connect_post);
- rc = OBP(exp->exp_obd, connect_post)(exp);
+ rc = OBP(exp->exp_obd, connect_post)(exp, flags);
RETURN(rc);
}
if (rc)
GOTO(out, rc);
+ EXIT;
+out:
+ if (rc) {
+ OBD_FREE(mcd, sizeof(*mcd));
+ class_disconnect(exp, 0);
+ }
+ class_export_put(exp);
+
+ return rc;
+}
+
+static int mds_connect_post(struct obd_export *exp, unsigned long connect_flags)
+{
+ struct obd_device *obd = exp->exp_obd;
+ struct mds_obd *mds = &obd->u.mds;
+ int rc = 0;
+ ENTRY;
+
if (!(connect_flags & OBD_OPT_MDS_CONNECTION)) {
- struct mds_obd *mds = &obd->u.mds;
if (!(exp->exp_flags & OBD_OPT_REAL_CLIENT)) {
atomic_inc(&mds->mds_real_clients);
CDEBUG(D_OTHER,"%s: peer from %s is real client (%d)\n",
if (mds->mds_lmv_name)
rc = mds_lmv_connect(obd, mds->mds_lmv_name);
}
- EXIT;
-out:
- if (rc) {
- OBD_FREE(mcd, sizeof(*mcd));
- class_disconnect(exp, 0);
- }
- class_export_put(exp);
-
- return rc;
+ RETURN(rc);
}
-
static int mds_init_export(struct obd_export *exp)
{
struct mds_export_data *med = &exp->exp_mds_data;
.o_attach = mds_attach,
.o_detach = mds_detach,
.o_connect = mds_connect,
+ .o_connect_post = mds_connect_post,
.o_init_export = mds_init_export,
.o_destroy_export = mds_destroy_export,
.o_disconnect = mds_disconnect,
RETURN(0);
}
-static int filter_connect_post(struct obd_export *exp)
+static int filter_connect_post(struct obd_export *exp, unsigned long connect_flags)
{
struct obd_device *obd = exp->exp_obd;
struct filter_export_data *fed;