From 5e17af16a920c56eba438faf7cb66f55c70e0b79 Mon Sep 17 00:00:00 2001 From: Dmitry Eremin Date: Thu, 11 Sep 2014 22:45:11 +0400 Subject: [PATCH] LU-5577 obd: change type of cl_conn_count to size_t Change type of cl_conn_count to size_t. Signed-off-by: Dmitry Eremin Change-Id: Iac5410f0b96b63f79b7a85e2a9d61cc031919189 Reviewed-on: http://review.whamcloud.com/13125 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- lustre/include/obd.h | 2 +- lustre/ldlm/ldlm_lib.c | 10 +++++----- lustre/mgc/mgc_request.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lustre/include/obd.h b/lustre/include/obd.h index 90cab2f..e8e23d4 100644 --- a/lustre/include/obd.h +++ b/lustre/include/obd.h @@ -211,7 +211,7 @@ struct client_obd { struct rw_semaphore cl_sem; struct obd_uuid cl_target_uuid; struct obd_import *cl_import; /* ptlrpc connection state */ - int cl_conn_count; + size_t cl_conn_count; /* max_mds_easize is purely a performance thing so we don't have to * call obd_size_diskmd() all the time. */ __u32 cl_default_mds_easize; diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index 219b12c..abef317 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -508,7 +508,7 @@ int client_connect_import(const struct lu_env *env, *exp = NULL; down_write(&cli->cl_sem); - if (cli->cl_conn_count > 0 ) + if (cli->cl_conn_count > 0) GOTO(out_sem, rc = -EALREADY); rc = class_connect(&conn, obd, cluuid); @@ -580,17 +580,17 @@ int client_disconnect_export(struct obd_export *exp) imp = cli->cl_import; down_write(&cli->cl_sem); - CDEBUG(D_INFO, "disconnect %s - %d\n", obd->obd_name, - cli->cl_conn_count); + CDEBUG(D_INFO, "disconnect %s - %zu\n", obd->obd_name, + cli->cl_conn_count); - if (!cli->cl_conn_count) { + if (cli->cl_conn_count == 0) { CERROR("disconnecting disconnected device (%s)\n", obd->obd_name); GOTO(out_disconnect, rc = -EINVAL); } cli->cl_conn_count--; - if (cli->cl_conn_count) + if (cli->cl_conn_count != 0) GOTO(out_disconnect, rc = 0); /* Mark import deactivated now, so we don't try to reconnect if any diff --git a/lustre/mgc/mgc_request.c b/lustre/mgc/mgc_request.c index 5dce42c..9c3ea33 100644 --- a/lustre/mgc/mgc_request.c +++ b/lustre/mgc/mgc_request.c @@ -1001,8 +1001,8 @@ static int mgc_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc, } /* Make sure not to re-enqueue when the mgc is stopping (we get called from client_disconnect_export) */ - if (!lock->l_conn_export || - !lock->l_conn_export->exp_obd->u.cli.cl_conn_count) { + if (lock->l_conn_export == NULL || + lock->l_conn_export->exp_obd->u.cli.cl_conn_count == 0) { CDEBUG(D_MGC, "log %.8s: disconnecting, won't requeue\n", cld->cld_logname); config_log_put(cld); -- 1.8.3.1