ARM: tizen_bcm2711_defconfig: Add AC108 and SEEED configs
[platform/kernel/linux-rpi.git] / block / blk-settings.c
index a7c857a..b880c70 100644 (file)
@@ -842,6 +842,24 @@ bool blk_queue_can_use_dma_map_merging(struct request_queue *q,
 }
 EXPORT_SYMBOL_GPL(blk_queue_can_use_dma_map_merging);
 
+static bool disk_has_partitions(struct gendisk *disk)
+{
+       unsigned long idx;
+       struct block_device *part;
+       bool ret = false;
+
+       rcu_read_lock();
+       xa_for_each(&disk->part_tbl, idx, part) {
+               if (bdev_is_partition(part)) {
+                       ret = true;
+                       break;
+               }
+       }
+       rcu_read_unlock();
+
+       return ret;
+}
+
 /**
  * blk_queue_set_zoned - configure a disk queue zoned model.
  * @disk:      the gendisk of the queue to configure
@@ -876,7 +894,7 @@ void blk_queue_set_zoned(struct gendisk *disk, enum blk_zoned_model model)
                 * we do nothing special as far as the block layer is concerned.
                 */
                if (!IS_ENABLED(CONFIG_BLK_DEV_ZONED) ||
-                   !xa_empty(&disk->part_tbl))
+                   disk_has_partitions(disk))
                        model = BLK_ZONED_NONE;
                break;
        case BLK_ZONED_NONE: