Hi Martin,
I don't mind going though that route, here are some points about
benefits of not using REQ_SPECIAL_PAYLOAD for write-zeroes :-
1. We are using RQF_SPECIAL_PAYLOAD for only discard commands and not for
write-zeroes because it does not have any payload. Using this in the code
will
trigger more code changes to handle in the completion path.
2. Right now, blk_rq_nr_phys_segments() is used in:-
nvme/host/pci.c
nvme/target/loop.c
In order to keep the code consistent, I think we should use the same
function
call everywhere in the nvme code base:-
nvme/host/rdam.c : nvme_rdma_map_data() for the first check.
nvme/host/fc.c : nvme_fc_queue_rq().
3. Also blk_rq_nr_phys_segments() takes RQF_SPECIAL_PAYLOAD into account so
no more changes required for discard and write-zeroes cases.
Regards,
-Chaitanya
On 2/20/19, 2:55 PM, "Martin K. Petersen" <[email protected]> wrote:
Chaitanya,
> - if (!blk_rq_payload_bytes(rq))
> + if (!blk_rq_nr_phys_segments(rq))
Wouldn't it be better to set RQF_SPECIAL_PAYLOAD and friends in
nvme_setup_write_zeroes() like it's done for discard?
--
Martin K. Petersen Oracle Linux Engineering