Whamcloud - gitweb
Branch b1_8_gate
authoradilger <adilger>
Fri, 5 Sep 2008 06:09:53 +0000 (06:09 +0000)
committeradilger <adilger>
Fri, 5 Sep 2008 06:09:53 +0000 (06:09 +0000)
Wrap at 80 columns.  Remove whitespace.

lustre/obdclass/obd_config.c

index d35488c..467fe4d 100644 (file)
@@ -64,15 +64,15 @@ int class_find_param(char *buf, char *key, char **valp)
 {
         char *ptr;
 
-        if (!buf) 
+        if (!buf)
                 return 1;
 
-        if ((ptr = strstr(buf, key)) == NULL) 
+        if ((ptr = strstr(buf, key)) == NULL)
                 return 1;
 
-        if (valp) 
+        if (valp)
                 *valp = ptr + strlen(key);
-        
+
         return 0;
 }
 
@@ -80,19 +80,19 @@ int class_find_param(char *buf, char *key, char **valp)
    valp points to first char after key. */
 int class_match_param(char *buf, char *key, char **valp)
 {
-        if (!buf) 
+        if (!buf)
                 return 1;
 
-        if (memcmp(buf, key, strlen(key)) != 0) 
+        if (memcmp(buf, key, strlen(key)) != 0)
                 return 1;
 
-        if (valp) 
+        if (valp)
                 *valp = buf + strlen(key);
-        
+
         return 0;
 }
 
-/* 0 is good nid, 
+/* 0 is good nid,
    1 not found
    < 0 error
    endh is set to next separator */
@@ -100,16 +100,16 @@ int class_parse_nid(char *buf, lnet_nid_t *nid, char **endh)
 {
         char tmp, *endp;
 
-        if (!buf) 
+        if (!buf)
                 return 1;
-        while (*buf == ',' || *buf == ':') 
+        while (*buf == ',' || *buf == ':')
                 buf++;
-        if (*buf == ' ' || *buf == '/' || *buf == '\0') 
+        if (*buf == ' ' || *buf == '/' || *buf == '\0')
                 return 1;
 
         /* nid separators or end of nids */
         endp = strpbrk(buf, ",: /");
-        if (endp == NULL) 
+        if (endp == NULL)
                 endp = buf + strlen(buf);
 
         tmp = *endp;
@@ -122,7 +122,7 @@ int class_parse_nid(char *buf, lnet_nid_t *nid, char **endh)
         }
         *endp = tmp;
 
-        if (endh) 
+        if (endh)
                 *endh = endp;
         CDEBUG(D_INFO, "Nid %s\n", libcfs_nid2str(*nid));
         return 0;
@@ -196,11 +196,11 @@ int class_attach(struct lustre_cfg *lcfg)
         }
         LASSERTF(obd != NULL, "Cannot get obd device %s of type %s\n",
                  name, typename);
-        LASSERTF(obd->obd_magic == OBD_DEVICE_MAGIC, 
+        LASSERTF(obd->obd_magic == OBD_DEVICE_MAGIC,
                  "obd %p obd_magic %08X != %08X\n",
                  obd, obd->obd_magic, OBD_DEVICE_MAGIC);
-        LASSERTF(strncmp(obd->obd_name, name, strlen(name)) == 0, "%p obd_name %s != %s\n",
-                 obd, obd->obd_name, name);
+        LASSERTF(strncmp(obd->obd_name, name, strlen(name)) == 0,
+                 "%p obd_name %s != %s\n", obd, obd->obd_name, name);
 
         rwlock_init(&obd->obd_pool_lock);
         obd->obd_pool_limit = 0;
@@ -266,9 +266,11 @@ int class_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
         ENTRY;
 
         LASSERT(obd != NULL);
-        LASSERTF(obd == class_num2obd(obd->obd_minor), "obd %p != obd_devs[%d] %p\n", 
+        LASSERTF(obd == class_num2obd(obd->obd_minor),
+                 "obd %p != obd_devs[%d] %p\n",
                  obd, obd->obd_minor, class_num2obd(obd->obd_minor));
-        LASSERTF(obd->obd_magic == OBD_DEVICE_MAGIC, "obd %p obd_magic %08x != %08x\n", 
+        LASSERTF(obd->obd_magic == OBD_DEVICE_MAGIC,
+                 "obd %p obd_magic %08x != %08x\n",
                  obd, obd->obd_magic, OBD_DEVICE_MAGIC);
 
         /* have we attached a type to this device? */
@@ -433,7 +435,7 @@ int class_cleanup(struct obd_device *obd, struct lustre_cfg *lcfg)
                                 obd->obd_force = 1;
                                 break;
                         case 'A':
-                                LCONSOLE_WARN("Failing over %s\n", 
+                                LCONSOLE_WARN("Failing over %s\n",
                                               obd->obd_name);
                                 obd->obd_fail = 1;
                                 obd->obd_no_transno = 1;
@@ -453,7 +455,7 @@ int class_cleanup(struct obd_device *obd, struct lustre_cfg *lcfg)
         /* The three references that should be remaining are the
          * obd_self_export and the attach and setup references. */
         if (atomic_read(&obd->obd_refcount) > 3) {
-#if 0           /* We should never fail to cleanup with mountconf */ 
+#if 0           /* We should never fail to cleanup with mountconf */
                 if (!(obd->obd_fail || obd->obd_force)) {
                         CERROR("OBD %s is still busy with %d references\n"
                                "You should stop active file system users,"
@@ -465,7 +467,7 @@ int class_cleanup(struct obd_device *obd, struct lustre_cfg *lcfg)
                         RETURN(-EBUSY);
                 }
 #endif
-                /* refcounf - 3 might be the number of real exports 
+                /* refcounf - 3 might be the number of real exports
                    (excluding self export). But class_incref is called
                    by other things as well, so don't count on it. */
                 CDEBUG(D_IOCTL, "%s: forcing exports to disconnect: %d\n",
@@ -574,7 +576,7 @@ int class_add_conn(struct obd_device *obd, struct lustre_cfg *lcfg)
                 RETURN(-EINVAL);
         }
         if (strcmp(obd->obd_type->typ_name, LUSTRE_MDC_NAME) &&
-            strcmp(obd->obd_type->typ_name, LUSTRE_OSC_NAME) && 
+            strcmp(obd->obd_type->typ_name, LUSTRE_OSC_NAME) &&
             strcmp(obd->obd_type->typ_name, LUSTRE_MGC_NAME)) {
                 CERROR("can't add connection on non-client dev\n");
                 RETURN(-EINVAL);
@@ -704,7 +706,7 @@ out:
                 OBD_FREE(lprof->lp_osc, osclen);
         if (lprof->lp_profile)
                 OBD_FREE(lprof->lp_profile, proflen);
-        OBD_FREE(lprof, sizeof(*lprof));        
+        OBD_FREE(lprof, sizeof(*lprof));
         RETURN(err);
 }
 
@@ -825,7 +827,7 @@ int class_process_config(struct lustre_cfg *lcfg)
         }
         case LCFG_PARAM: {
                 /* llite has no obd */
-                if ((class_match_param(lustre_cfg_string(lcfg, 1), 
+                if ((class_match_param(lustre_cfg_string(lcfg, 1),
                                        PARAM_LLITE, 0) == 0) &&
                     client_process_config) {
                         err = (*client_process_config)(lcfg);
@@ -903,14 +905,14 @@ int class_process_config(struct lustre_cfg *lcfg)
         }
 out:
         if ((err < 0) && !(lcfg->lcfg_command & LCFG_REQUIRED)) {
-                CWARN("Ignoring error %d on optional command %#x\n", err, 
+                CWARN("Ignoring error %d on optional command %#x\n", err,
                       lcfg->lcfg_command);
                 err = 0;
         }
         return err;
 }
 
-int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars, 
+int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars,
                              struct lustre_cfg *lcfg, void *data)
 {
 #ifdef __KERNEL__
@@ -958,26 +960,26 @@ int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars,
                                                                vallen, data);
                                         set_fs(oldfs);
                                 }
-                                if (rc < 0) 
-                                        CERROR("writing proc entry %s err %d\n", 
+                                if (rc < 0)
+                                        CERROR("writing proc entry %s err %d\n",
                                                var->name, rc);
                                 break;
                         }
                         j++;
-                }    
+                }
                 if (!matched) {
                         CERROR("%s: unknown param %s\n",
                                (char *)lustre_cfg_string(lcfg, 0), key);
                         /* rc = -EINVAL;       continue parsing other params */
                 } else {
-                        LCONSOLE_INFO("%s.%.*s: set parameter %.*s=%s\n", 
-                                      (char *)lustre_cfg_string(lcfg, 0),
+                        LCONSOLE_INFO("%s.%.*s: set parameter %.*s=%s\n",
+                                      lustre_cfg_string(lcfg, 0),
                                       (int)strlen(prefix) - 1, prefix,
                                       (int)(sval - key - 1), key, sval);
                 }
         }
-        
-        if (rc > 0) 
+
+        if (rc > 0)
                 rc = 0;
         RETURN(rc);
 #else
@@ -1004,7 +1006,7 @@ static int class_config_llog_handler(struct llog_handle * handle,
         char *cfg_buf = (char*) (rec + 1);
         int rc = 0;
         ENTRY;
-        
+
         //class_config_dump_handler(handle, rec, data);
 
         switch (rec->lrh_type) {
@@ -1035,12 +1037,12 @@ static int class_config_llog_handler(struct llog_handle * handle,
                         if (marker->cm_flags & CM_START) {
                                 /* all previous flags off */
                                 clli->cfg_flags = CFG_F_MARKER;
-                                if (marker->cm_flags & CM_SKIP) { 
+                                if (marker->cm_flags & CM_SKIP) {
                                         clli->cfg_flags |= CFG_F_SKIP;
                                         CDEBUG(D_CONFIG, "SKIP #%d\n",
                                                marker->cm_step);
                                 } else if ((marker->cm_flags & CM_EXCLUDE) ||
-                                           lustre_check_exclusion(clli->cfg_sb, 
+                                           lustre_check_exclusion(clli->cfg_sb,
                                                           marker->cm_tgtname)) {
                                         clli->cfg_flags |= CFG_F_EXCLUDE;
                                         CDEBUG(D_CONFIG, "EXCLUDE %d\n",
@@ -1050,12 +1052,12 @@ static int class_config_llog_handler(struct llog_handle * handle,
                                 clli->cfg_flags = 0;
                         }
                 }
-                /* A config command without a start marker before it is 
+                /* A config command without a start marker before it is
                    illegal (post 146) */
                 if (!(clli->cfg_flags & CFG_F_COMPAT146) &&
-                    !(clli->cfg_flags & CFG_F_MARKER) && 
+                    !(clli->cfg_flags & CFG_F_MARKER) &&
                     (lcfg->lcfg_command != LCFG_MARKER)) {
-                        CWARN("Config not inside markers, ignoring! (%#x)\n", 
+                        CWARN("Config not inside markers, ignoring! (%#x)\n",
                               clli->cfg_flags);
                         clli->cfg_flags |= CFG_F_SKIP;
                 }
@@ -1088,14 +1090,14 @@ static int class_config_llog_handler(struct llog_handle * handle,
                         }
                 }
 
-                if ((clli->cfg_flags & CFG_F_EXCLUDE) && 
+                if ((clli->cfg_flags & CFG_F_EXCLUDE) &&
                     (lcfg->lcfg_command == LCFG_LOV_ADD_OBD))
                         /* Add inactive instead */
                         lcfg->lcfg_command = LCFG_LOV_ADD_INA;
 
                 lustre_cfg_bufs_init(&bufs, lcfg);
 
-                if (clli && clli->cfg_instance && 
+                if (clli && clli->cfg_instance &&
                     LUSTRE_CFG_BUFLEN(lcfg, 0) > 0){
                         inst = 1;
                         inst_len = LUSTRE_CFG_BUFLEN(lcfg, 0) +
@@ -1107,13 +1109,13 @@ static int class_config_llog_handler(struct llog_handle * handle,
                                 lustre_cfg_string(lcfg, 0),
                                 clli->cfg_instance);
                         lustre_cfg_bufs_set_string(&bufs, 0, inst_name);
-                        CDEBUG(D_CONFIG, "cmd %x, instance name: %s\n", 
+                        CDEBUG(D_CONFIG, "cmd %x, instance name: %s\n",
                                lcfg->lcfg_command, inst_name);
                 }
 
                 /* we override the llog's uuid for clients, to insure they
                 are unique */
-                if (clli && clli->cfg_instance && 
+                if (clli && clli->cfg_instance &&
                     lcfg->lcfg_command == LCFG_ATTACH) {
                         lustre_cfg_bufs_set_string(&bufs, 2,
                                                    clli->cfg_uuid.uuid);
@@ -1185,7 +1187,7 @@ int class_config_parse_llog(struct llog_ctxt *ctxt, char *name,
 
         rc = llog_process(llh, class_config_llog_handler, cfg, &cd);
 
-        CDEBUG(D_CONFIG, "Processed log %s gen %d-%d (rc=%d)\n", name, 
+        CDEBUG(D_CONFIG, "Processed log %s gen %d-%d (rc=%d)\n", name,
                cd.lpcd_first_idx + 1, cd.lpcd_last_idx, rc);
         if (cfg)
                 cfg->cfg_last_idx = cd.lpcd_last_idx;
@@ -1240,7 +1242,7 @@ int class_config_dump_handler(struct llog_handle * handle,
                 if (lcfg->lcfg_command == LCFG_MARKER) {
                         struct cfg_marker *marker = lustre_cfg_buf(lcfg, 1);
                         ptr += snprintf(ptr, end-ptr, "marker=%d(%#x)%s '%s'",
-                                        marker->cm_step, marker->cm_flags, 
+                                        marker->cm_step, marker->cm_flags,
                                         marker->cm_tgtname, marker->cm_comment);
                 } else {
                         for (i = 0; i <  lcfg->lcfg_bufcount; i++) {