[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZXpWOaxCRoF7dFis@kbusch-mbp>
Date: Wed, 13 Dec 2023 17:11:21 -0800
From: Keith Busch <kbusch@...nel.org>
To: Kanchan Joshi <joshi.k@...sung.com>
Cc: Jens Axboe <axboe@...nel.dk>, Jonathan Corbet <corbet@....net>,
Alasdair Kergon <agk@...hat.com>,
Mike Snitzer <snitzer@...nel.org>,
Mikulas Patocka <mpatocka@...hat.com>,
dm-devel@...ts.linux.dev, Christoph Hellwig <hch@....de>,
Sagi Grimberg <sagi@...mberg.me>,
Chaitanya Kulkarni <kch@...dia.com>,
Alexander Viro <viro@...iv.linux.org.uk>,
Christian Brauner <brauner@...nel.org>,
martin.petersen@...cle.com, linux-scsi@...r.kernel.org,
nitheshshetty@...il.com, anuj1072538@...il.com,
gost.dev@...sung.com, mcgrof@...nel.org,
Nitesh Shetty <nj.shetty@...sung.com>,
Anuj Gupta <anuj20.g@...sung.com>, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
linux-nvme@...ts.infradead.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH v18 02/12] Add infrastructure for copy offload in block
and request layer.
On Wed, Dec 06, 2023 at 03:32:34PM +0530, Kanchan Joshi wrote:
> static inline bool bio_has_data(struct bio *bio)
> {
> - if (bio &&
> - bio->bi_iter.bi_size &&
> - bio_op(bio) != REQ_OP_DISCARD &&
> - bio_op(bio) != REQ_OP_SECURE_ERASE &&
> - bio_op(bio) != REQ_OP_WRITE_ZEROES)
> + if (bio && (bio_op(bio) == REQ_OP_READ || bio_op(bio) == REQ_OP_WRITE))
> return true;
There are other ops besides READ and WRITE that have data, but this is
might be fine by the fact that other ops with data currently don't call
this function.
> diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
> index 7c2316c91cbd..bd821eaa7a02 100644
> --- a/include/linux/blk_types.h
> +++ b/include/linux/blk_types.h
> @@ -393,6 +393,10 @@ enum req_op {
> /* reset all the zone present on the device */
> REQ_OP_ZONE_RESET_ALL = (__force blk_opf_t)17,
>
> + /* copy offload dst and src operation */
> + REQ_OP_COPY_SRC = (__force blk_opf_t)19,
Should this be an even numbered OP? The odd ones are for data
WRITEs.
> + REQ_OP_COPY_DST = (__force blk_opf_t)21,
Powered by blists - more mailing lists