Re: [PATCH v2 4/8] zbd: introduce zbd_move_zone_wp()

Damien Le Moal <[email protected]>
Newsgroups org.kernel.vger.fio
Organization Western Digital Research
Message-ID <[email protected]>
On 4/25/25 2:21 PM, Shin'ichiro Kawasaki wrote:
> As a preparation for continue_on_error option support for zonemode=zbd,
> introduce the function zbd_move_zone_wp(). It moves write pointers by
> calling blkzoned_move_zone_wp() or move_zone_wp() callback of IO
> engines.
> 
> Signed-off-by: Shin'ichiro Kawasaki <[email protected]>

Looks good. One nit below.

Reviewed-by: Damien Le Moal <[email protected]>

> +static int zbd_move_zone_wp(struct thread_data *td, struct fio_file *f,
> +			    struct zbd_zone *z, uint64_t length,
> +			    const char *buf)
> +{
> +	int ret = 0;
> +
> +	switch (f->zbd_info->model) {
> +	case ZBD_HOST_AWARE:
> +	case ZBD_HOST_MANAGED:
> +		if (td->io_ops && td->io_ops->move_zone_wp)
> +			ret = td->io_ops->move_zone_wp(td, f, z, length, buf);
> +		else
> +			ret = blkzoned_move_zone_wp(td, f, z, length, buf);
> +		break;
> +	default:
> +		break;

Nit: You can do "return 0;" here and remove the ret variable initialization on
declaration.

> +	}
> +
> +	if (ret < 0) {
> +		td_verror(td, errno, "move wp failed");
> +		log_err("%s: moving wp for %"PRIu64" sectors at sector %"PRIu64" failed (%d).\n",
> +			f->file_name, length >> 9, z->wp >> 9, errno);
> +	}
> +
> +	return ret;
> +}
> +
>  /**
>   * zbd_get_max_open_zones - Get the maximum number of open zones
>   * @td: FIO thread data


-- 
Damien Le Moal
Western Digital Research
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.