lkml.org 
[lkml]   [2023]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 21/21] nvme: Support atomic writes
> +			if (le16_to_cpu(id->nabspf))
> + boundary = (le16_to_cpu(id->nabspf) + 1) * bs;
> +
> + if (is_power_of_2(boundary) || !boundary) {
> + blk_queue_atomic_write_max_bytes(disk->queue, atomic_bs);
> + blk_queue_atomic_write_unit_min_sectors(disk->queue, 1);
> + blk_queue_atomic_write_unit_max_sectors(disk->queue,
> + atomic_bs / bs);
> + blk_queue_atomic_write_boundary_bytes(disk->queue, boundary);
> + } else {
> + dev_err(ns->ctrl->device, "Unsupported atomic boundary=0x%x\n",
> + boundary);
> + }

Please figure out a way to split the atomic configuration into a
helper and avoid all those crazy long lines, preferable also avoid
the double calls to the block helpers as well while you're at it.

Also I really want a check in the NVMe I/O path that any request
with the atomic flag set actually adhers to the limits to at least
partially paper over the annoying lack of a separate write atomic
command in nvme.

\
 
 \ /
  Last update: 2023-11-20 13:54    [W:0.865 / U:1.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site