Whamcloud - gitweb
LU-5577 obdclass: lu_htable_order() return type to long 85/12385/2
authorDmitry Eremin <dmitry.eremin@intel.com>
Fri, 10 Oct 2014 19:35:16 +0000 (23:35 +0400)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 4 Dec 2014 13:46:46 +0000 (13:46 +0000)
Change the type accordant usage.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: I4a2071f9ca51cc34f1fd7c73ccf7dac52a9ff0e9
Reviewed-on: http://review.whamcloud.com/12385
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/obdclass/lu_object.c

index cb19029..95d7192 100644 (file)
@@ -358,7 +358,7 @@ int lu_site_purge(const struct lu_env *env, struct lu_site *s, int nr)
          * the dispose list, removing them from LRU and hash table.
          */
         start = s->ls_purge_start;
-        bnr = (nr == ~0) ? -1 : nr / CFS_HASH_NBKT(s->ls_obj_hash) + 1;
+       bnr = (nr == ~0) ? -1 : nr / (int)CFS_HASH_NBKT(s->ls_obj_hash) + 1;
  again:
        /*
         * It doesn't make any sense to make purge threads parallel, that can
@@ -954,10 +954,10 @@ EXPORT_SYMBOL(lu_site_print);
 /**
  * Return desired hash table order.
  */
-static unsigned int lu_htable_order(struct lu_device *top)
+static unsigned long lu_htable_order(struct lu_device *top)
 {
        unsigned long cache_size;
-       unsigned int  bits;
+       unsigned long bits;
 
        /*
         * For ZFS based OSDs the cache should be disabled by default.  This
@@ -1098,14 +1098,14 @@ int lu_site_init(struct lu_site *s, struct lu_device *top)
        struct lu_site_bkt_data *bkt;
        cfs_hash_bd_t bd;
        char name[16];
-       unsigned int bits;
+       unsigned long bits;
        unsigned int i;
        ENTRY;
 
        memset(s, 0, sizeof *s);
        mutex_init(&s->ls_purge_mutex);
        bits = lu_htable_order(top);
-       snprintf(name, 16, "lu_site_%s", top->ld_type->ldt_name);
+       snprintf(name, sizeof(name), "lu_site_%s", top->ld_type->ldt_name);
        for (bits = clamp_t(typeof(bits), bits,
                            LU_SITE_BITS_MIN, LU_SITE_BITS_MAX);
             bits >= LU_SITE_BITS_MIN; bits--) {
@@ -1123,7 +1123,7 @@ int lu_site_init(struct lu_site *s, struct lu_device *top)
        }
 
        if (s->ls_obj_hash == NULL) {
-               CERROR("failed to create lu_site hash with bits: %d\n", bits);
+               CERROR("failed to create lu_site hash with bits: %lu\n", bits);
                return -ENOMEM;
        }