aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/lustre/ptlrpc/service.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/lustre/lustre/ptlrpc/service.c')
-rw-r--r--drivers/staging/lustre/lustre/ptlrpc/service.c54
1 files changed, 31 insertions, 23 deletions
diff --git a/drivers/staging/lustre/lustre/ptlrpc/service.c b/drivers/staging/lustre/lustre/ptlrpc/service.c
index c88eae27bbf4..a8df8a792333 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/service.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/service.c
@@ -781,13 +781,15 @@ ptlrpc_register_service(struct ptlrpc_service_conf *conf,
cpt = cpts != NULL ? cpts[i] : i;
OBD_CPT_ALLOC(svcpt, cptable, cpt, sizeof(*svcpt));
- if (svcpt == NULL)
- GOTO(failed, rc = -ENOMEM);
+ if (svcpt == NULL) {
+ rc = -ENOMEM;
+ goto failed;
+ }
service->srv_parts[i] = svcpt;
rc = ptlrpc_service_part_init(service, svcpt, cpt);
if (rc != 0)
- GOTO(failed, rc);
+ goto failed;
}
ptlrpc_server_nthreads_check(service, conf);
@@ -804,7 +806,7 @@ ptlrpc_register_service(struct ptlrpc_service_conf *conf,
rc = ptlrpc_service_nrs_setup(service);
if (rc != 0)
- GOTO(failed, rc);
+ goto failed;
CDEBUG(D_NET, "%s: Started, listening on portal %d\n",
service->srv_name, service->srv_req_portal);
@@ -813,7 +815,7 @@ ptlrpc_register_service(struct ptlrpc_service_conf *conf,
if (rc != 0) {
CERROR("Failed to start threads for service %s: %d\n",
service->srv_name, rc);
- GOTO(failed, rc);
+ goto failed;
}
return service;
@@ -1172,13 +1174,13 @@ static int ptlrpc_at_add_timed(struct ptlrpc_request *req)
__u32 index;
if (AT_OFF)
- return(0);
+ return 0;
if (req->rq_no_reply)
return 0;
if ((lustre_msghdr_get_flags(req->rq_reqmsg) & MSGHDR_AT_SUPPORT) == 0)
- return(-ENOSYS);
+ return -ENOSYS;
spin_lock(&svcpt->scp_at_lock);
LASSERT(list_empty(&req->rq_timed_list));
@@ -1308,8 +1310,10 @@ static int ptlrpc_at_send_early_reply(struct ptlrpc_request *req)
if (reqcopy == NULL)
return -ENOMEM;
OBD_ALLOC_LARGE(reqmsg, req->rq_reqlen);
- if (!reqmsg)
- GOTO(out_free, rc = -ENOMEM);
+ if (!reqmsg) {
+ rc = -ENOMEM;
+ goto out_free;
+ }
*reqcopy = *req;
reqcopy->rq_reply_state = NULL;
@@ -1327,24 +1331,29 @@ static int ptlrpc_at_send_early_reply(struct ptlrpc_request *req)
if (atomic_read(&req->rq_refcount) == 1) {
DEBUG_REQ(D_ADAPTTO, reqcopy, "Normal reply already sent out, "
"abort sending early reply\n");
- GOTO(out, rc = -EINVAL);
+ rc = -EINVAL;
+ goto out;
}
/* Connection ref */
reqcopy->rq_export = class_conn2export(
lustre_msg_get_handle(reqcopy->rq_reqmsg));
- if (reqcopy->rq_export == NULL)
- GOTO(out, rc = -ENODEV);
+ if (reqcopy->rq_export == NULL) {
+ rc = -ENODEV;
+ goto out;
+ }
/* RPC ref */
class_export_rpc_inc(reqcopy->rq_export);
if (reqcopy->rq_export->exp_obd &&
- reqcopy->rq_export->exp_obd->obd_fail)
- GOTO(out_put, rc = -ENODEV);
+ reqcopy->rq_export->exp_obd->obd_fail) {
+ rc = -ENODEV;
+ goto out_put;
+ }
rc = lustre_pack_reply_flags(reqcopy, 1, NULL, NULL, LPRFL_EARLY_REPLY);
if (rc)
- GOTO(out_put, rc);
+ goto out_put;
rc = ptlrpc_send_reply(reqcopy, PTLRPC_REPLY_EARLY);
@@ -1849,7 +1858,7 @@ ptlrpc_server_handle_req_in(struct ptlrpc_service_part *svcpt,
/* Move it over to the request processing queue */
rc = ptlrpc_server_request_add(svcpt, req);
if (rc)
- GOTO(err_req, rc);
+ goto err_req;
wake_up(&svcpt->scp_waitq);
return 1;
@@ -1896,7 +1905,8 @@ ptlrpc_server_handle_request(struct ptlrpc_service_part *svcpt,
libcfs_debug_dumplog();
do_gettimeofday(&work_start);
- timediff = cfs_timeval_sub(&work_start, &request->rq_arrival_time,NULL);
+ timediff = cfs_timeval_sub(&work_start, &request->rq_arrival_time,
+ NULL);
if (likely(svc->srv_stats != NULL)) {
lprocfs_counter_add(svc->srv_stats, PTLRPC_REQWAIT_CNTR,
timediff);
@@ -2262,9 +2272,7 @@ static int ptlrpc_main(void *arg)
struct ptlrpc_service_part *svcpt = thread->t_svcpt;
struct ptlrpc_service *svc = svcpt->scp_service;
struct ptlrpc_reply_state *rs;
-#ifdef WITH_GROUP_INFO
struct group_info *ginfo = NULL;
-#endif
struct lu_env *env;
int counter = 0, rc = 0;
@@ -2280,7 +2288,6 @@ static int ptlrpc_main(void *arg)
svc->srv_name, thread->t_name, svcpt->scp_cpt);
}
-#ifdef WITH_GROUP_INFO
ginfo = groups_alloc(0);
if (!ginfo) {
rc = -ENOMEM;
@@ -2289,7 +2296,6 @@ static int ptlrpc_main(void *arg)
set_current_groups(ginfo);
put_group_info(ginfo);
-#endif
if (svc->srv_ops.so_thr_init != NULL) {
rc = svc->srv_ops.so_thr_init(thread);
@@ -2790,8 +2796,10 @@ int ptlrpc_hr_init(void)
LASSERT(hrp->hrp_nthrs > 0);
OBD_CPT_ALLOC(hrp->hrp_thrs, ptlrpc_hr.hr_cpt_table, i,
hrp->hrp_nthrs * sizeof(*hrt));
- if (hrp->hrp_thrs == NULL)
- GOTO(out, rc = -ENOMEM);
+ if (hrp->hrp_thrs == NULL) {
+ rc = -ENOMEM;
+ goto out;
+ }
for (j = 0; j < hrp->hrp_nthrs; j++) {
hrt = &hrp->hrp_thrs[j];