Whamcloud - gitweb
b=5150
authoralex <alex>
Tue, 9 Nov 2004 11:30:21 +0000 (11:30 +0000)
committeralex <alex>
Tue, 9 Nov 2004 11:30:21 +0000 (11:30 +0000)
- mds_connect_post() to maintain number of llite clients

lustre/include/linux/obd.h
lustre/include/linux/obd_class.h
lustre/ldlm/ldlm_lib.c
lustre/mds/handler.c
lustre/obdfilter/filter.c

index 4cf2769..c9cc688 100644 (file)
@@ -680,7 +680,7 @@ struct obd_ops {
         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,
index dd05896..6a2a682 100644 (file)
@@ -673,7 +673,7 @@ static inline int obd_connect(struct lustre_handle *conn,
         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;
@@ -682,7 +682,7 @@ static inline int obd_connect_post(struct obd_export *exp)
         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);
 }
 
index d0e2466..f384e96 100644 (file)
@@ -727,7 +727,7 @@ int target_handle_connect(struct ptlrpc_request *req)
         revimp->imp_state = LUSTRE_IMP_FULL;
         class_import_put(revimp);
 
-        rc = obd_connect_post(export);
+        rc = obd_connect_post(export, connect_flags);
 out:
         if (rc)
                 req->rq_status = rc;
index d827236..6b72a31 100644 (file)
@@ -396,8 +396,25 @@ static int mds_connect(struct lustre_handle *conn, struct obd_device *obd,
         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",
@@ -408,17 +425,8 @@ static int mds_connect(struct lustre_handle *conn, struct obd_device *obd,
                 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;
@@ -2976,6 +2984,7 @@ static struct obd_ops mds_obd_ops = {
         .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,
index 3e5d9f6..04b941e 100644 (file)
@@ -1629,7 +1629,7 @@ static int filter_cleanup(struct obd_device *obd, int flags)
         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;