Whamcloud - gitweb
LU-5577 obd: change type of cl_conn_count to size_t 25/13125/3
authorDmitry Eremin <dmitry.eremin@intel.com>
Thu, 11 Sep 2014 18:45:11 +0000 (22:45 +0400)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 7 Jan 2015 17:11:58 +0000 (17:11 +0000)
Change type of cl_conn_count to size_t.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: Iac5410f0b96b63f79b7a85e2a9d61cc031919189
Reviewed-on: http://review.whamcloud.com/13125
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/obd.h
lustre/ldlm/ldlm_lib.c
lustre/mgc/mgc_request.c

index 90cab2f..e8e23d4 100644 (file)
@@ -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;
index 219b12c..abef317 100644 (file)
@@ -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
index 5dce42c..9c3ea33 100644 (file)
@@ -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);