Re: [PATCH 10/26] dm: Use the block layer zone append emulation

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

 



On 2/4/24 02:58, Mike Snitzer wrote:
> Love the overall improvement to the DM core code and the broader block
> layer by switching to this bio-based ZWP approach.
> 
> Reviewed-by: Mike Snitzer <snitzer@xxxxxxxxxx>

Thanks Mike !

> But one incremental suggestion inlined below.

I made this change, but in a lightly different form as I noticed that I was
getting compile errors when CONFIG_BLK_DEV_ZONED is disabled.
The change look like this now:

static void dm_split_and_process_bio(struct mapped_device *md,
				     struct dm_table *map, struct bio *bio)
{
	...
	need_split = is_abnormal = is_abnormal_io(bio);
	if (static_branch_unlikely(&zoned_enabled))
		need_split = is_abnormal || dm_zone_bio_needs_split(md, bio);

	...

	/*
	 * Use the block layer zone write plugging for mapped devices that
	 * need zone append emulation (e.g. dm-crypt).
	 */
	if (static_branch_unlikely(&zoned_enabled) &&
	    dm_zone_write_plug_bio(md, bio))
		return;

	...

with these added to dm-core.h:

static inline bool dm_zone_bio_needs_split(struct mapped_device *md,
					   struct bio *bio)
{
	return md->emulate_zone_append && bio_straddle_zones(bio);
}
static inline bool dm_zone_write_plug_bio(struct mapped_device *md,
					  struct bio *bio)
{
	return md->emulate_zone_append && blk_zone_write_plug_bio(bio, 0);
}

These 2 helpers define to "return false" for !CONFIG_BLK_DEV_ZONED.
I hope this works for you. Otherwise, I will drop your review tag when posting V2.

-- 
Damien Le Moal
Western Digital Research





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux