Whamcloud - gitweb
LU-5577 lmv: change type of lmv_obd->tgts_size to __u32 81/11881/2
authorDmitry Eremin <dmitry.eremin@intel.com>
Thu, 11 Sep 2014 19:39:44 +0000 (23:39 +0400)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 25 Sep 2014 02:43:58 +0000 (02:43 +0000)
tgts_size is used as unsigned.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: Ia910f034605a787b45539952a9d1f0c0d04e8891
Reviewed-on: http://review.whamcloud.com/11881
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/obd.h
lustre/lmv/lmv_obd.c

index e0eca82..8c966ab 100644 (file)
@@ -451,7 +451,7 @@ struct lmv_obd {
        int                     max_def_cookiesize;
        int                     server_timeout;
 
-       int                     tgts_size; /* size of tgts array */
+       __u32                   tgts_size; /* size of tgts array */
        struct lmv_tgt_desc     **tgts;
 
        struct obd_connect_data conn_data;
index 5279964..0d36904 100644 (file)
@@ -1440,10 +1440,10 @@ static int lmv_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
                 RETURN(-EINVAL);
         }
 
-       OBD_ALLOC(lmv->tgts, sizeof(*lmv->tgts) * 32);
+       lmv->tgts_size = 32U;
+       OBD_ALLOC(lmv->tgts, sizeof(*lmv->tgts) * lmv->tgts_size);
        if (lmv->tgts == NULL)
                RETURN(-ENOMEM);
-       lmv->tgts_size = 32;
 
        obd_str2uuid(&lmv->desc.ld_uuid, desc->ld_uuid.uuid);
        lmv->desc.ld_tgt_count = 0;