struct btrfsic_dev_state *ds,
                struct btrfsic_dev_state_hashtable *h);
 static void btrfsic_dev_state_hashtable_remove(struct btrfsic_dev_state *ds);
-static struct btrfsic_dev_state *btrfsic_dev_state_hashtable_lookup(
-               struct block_device *bdev,
+static struct btrfsic_dev_state *btrfsic_dev_state_hashtable_lookup(dev_t dev,
                struct btrfsic_dev_state_hashtable *h);
 static struct btrfsic_stack_frame *btrfsic_stack_frame_alloc(void);
 static void btrfsic_stack_frame_free(struct btrfsic_stack_frame *sf);
                int superblock_mirror_num,
                struct btrfsic_dev_state **selected_dev_state,
                struct btrfs_super_block *selected_super);
-static struct btrfsic_dev_state *btrfsic_dev_state_lookup(
-               struct block_device *bdev);
+static struct btrfsic_dev_state *btrfsic_dev_state_lookup(dev_t dev);
 static void btrfsic_cmp_log_and_dev_bytenr(struct btrfsic_state *state,
                                           u64 bytenr,
                                           struct btrfsic_dev_state *dev_state,
        list_del(&ds->collision_resolving_node);
 }
 
-static struct btrfsic_dev_state *btrfsic_dev_state_hashtable_lookup(
-               struct block_device *bdev,
+static struct btrfsic_dev_state *btrfsic_dev_state_hashtable_lookup(dev_t dev,
                struct btrfsic_dev_state_hashtable *h)
 {
        const unsigned int hashval =
-           (((unsigned int)((uintptr_t)bdev)) &
-            (BTRFSIC_DEV2STATE_HASHTABLE_SIZE - 1));
+               dev & (BTRFSIC_DEV2STATE_HASHTABLE_SIZE - 1);
        struct btrfsic_dev_state *ds;
 
        list_for_each_entry(ds, h->table + hashval, collision_resolving_node) {
-               if (ds->bdev == bdev)
+               if (ds->bdev->bd_dev == dev)
                        return ds;
        }
 
                if (!device->bdev || !device->name)
                        continue;
 
-               dev_state = btrfsic_dev_state_lookup(device->bdev);
+               dev_state = btrfsic_dev_state_lookup(device->bdev->bd_dev);
                BUG_ON(NULL == dev_state);
                for (i = 0; i < BTRFS_SUPER_MIRROR_MAX; i++) {
                        ret = btrfsic_process_superblock_dev_mirror(
        }
 
        device = multi->stripes[0].dev;
-       block_ctx_out->dev = btrfsic_dev_state_lookup(device->bdev);
+       block_ctx_out->dev = btrfsic_dev_state_lookup(device->bdev->bd_dev);
        block_ctx_out->dev_bytenr = multi->stripes[0].physical;
        block_ctx_out->start = bytenr;
        block_ctx_out->len = len;
                        pr_info("btrfsic: error, kmalloc failed!\n");
                        return NULL;
                }
-               dev_state = btrfsic_dev_state_lookup(block_ctx->dev->bdev);
+               dev_state = btrfsic_dev_state_lookup(block_ctx->dev->bdev->bd_dev);
                if (NULL == dev_state) {
                        pr_info("btrfsic: error, lookup dev_state failed!\n");
                        btrfsic_block_free(block);
        }
 }
 
-static struct btrfsic_dev_state *btrfsic_dev_state_lookup(
-               struct block_device *bdev)
+static struct btrfsic_dev_state *btrfsic_dev_state_lookup(dev_t dev)
 {
-       return btrfsic_dev_state_hashtable_lookup(bdev,
+       return btrfsic_dev_state_hashtable_lookup(dev,
                                                  &btrfsic_dev_state_hashtable);
 }
 
        mutex_lock(&btrfsic_mutex);
        /* since btrfsic_submit_bh() might also be called before
         * btrfsic_mount(), this might return NULL */
-       dev_state = btrfsic_dev_state_lookup(bh->b_bdev);
+       dev_state = btrfsic_dev_state_lookup(bh->b_bdev->bd_dev);
 
        /* Only called to write the superblock (incl. FLUSH/FUA) */
        if (NULL != dev_state &&
        mutex_lock(&btrfsic_mutex);
        /* since btrfsic_submit_bio() is also called before
         * btrfsic_mount(), this might return NULL */
-       dev_state = btrfsic_dev_state_lookup(bio->bi_bdev);
+       dev_state = btrfsic_dev_state_lookup(bio->bi_bdev->bd_dev);
        if (NULL != dev_state &&
            (bio_op(bio) == REQ_OP_WRITE) && bio_has_data(bio)) {
                unsigned int i = 0;
                        continue;
 
                ds = btrfsic_dev_state_hashtable_lookup(
-                               device->bdev,
+                               device->bdev->bd_dev,
                                &btrfsic_dev_state_hashtable);
                if (NULL != ds) {
                        state = ds->state;