]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/staging/lustre/lustre/ptlrpc/sec_config.c
staging: lustre: remove RETURN macro
[karo-tx-linux.git] / drivers / staging / lustre / lustre / ptlrpc / sec_config.c
index a45a3929b59f5a65323e46139ee6b8ea3306e461..6cc3f23c27ccff4b44ba013cabeeec4b53391db1 100644 (file)
@@ -195,7 +195,7 @@ int sptlrpc_parse_rule(char *param, struct sptlrpc_rule *rule)
        flavor = strchr(param, '=');
        if (flavor == NULL) {
                CERROR("invalid param, no '='\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
        *flavor++ = '\0';
 
@@ -208,7 +208,7 @@ int sptlrpc_parse_rule(char *param, struct sptlrpc_rule *rule)
                rule->sr_netid = libcfs_str2net(param);
                if (rule->sr_netid == LNET_NIDNET(LNET_NID_ANY)) {
                        CERROR("invalid network name: %s\n", param);
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
        }
 
@@ -228,16 +228,16 @@ int sptlrpc_parse_rule(char *param, struct sptlrpc_rule *rule)
                        rule->sr_to = LUSTRE_SP_MDT;
                } else {
                        CERROR("invalid rule dir segment: %s\n", dir);
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
        }
 
        /* 2.1 flavor */
        rc = sptlrpc_parse_flavor(flavor, &rule->sr_flvr);
        if (rc)
-               RETURN(-EINVAL);
+               return -EINVAL;
 
-       RETURN(0);
+       return 0;
 }
 EXPORT_SYMBOL(sptlrpc_parse_rule);
 
@@ -661,18 +661,17 @@ static int __sptlrpc_process_config(struct lustre_cfg *lcfg,
        char                fsname[MTI_NAME_MAXLEN];
        struct sptlrpc_rule     rule;
        int                  rc;
-       ENTRY;
 
        target = lustre_cfg_string(lcfg, 1);
        if (target == NULL) {
                CERROR("missing target name\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        param = lustre_cfg_string(lcfg, 2);
        if (param == NULL) {
                CERROR("missing parameter\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        CDEBUG(D_SEC, "processing rule: %s.%s\n", target, param);
@@ -680,13 +679,13 @@ static int __sptlrpc_process_config(struct lustre_cfg *lcfg,
        /* parse rule to make sure the format is correct */
        if (strncmp(param, PARAM_SRPC_FLVR, sizeof(PARAM_SRPC_FLVR) - 1) != 0) {
                CERROR("Invalid sptlrpc parameter: %s\n", param);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
        param += sizeof(PARAM_SRPC_FLVR) - 1;
 
        rc = sptlrpc_parse_rule(param, &rule);
        if (rc)
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        if (conf == NULL) {
                target2fsname(target, fsname, sizeof(fsname));
@@ -708,7 +707,7 @@ static int __sptlrpc_process_config(struct lustre_cfg *lcfg,
        if (rc == 0)
                conf->sc_modified++;
 
-       RETURN(rc);
+       return rc;
 }
 
 int sptlrpc_process_config(struct lustre_cfg *lcfg)
@@ -905,7 +904,6 @@ EXPORT_SYMBOL(sptlrpc_target_choose_flavor);
 void sptlrpc_conf_client_adapt(struct obd_device *obd)
 {
        struct obd_import  *imp;
-       ENTRY;
 
        LASSERT(strcmp(obd->obd_type->typ_name, LUSTRE_MDC_NAME) == 0 ||
                strcmp(obd->obd_type->typ_name, LUSTRE_OSC_NAME) ==0);
@@ -924,7 +922,6 @@ void sptlrpc_conf_client_adapt(struct obd_device *obd)
        }
 
        up_read(&obd->u.cli.cl_sem);
-       EXIT;
 }
 EXPORT_SYMBOL(sptlrpc_conf_client_adapt);
 
@@ -1011,11 +1008,10 @@ int sptlrpc_target_local_copy_conf(struct obd_device *obd,
        struct lvfs_run_ctxt  saved;
        struct dentry   *dentry;
        int                rc;
-       ENTRY;
 
        ctxt = llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT);
        if (ctxt == NULL)
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
 
@@ -1058,7 +1054,7 @@ out_ctx:
        llog_ctxt_put(ctxt);
        CDEBUG(D_SEC, "target %s: write local sptlrpc conf: rc = %d\n",
               obd->obd_name, rc);
-       RETURN(rc);
+       return rc;
 }
 
 static int local_read_handler(const struct lu_env *env,
@@ -1068,11 +1064,10 @@ static int local_read_handler(const struct lu_env *env,
        struct sptlrpc_conf  *conf = (struct sptlrpc_conf *) data;
        struct lustre_cfg    *lcfg = (struct lustre_cfg *)(rec + 1);
        int                cfg_len, rc;
-       ENTRY;
 
        if (rec->lrh_type != OBD_CFG_REC) {
                CERROR("unhandled lrh_type: %#x\n", rec->lrh_type);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        cfg_len = rec->lrh_len - sizeof(struct llog_rec_hdr) -
@@ -1081,15 +1076,15 @@ static int local_read_handler(const struct lu_env *env,
        rc = lustre_cfg_sanity_check(lcfg, cfg_len);
        if (rc) {
                CERROR("Insane cfg\n");
-               RETURN(rc);
+               return rc;
        }
 
        if (lcfg->lcfg_command != LCFG_SPTLRPC_CONF) {
                CERROR("invalid command (%x)\n", lcfg->lcfg_command);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
-       RETURN(__sptlrpc_process_config(lcfg, conf));
+       return __sptlrpc_process_config(lcfg, conf);
 }
 
 static
@@ -1100,14 +1095,13 @@ int sptlrpc_target_local_read_conf(struct obd_device *obd,
        struct llog_ctxt      *ctxt;
        struct lvfs_run_ctxt   saved;
        int                 rc;
-       ENTRY;
 
        LASSERT(conf->sc_updated == 0 && conf->sc_local == 0);
 
        ctxt = llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT);
        if (ctxt == NULL) {
                CERROR("missing llog context\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
@@ -1143,7 +1137,7 @@ out_pop:
        llog_ctxt_put(ctxt);
        CDEBUG(D_SEC, "target %s: read local sptlrpc conf: rc = %d\n",
               obd->obd_name, rc);
-       RETURN(rc);
+       return rc;
 }
 
 
@@ -1160,7 +1154,6 @@ int sptlrpc_conf_target_get_rules(struct obd_device *obd,
        enum lustre_sec_part      sp_dst;
        char                  fsname[MTI_NAME_MAXLEN];
        int                    rc = 0;
-       ENTRY;
 
        if (strcmp(obd->obd_type->typ_name, LUSTRE_MDT_NAME) == 0) {
                sp_dst = LUSTRE_SP_MDT;
@@ -1168,7 +1161,7 @@ int sptlrpc_conf_target_get_rules(struct obd_device *obd,
                sp_dst = LUSTRE_SP_OST;
        } else {
                CERROR("unexpected obd type %s\n", obd->obd_type->typ_name);
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
        CDEBUG(D_SEC, "get rules for target %s\n", obd->obd_uuid.uuid);
 
@@ -1210,7 +1203,7 @@ int sptlrpc_conf_target_get_rules(struct obd_device *obd,
                                      LUSTRE_SP_ANY, sp_dst, rset);
 out:
        mutex_unlock(&sptlrpc_conf_lock);
-       RETURN(rc);
+       return rc;
 }
 EXPORT_SYMBOL(sptlrpc_conf_target_get_rules);