[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231109153603.GA2188@lst.de>
Date: Thu, 9 Nov 2023 16:36:03 +0100
From: Christoph Hellwig <hch@....de>
To: John Garry <john.g.garry@...cle.com>
Cc: axboe@...nel.dk, kbusch@...nel.org, hch@....de, sagi@...mberg.me,
jejb@...ux.ibm.com, martin.petersen@...cle.com, djwong@...nel.org,
viro@...iv.linux.org.uk, brauner@...nel.org,
chandan.babu@...cle.com, dchinner@...hat.com,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-nvme@...ts.infradead.org, linux-xfs@...r.kernel.org,
linux-fsdevel@...r.kernel.org, tytso@....edu, jbongio@...gle.com,
linux-api@...r.kernel.org, Alan Adamson <alan.adamson@...cle.com>
Subject: Re: [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.
Powered by blists - more mailing lists