Thread (86 messages) 86 messages, 7 authors, 2021-01-15

Re: [PATCH v11 08/40] btrfs: emulated zoned mode on non-zoned devices

From: David Sterba <hidden>
Date: 2021-01-13 18:01:18
Also in: linux-fsdevel

On Tue, Dec 22, 2020 at 12:49:01PM +0900, Naohiro Aota wrote:
quoted hunk ↗ jump to hunk
@@ -296,12 +383,22 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device)
 
 	device->zone_info = zone_info;
 
-	/* device->fs_info is not safe to use for printing messages */
-	btrfs_info_in_rcu(NULL,
NULL instead of fs_info
-			"host-%s zoned block device %s, %u zones of %llu bytes",
-			bdev_zoned_model(bdev) == BLK_ZONED_HM ? "managed" : "aware",
-			rcu_str_deref(device->name), zone_info->nr_zones,
-			zone_info->zone_size);
+	if (bdev_zoned_model(bdev) == BLK_ZONED_HM) {
+		model = "host-managed zoned";
+		emulated = "";
+	} else if (bdev_zoned_model(bdev) == BLK_ZONED_HA) {
+		model = "host-aware zoned";
+		emulated = "";
+	} else if (bdev_zoned_model(bdev) == BLK_ZONED_NONE &&
+		 device->force_zoned) {
+		model = "regular";
+		emulated = "emulated ";
+	}
+
+	btrfs_info_in_rcu(device->fs_info,
so what changed that it's fine to use device->fs_info now while it was
not before?
+		"%s block device %s, %u %szones of %llu bytes",
+		model, rcu_str_deref(device->name), zone_info->nr_zones,
+		emulated, zone_info->zone_size);
 
 	return 0;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help