Re: [PATCH v5 09/28] btrfs: align device extent allocation to zone boundary

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 05, 2019 at 09:56:25AM +0100, Johannes Thumshirn wrote:
On Wed, Dec 04, 2019 at 05:17:16PM +0900, Naohiro Aota wrote:
[...]

Only commenting on the code, not the design, sorry. I'll leave that to someone
with more experience in BTRFS.

 	 * at an offset of at least 1MB.
 	 */
 	search_start = max_t(u64, search_start, SZ_1M);
+	/*
+	 * For a zoned block device, skip the first zone of the device
+	 * entirely.
+	 */
+	if (device->zone_info)
+		zone_size = device->zone_info->zone_size;
+	search_start = max_t(u64, search_start, zone_size);
+	search_start = btrfs_zone_align(device, search_start);

	if (device->zone_info) {
		zone_size = device->zone_info->zone_size;
		search_start = max_t(u64, search_start, zone_size);
		search_start = btrfs_zone_align(device, search_start);
	}

That's the equivalent code, but should make it a bit more clear what's
happening int the HMZONED and !HMZOED cases.

And I /guess/ we're saving some cycles in the !HMZONED case as we don't have
to adjust search start there.

[...]

@@ -4778,6 +4805,7 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
 	int i;
 	int j;
 	int index;
+	int hmzoned = btrfs_fs_incompat(info, HMZONED);

	bool hmzoned = btrfs_fs_incompat(info, HMZONED);


Thanks, followed all the change.




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux