diff options
Diffstat (limited to 'drivers/staging/lustre/lustre/mgc')
-rw-r--r-- | drivers/staging/lustre/lustre/mgc/libmgc.c | 14 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/mgc/mgc_request.c | 120 |
2 files changed, 67 insertions, 67 deletions
diff --git a/drivers/staging/lustre/lustre/mgc/libmgc.c b/drivers/staging/lustre/lustre/mgc/libmgc.c index 412f5882225d..7b4947cec3a8 100644 --- a/drivers/staging/lustre/lustre/mgc/libmgc.c +++ b/drivers/staging/lustre/lustre/mgc/libmgc.c @@ -72,13 +72,13 @@ static int mgc_setup(struct obd_device *obd, struct lustre_cfg *lcfg) GOTO(err_cleanup, rc); } - RETURN(rc); + return rc; err_cleanup: client_obd_cleanup(obd); err_decref: ptlrpcd_decref(); - RETURN(rc); + return rc; } static int mgc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage) @@ -94,7 +94,7 @@ static int mgc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage) CERROR("failed to cleanup llogging subsystems\n"); break; } - RETURN(rc); + return rc; } static int mgc_cleanup(struct obd_device *obd) @@ -107,7 +107,7 @@ static int mgc_cleanup(struct obd_device *obd) ptlrpcd_decref(); rc = client_obd_cleanup(obd); - RETURN(rc); + return rc; } static int mgc_llog_init(struct obd_device *obd, struct obd_llog_group *olg, @@ -120,13 +120,13 @@ static int mgc_llog_init(struct obd_device *obd, struct obd_llog_group *olg, rc = llog_setup(NULL, obd, olg, LLOG_CONFIG_REPL_CTXT, tgt, &llog_client_ops); if (rc < 0) - RETURN(rc); + return rc; ctxt = llog_group_get_ctxt(olg, LLOG_CONFIG_REPL_CTXT); llog_initiator_connect(ctxt); llog_ctxt_put(ctxt); - RETURN(rc); + return rc; } static int mgc_llog_finish(struct obd_device *obd, int count) @@ -138,7 +138,7 @@ static int mgc_llog_finish(struct obd_device *obd, int count) if (ctxt) llog_cleanup(NULL, ctxt); - RETURN(0); + return 0; } struct obd_ops mgc_obd_ops = { diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c index 99a4099e2e0f..12a9ede21a85 100644 --- a/drivers/staging/lustre/lustre/mgc/mgc_request.c +++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c @@ -121,7 +121,7 @@ static int config_log_get(struct config_llog_data *cld) atomic_inc(&cld->cld_refcount); CDEBUG(D_INFO, "log %s refs %d\n", cld->cld_logname, atomic_read(&cld->cld_refcount)); - RETURN(0); + return 0; } /* Drop a reference to a config log. When no longer referenced, @@ -180,7 +180,7 @@ struct config_llog_data *config_log_find(char *logname, LASSERT(found->cld_stopping == 0 || cld_is_sptlrpc(found) == 0); } spin_unlock(&config_list_lock); - RETURN(found); + return found; } static @@ -198,7 +198,7 @@ struct config_llog_data *do_config_log_add(struct obd_device *obd, OBD_ALLOC(cld, sizeof(*cld) + strlen(logname) + 1); if (!cld) - RETURN(ERR_PTR(-ENOMEM)); + return ERR_PTR(-ENOMEM); strcpy(cld->cld_logname, logname); if (cfg) @@ -228,7 +228,7 @@ struct config_llog_data *do_config_log_add(struct obd_device *obd, if (rc) { config_log_put(cld); - RETURN(ERR_PTR(rc)); + return ERR_PTR(rc); } if (cld_is_sptlrpc(cld)) { @@ -237,7 +237,7 @@ struct config_llog_data *do_config_log_add(struct obd_device *obd, CERROR("failed processing sptlrpc log: %d\n", rc); } - RETURN(cld); + return cld; } static struct config_llog_data *config_recover_log_add(struct obd_device *obd, @@ -299,7 +299,7 @@ static int config_log_add(struct obd_device *obd, char *logname, ptr = strrchr(logname, '-'); if (ptr == NULL || ptr - logname > 8) { CERROR("logname %s is too long\n", logname); - RETURN(-EINVAL); + return -EINVAL; } memcpy(seclogname, logname, ptr - logname); @@ -311,7 +311,7 @@ static int config_log_add(struct obd_device *obd, char *logname, CONFIG_T_SPTLRPC, NULL, NULL); if (IS_ERR(sptlrpc_cld)) { CERROR("can't create sptlrpc log: %s\n", seclogname); - RETURN(PTR_ERR(sptlrpc_cld)); + return PTR_ERR(sptlrpc_cld); } } @@ -319,7 +319,7 @@ static int config_log_add(struct obd_device *obd, char *logname, if (IS_ERR(cld)) { CERROR("can't create log: %s\n", logname); config_log_put(sptlrpc_cld); - RETURN(PTR_ERR(cld)); + return PTR_ERR(cld); } cld->cld_sptlrpc = sptlrpc_cld; @@ -331,12 +331,12 @@ static int config_log_add(struct obd_device *obd, char *logname, recover_cld = config_recover_log_add(obd, seclogname, cfg, sb); if (IS_ERR(recover_cld)) { config_log_put(cld); - RETURN(PTR_ERR(recover_cld)); + return PTR_ERR(recover_cld); } cld->cld_recover = recover_cld; } - RETURN(0); + return 0; } DEFINE_MUTEX(llog_process_lock); @@ -352,7 +352,7 @@ static int config_log_end(char *logname, struct config_llog_instance *cfg) cld = config_log_find(logname, cfg); if (cld == NULL) - RETURN(-ENOENT); + return -ENOENT; mutex_lock(&cld->cld_lock); /* @@ -366,7 +366,7 @@ static int config_log_end(char *logname, struct config_llog_instance *cfg) mutex_unlock(&cld->cld_lock); /* drop the ref from the find */ config_log_put(cld); - RETURN(rc); + return rc; } cld->cld_stopping = 1; @@ -397,7 +397,7 @@ static int config_log_end(char *logname, struct config_llog_instance *cfg) CDEBUG(D_MGC, "end config log %s (%d)\n", logname ? logname : "client", rc); - RETURN(rc); + return rc; } int lprocfs_mgc_rd_ir_state(struct seq_file *m, void *data) @@ -421,7 +421,7 @@ int lprocfs_mgc_rd_ir_state(struct seq_file *m, void *data) } spin_unlock(&config_list_lock); - RETURN(0); + return 0; } /* reenqueue any lost locks */ @@ -542,7 +542,7 @@ static int mgc_requeue_thread(void *data) complete(&rq_exit); CDEBUG(D_MGC, "Ending requeue thread\n"); - RETURN(rc); + return rc; } /* Add a cld to the list to requeue. Start the requeue thread if needed. @@ -602,7 +602,7 @@ static int mgc_fs_setup(struct obd_device *obd, struct super_block *sb, up(&cli->cl_mgc_sem); CERROR("%s: No fstype %s: rc = %ld\n", lsi->lsi_fstype, obd->obd_name, PTR_ERR(obd->obd_fsops)); - RETURN(PTR_ERR(obd->obd_fsops)); + return PTR_ERR(obd->obd_fsops); } cli->cl_mgc_vfsmnt = mnt; @@ -636,14 +636,14 @@ static int mgc_fs_setup(struct obd_device *obd, struct super_block *sb, CDEBUG(D_MGC, "MGC using disk labelled=%s\n", label); /* We keep the cl_mgc_sem until mgc_fs_cleanup */ - RETURN(0); + return 0; err_ops: fsfilt_put_ops(obd->obd_fsops); obd->obd_fsops = NULL; cli->cl_mgc_vfsmnt = NULL; up(&cli->cl_mgc_sem); - RETURN(err); + return err; } static int mgc_fs_cleanup(struct obd_device *obd) @@ -668,7 +668,7 @@ static int mgc_fs_cleanup(struct obd_device *obd) up(&cli->cl_mgc_sem); - RETURN(rc); + return rc; } static atomic_t mgc_count = ATOMIC_INIT(0); @@ -699,7 +699,7 @@ static int mgc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage) CERROR("failed to cleanup llogging subsystems\n"); break; } - RETURN(rc); + return rc; } static int mgc_cleanup(struct obd_device *obd) @@ -719,7 +719,7 @@ static int mgc_cleanup(struct obd_device *obd) ptlrpcd_decref(); rc = client_obd_cleanup(obd); - RETURN(rc); + return rc; } static int mgc_setup(struct obd_device *obd, struct lustre_cfg *lcfg) @@ -760,13 +760,13 @@ static int mgc_setup(struct obd_device *obd, struct lustre_cfg *lcfg) rc = 0; } - RETURN(rc); + return rc; err_cleanup: client_obd_cleanup(obd); err_decref: ptlrpcd_decref(); - RETURN(rc); + return rc; } /* based on ll_mdc_blocking_ast */ @@ -824,7 +824,7 @@ static int mgc_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc, LBUG(); } - RETURN(rc); + return rc; } /* Not sure where this should go... */ @@ -844,12 +844,12 @@ static int mgc_set_mgs_param(struct obd_export *exp, &RQF_MGS_SET_INFO, LUSTRE_MGS_VERSION, MGS_SET_INFO); if (!req) - RETURN(-ENOMEM); + return -ENOMEM; req_msp = req_capsule_client_get(&req->rq_pill, &RMF_MGS_SEND_PARAM); if (!req_msp) { ptlrpc_req_finished(req); - RETURN(-ENOMEM); + return -ENOMEM; } memcpy(req_msp, msp, sizeof(*req_msp)); @@ -865,7 +865,7 @@ static int mgc_set_mgs_param(struct obd_export *exp, ptlrpc_req_finished(req); - RETURN(rc); + return rc; } /* Take a config lock so we can get cancel notifications */ @@ -895,7 +895,7 @@ static int mgc_enqueue(struct obd_export *exp, struct lov_stripe_md *lsm, &RQF_LDLM_ENQUEUE, LUSTRE_DLM_VERSION, LDLM_ENQUEUE); if (req == NULL) - RETURN(-ENOMEM); + return -ENOMEM; req_capsule_set_size(&req->rq_pill, &RMF_DLM_LVB, RCL_SERVER, 0); ptlrpc_request_set_replen(req); @@ -913,7 +913,7 @@ static int mgc_enqueue(struct obd_export *exp, struct lov_stripe_md *lsm, /* A failed enqueue should still call the mgc_blocking_ast, where it will be requeued if needed ("grant failed"). */ ptlrpc_req_finished(req); - RETURN(rc); + return rc; } static int mgc_cancel(struct obd_export *exp, struct lov_stripe_md *md, @@ -921,7 +921,7 @@ static int mgc_cancel(struct obd_export *exp, struct lov_stripe_md *md, { ldlm_lock_decref(lockh, mode); - RETURN(0); + return 0; } static void mgc_notify_active(struct obd_device *unused) @@ -947,12 +947,12 @@ static int mgc_target_register(struct obd_export *exp, &RQF_MGS_TARGET_REG, LUSTRE_MGS_VERSION, MGS_TARGET_REG); if (req == NULL) - RETURN(-ENOMEM); + return -ENOMEM; req_mti = req_capsule_client_get(&req->rq_pill, &RMF_MGS_TARGET_INFO); if (!req_mti) { ptlrpc_req_finished(req); - RETURN(-ENOMEM); + return -ENOMEM; } memcpy(req_mti, mti, sizeof(*req_mti)); @@ -971,7 +971,7 @@ static int mgc_target_register(struct obd_export *exp, } ptlrpc_req_finished(req); - RETURN(rc); + return rc; } int mgc_set_info_async(const struct lu_env *env, struct obd_export *exp, @@ -985,7 +985,7 @@ int mgc_set_info_async(const struct lu_env *env, struct obd_export *exp, struct obd_import *imp = class_exp2cliimp(exp); int value; if (vallen != sizeof(int)) - RETURN(-EINVAL); + return -EINVAL; value = *(int *)val; CDEBUG(D_MGC, "InitRecov %s %d/d%d:i%d:r%d:or%d:%s\n", imp->imp_obd->obd_name, value, @@ -996,46 +996,46 @@ int mgc_set_info_async(const struct lu_env *env, struct obd_export *exp, if ((imp->imp_state != LUSTRE_IMP_FULL && imp->imp_state != LUSTRE_IMP_NEW) || value > 1) ptlrpc_reconnect_import(imp); - RETURN(0); + return 0; } /* FIXME move this to mgc_process_config */ if (KEY_IS(KEY_REGISTER_TARGET)) { struct mgs_target_info *mti; if (vallen != sizeof(struct mgs_target_info)) - RETURN(-EINVAL); + return -EINVAL; mti = (struct mgs_target_info *)val; CDEBUG(D_MGC, "register_target %s %#x\n", mti->mti_svname, mti->mti_flags); rc = mgc_target_register(exp, mti); - RETURN(rc); + return rc; } if (KEY_IS(KEY_SET_FS)) { struct super_block *sb = (struct super_block *)val; struct lustre_sb_info *lsi; if (vallen != sizeof(struct super_block)) - RETURN(-EINVAL); + return -EINVAL; lsi = s2lsi(sb); rc = mgc_fs_setup(exp->exp_obd, sb, lsi->lsi_srv_mnt); if (rc) { CERROR("set_fs got %d\n", rc); } - RETURN(rc); + return rc; } if (KEY_IS(KEY_CLEAR_FS)) { if (vallen != 0) - RETURN(-EINVAL); + return -EINVAL; rc = mgc_fs_cleanup(exp->exp_obd); if (rc) { CERROR("clear_fs got %d\n", rc); } - RETURN(rc); + return rc; } if (KEY_IS(KEY_SET_INFO)) { struct mgs_send_param *msp; msp = (struct mgs_send_param *)val; rc = mgc_set_mgs_param(exp, msp); - RETURN(rc); + return rc; } if (KEY_IS(KEY_MGSSEC)) { struct client_obd *cli = &exp->exp_obd->u.cli; @@ -1050,7 +1050,7 @@ int mgc_set_info_async(const struct lu_env *env, struct obd_export *exp, */ if (vallen == 0) { if (cli->cl_flvr_mgc.sf_rpc != SPTLRPC_FLVR_INVALID) - RETURN(0); + return 0; val = "null"; vallen = 4; } @@ -1059,7 +1059,7 @@ int mgc_set_info_async(const struct lu_env *env, struct obd_export *exp, if (rc) { CERROR("invalid sptlrpc flavor %s to MGS\n", (char *) val); - RETURN(rc); + return rc; } /* @@ -1078,10 +1078,10 @@ int mgc_set_info_async(const struct lu_env *env, struct obd_export *exp, (char *) val, str); rc = -EPERM; } - RETURN(rc); + return rc; } - RETURN(rc); + return rc; } static int mgc_get_info(const struct lu_env *env, struct obd_export *exp, @@ -1142,7 +1142,7 @@ static int mgc_import_event(struct obd_device *obd, CERROR("Unknown import event %#x\n", event); LBUG(); } - RETURN(rc); + return rc; } static int mgc_llog_init(struct obd_device *obd, struct obd_llog_group *olg, @@ -1166,12 +1166,12 @@ static int mgc_llog_init(struct obd_device *obd, struct obd_llog_group *olg, llog_initiator_connect(ctxt); llog_ctxt_put(ctxt); - RETURN(0); + return 0; out: ctxt = llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT); if (ctxt) llog_cleanup(NULL, ctxt); - RETURN(rc); + return rc; } static int mgc_llog_finish(struct obd_device *obd, int count) @@ -1185,7 +1185,7 @@ static int mgc_llog_finish(struct obd_device *obd, int count) ctxt = llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT); if (ctxt) llog_cleanup(NULL, ctxt); - RETURN(0); + return 0; } enum { @@ -1216,7 +1216,7 @@ static int mgc_apply_recover_logs(struct obd_device *mgc, OBD_ALLOC(inst, PAGE_CACHE_SIZE); if (inst == NULL) - RETURN(-ENOMEM); + return -ENOMEM; if (!IS_SERVER(lsi)) { pos = snprintf(inst, PAGE_CACHE_SIZE, "%p", cfg->cfg_instance); @@ -1230,7 +1230,7 @@ static int mgc_apply_recover_logs(struct obd_device *mgc, PAGE_CACHE_SIZE); if (rc) { OBD_FREE(inst, PAGE_CACHE_SIZE); - RETURN(-EINVAL); + return -EINVAL; } pos = strlen(inst); } @@ -1388,7 +1388,7 @@ static int mgc_apply_recover_logs(struct obd_device *mgc, } OBD_FREE(inst, PAGE_CACHE_SIZE); - RETURN(rc); + return rc; } /** @@ -1560,7 +1560,7 @@ static int mgc_process_cfg_log(struct obd_device *mgc, * read it up here. */ if (cld_is_sptlrpc(cld) && local_only) - RETURN(0); + return 0; if (cld->cld_cfg.cfg_sb) lsi = s2lsi(cld->cld_cfg.cfg_sb); @@ -1568,12 +1568,12 @@ static int mgc_process_cfg_log(struct obd_device *mgc, ctxt = llog_get_context(mgc, LLOG_CONFIG_REPL_CTXT); if (!ctxt) { CERROR("missing llog context\n"); - RETURN(-EINVAL); + return -EINVAL; } OBD_ALLOC_PTR(saved_ctxt); if (saved_ctxt == NULL) - RETURN(-ENOMEM); + return -ENOMEM; lctxt = llog_get_context(mgc, LLOG_CONFIG_ORIG_CTXT); @@ -1614,7 +1614,7 @@ out_pop: strlen("-sptlrpc")); } - RETURN(rc); + return rc; } /** Get a config log from the MGS and process it. @@ -1636,7 +1636,7 @@ int mgc_process_log(struct obd_device *mgc, struct config_llog_data *cld) mutex_lock(&cld->cld_lock); if (cld->cld_stopping) { mutex_unlock(&cld->cld_lock); - RETURN(0); + return 0; } OBD_FAIL_TIMEOUT(OBD_FAIL_MGC_PAUSE_PROCESS_LOG, 20); @@ -1685,7 +1685,7 @@ int mgc_process_log(struct obd_device *mgc, struct config_llog_data *cld) CERROR("Can't drop cfg lock: %d\n", rcl); } - RETURN(rc); + return rc; } @@ -1783,7 +1783,7 @@ static int mgc_process_config(struct obd_device *obd, obd_count len, void *buf) } } out: - RETURN(rc); + return rc; } struct obd_ops mgc_obd_ops = { |