Re: [PATCH 4/5] nvme: split out metadata vs non metadata end_io uring_cmd completions
From: Christoph Hellwig <hch@infradead.org>
Date: 2022-09-23 15:21:44
Also in:
linux-nvme, linux-scsi
From: Christoph Hellwig <hch@infradead.org>
Date: 2022-09-23 15:21:44
Also in:
linux-nvme, linux-scsi
+ union {
+ struct {
+ void *meta; /* kernel-resident buffer */
+ void __user *meta_buffer;
+ };
+ struct {
+ u32 nvme_flags;
+ u32 nvme_status;
+ u64 result;
+ };
+ };Without naming the arms of the union this is becoming a bit too much of a mess..
+static void nvme_uring_task_cb(struct io_uring_cmd *ioucmd)
+{
+ struct nvme_uring_cmd_pdu *pdu = nvme_uring_cmd_pdu(ioucmd);
+ int status;
+
+ if (pdu->nvme_flags & NVME_REQ_CANCELLED)
+ status = -EINTR;
+ else
+ status = pdu->nvme_status;If you add a signed int field you only need one field instead of two in the pdu for this (the nvme status is only 15 bits anyway).