]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
drivers/md/persistent-data/dm-transaction-manager.c: rename HASH_SIZE
authorAndrew Morton <akpm@linux-foundation.org>
Sat, 23 Feb 2013 00:32:03 +0000 (16:32 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 24 Feb 2013 01:50:08 +0000 (17:50 -0800)
Fix the warning:

  drivers/md/persistent-data/dm-transaction-manager.c:28:1: warning: "HASH_SIZE" redefined
  In file included from include/linux/elevator.h:5,
                   from include/linux/blkdev.h:216,
                   from drivers/md/persistent-data/dm-block-manager.h:11,
                   from drivers/md/persistent-data/dm-transaction-manager.h:10,
                   from drivers/md/persistent-data/dm-transaction-manager.c:6:
  include/linux/hashtable.h:22:1: warning: this is the location of the previous definition

Cc: Alasdair Kergon <agk@redhat.com>
Cc: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/md/persistent-data/dm-transaction-manager.c

index d247a35da3c63030bca417b89482bb8fdf371cd0..7b17a1fdeaf9b991c80a8f3300efcd429c6cad52 100644 (file)
@@ -25,8 +25,8 @@ struct shadow_info {
 /*
  * It would be nice if we scaled with the size of transaction.
  */
-#define HASH_SIZE 256
-#define HASH_MASK (HASH_SIZE - 1)
+#define DM_HASH_SIZE 256
+#define DM_HASH_MASK (DM_HASH_SIZE - 1)
 
 struct dm_transaction_manager {
        int is_clone;
@@ -36,7 +36,7 @@ struct dm_transaction_manager {
        struct dm_space_map *sm;
 
        spinlock_t lock;
-       struct hlist_head buckets[HASH_SIZE];
+       struct hlist_head buckets[DM_HASH_SIZE];
 };
 
 /*----------------------------------------------------------------*/
@@ -44,7 +44,7 @@ struct dm_transaction_manager {
 static int is_shadow(struct dm_transaction_manager *tm, dm_block_t b)
 {
        int r = 0;
-       unsigned bucket = dm_hash_block(b, HASH_MASK);
+       unsigned bucket = dm_hash_block(b, DM_HASH_MASK);
        struct shadow_info *si;
        struct hlist_node *n;
 
@@ -71,7 +71,7 @@ static void insert_shadow(struct dm_transaction_manager *tm, dm_block_t b)
        si = kmalloc(sizeof(*si), GFP_NOIO);
        if (si) {
                si->where = b;
-               bucket = dm_hash_block(b, HASH_MASK);
+               bucket = dm_hash_block(b, DM_HASH_MASK);
                spin_lock(&tm->lock);
                hlist_add_head(&si->hlist, tm->buckets + bucket);
                spin_unlock(&tm->lock);
@@ -86,7 +86,7 @@ static void wipe_shadow_table(struct dm_transaction_manager *tm)
        int i;
 
        spin_lock(&tm->lock);
-       for (i = 0; i < HASH_SIZE; i++) {
+       for (i = 0; i < DM_HASH_SIZE; i++) {
                bucket = tm->buckets + i;
                hlist_for_each_entry_safe(si, n, tmp, bucket, hlist)
                        kfree(si);
@@ -115,7 +115,7 @@ static struct dm_transaction_manager *dm_tm_create(struct dm_block_manager *bm,
        tm->sm = sm;
 
        spin_lock_init(&tm->lock);
-       for (i = 0; i < HASH_SIZE; i++)
+       for (i = 0; i < DM_HASH_SIZE; i++)
                INIT_HLIST_HEAD(tm->buckets + i);
 
        return tm;