Whamcloud - gitweb
make unified LCFG_ADD_MDC/DEL_MDC for adding mdc to lmv/cmm, fix bug with
authortappro <tappro>
Wed, 19 Apr 2006 17:41:40 +0000 (17:41 +0000)
committertappro <tappro>
Wed, 19 Apr 2006 17:41:40 +0000 (17:41 +0000)
name_destroy w/o name_create, add process_config to cmm

lustre/cmm/cmm_device.c
lustre/include/linux/lustre_cfg.h
lustre/mgs/mgs_llog.c
lustre/utils/llog_reader.c

index 982a057..c214011 100644 (file)
@@ -83,17 +83,18 @@ static struct lu_device *cmm_device_fini(struct lu_device *d)
         return next;
 }
 
-static int cmm_device_config(struct lu_device *d, struct lustre_cfg *cfg) 
+static int cmm_process_config(struct lu_device *d, struct lustre_cfg *cfg) 
 {
         struct cmm_device *m = lu2cmm_dev(d);
+        struct lu_device *next = md2lu_dev(m->cmm_child);
         int err;
 
         switch(cfg->lcfg_command) {
-        case LCFG_CMM_ADD_MDC:
+        case LCFG_ADD_MDC:
                 err = cmm_add_mdc(m, cfg);
                 break;
         default:
-                err = -EOPNOTSUPP;
+                err = next->ld_ops->ldo_process_config(next, cfg);
         }
 out:
         RETURN(err);
@@ -105,7 +106,9 @@ static struct lu_device_operations cmm_lu_ops = {
        .ldo_object_init    = cmm_object_init,
        .ldo_object_free    = cmm_object_free,
        .ldo_object_release = cmm_object_release,
-       .ldo_object_print   = cmm_object_print
+       .ldo_object_print   = cmm_object_print,
+
+        .ldo_process_config = cmm_process_config
 };
 
 struct lu_device *cmm_device_alloc(struct lu_device_type *t,
@@ -157,8 +160,7 @@ static struct lu_device_type_operations cmm_device_type_ops = {
         .ldto_device_free  = cmm_device_free,
 
         .ldto_device_init = cmm_device_init,
-        .ldto_device_fini = cmm_device_fini,
-        .ldto_device_config = cmm_device_config
+        .ldto_device_fini = cmm_device_fini
 };
 
 static struct lu_device_type cmm_device_type = {
index f11326b..073ac8f 100644 (file)
@@ -56,10 +56,8 @@ enum lcfg_command_type {
         LCFG_LOG_START      = 0x00ce011,
         LCFG_LOG_END        = 0x00ce012,
         LCFG_LOV_ADD_INA    = 0x00ce013,
-        LCFG_LMV_ADD_MDC    = 0x00cf014,
-        LCFG_LMV_DEL_MDC    = 0x00cf015,
-        LCFG_CMM_ADD_MDC    = 0x00cf016,
-        LCFG_CMM_DEL_MDC    = 0x00cf017,
+        LCFG_ADD_MDC        = 0x00cf014,
+        LCFG_DEL_MDC        = 0x00cf015,
 };
 
 struct lustre_cfg_bufs {
index 66972c1..0a01b08 100644 (file)
@@ -608,7 +608,7 @@ static inline int record_lmv_add(struct obd_device *obd,
                                  char *lmv_name, char *mdt_uuid,
                                  char *index, char *gen)
 {
-        return record_base(obd,llh,lmv_name,0,LCFG_LMV_ADD_MDC,
+        return record_base(obd,llh,lmv_name,0,LCFG_ADD_MDC,
                            mdt_uuid,index,gen,0);
 }                                  
 
@@ -617,7 +617,7 @@ static inline int record_cmm_add(struct obd_device *obd,
                                  char *cmm_name, char *mdt_uuid,
                                  char *index, char *gen)
 {
-        return record_base(obd,llh,cmm_name,0,LCFG_CMM_ADD_MDC,
+        return record_base(obd,llh,cmm_name,0,LCFG_ADD_MDC,
                            mdt_uuid,index,gen,0);
 }                                  
 
@@ -960,7 +960,7 @@ static int mgs_steal_llog_handler(struct llog_handle *llh,
                 RETURN(rc);
         }
 
-        if (lcfg->lcfg_command == LCFG_LMV_ADD_MDC) {
+        if (lcfg->lcfg_command == LCFG_ADD_MDC) {
                 char *name;
                 char *uuid;
                 char *index;
@@ -1236,7 +1236,7 @@ static int mgs_write_log_mdc_to_mds(struct obd_device *obd, struct fs_db *fsdb,
         rc = record_setup(obd, llh, mdcname, mti->mti_uuid, nodeuuid, 0, 0);
         rc = mgs_write_log_failnids(obd, mti, llh, mdcname);
         snprintf(index, sizeof(index), "%d", mti->mti_stripe_index);
-        rc = record_base(obd, llh, tgtname, 0, LCFG_CMM_ADD_MDC, mdcuuid,
+        rc = record_base(obd, llh, tgtname, 0, LCFG_ADD_MDC, mdcuuid,
                          index, "1", 0);
         rc = record_marker(obd, llh, fsdb, CM_END, tgtname, "add mdc to cmm"); 
         rc = record_end_log(obd, &llh);
@@ -1279,8 +1279,7 @@ static int mgs_write_log_mds(struct obd_device *obd, struct fs_db *fsdb,
                               struct mgs_target_info *mti)
 {
         struct llog_handle *llh = NULL;
-        char *cliname, *osdname, *lovname, *mddname;
-        char *mdtname, *cmmname;// *lmvname;
+        char *cliname, *lovname, *mdtname;// *lmvname;
         char *mdcname, *nodeuuid, *mdcuuid;
         int rc, i = 0;//, first_log = 0;
         char mdt_index[9];
@@ -1297,8 +1296,6 @@ static int mgs_write_log_mds(struct obd_device *obd, struct fs_db *fsdb,
         /* add mdt */
         rc = mgs_write_log_mdt0(obd, fsdb, mti->mti_svname, mti->mti_svname, NULL);
         name_destroy(lovname);
-        name_destroy(osdname);
-        name_destroy(mddname);
         name_destroy(mdtname);
 
         /* copy client info about lov/lmv */
index 25ba0dd..7cf6a89 100644 (file)
@@ -321,23 +321,13 @@ void print_lustre_cfg(struct lustre_cfg *lcfg, int *skip)
                 print_1_cfg(lcfg);
                 break;
         }
-        case(LCFG_LMV_ADD_MDC):{
-                printf("lmv_modify_tgts add ");
+        case(LCFG_ADD_MDC):{
+                printf("modify_mdc_tgts add ");
                 print_1_cfg(lcfg);
                 break;
         }
-        case(LCFG_LMV_DEL_MDC):{
-                printf("lmv_modify_tgts del ");
-                print_1_cfg(lcfg);
-                break;
-        }
-        case(LCFG_CMM_ADD_MDC):{
-                printf("cmm_modify_tgts add ");
-                print_1_cfg(lcfg);
-                break;
-        }
-        case(LCFG_CMM_DEL_MDC):{
-                printf("cmm_modify_tgts del ");
+        case(LCFG_DEL_MDC):{
+                printf("modify_mdc_tgts del ");
                 print_1_cfg(lcfg);
                 break;
         }