Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ublk: add parameter `struct io_uring_cmd *` to ublk_prep_auto_buf_reg()

Add parameter `struct io_uring_cmd *` to ublk_prep_auto_buf_reg() and
prepare for reusing this helper for the coming UBLK_BATCH_IO feature,
which can fetch & commit one batch of io commands via single uring_cmd.

Reviewed-by: Caleb Sander Mateos <csander@purestorage.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Ming Lei and committed by
Jens Axboe
3035b9b4 9574b21e

+7 -5
+7 -5
drivers/block/ublk_drv.c
··· 1176 1176 } 1177 1177 1178 1178 static bool ublk_auto_buf_reg(const struct ublk_queue *ubq, struct request *req, 1179 - struct ublk_io *io, unsigned int issue_flags) 1179 + struct ublk_io *io, struct io_uring_cmd *cmd, 1180 + unsigned int issue_flags) 1180 1181 { 1181 1182 int ret; 1182 1183 1183 - ret = io_buffer_register_bvec(io->cmd, req, ublk_io_release, 1184 + ret = io_buffer_register_bvec(cmd, req, ublk_io_release, 1184 1185 io->buf.index, issue_flags); 1185 1186 if (ret) { 1186 1187 if (io->buf.flags & UBLK_AUTO_BUF_REG_FALLBACK) { ··· 1193 1192 } 1194 1193 1195 1194 io->task_registered_buffers = 1; 1196 - io->buf_ctx_handle = io_uring_cmd_ctx_handle(io->cmd); 1195 + io->buf_ctx_handle = io_uring_cmd_ctx_handle(cmd); 1197 1196 io->flags |= UBLK_IO_FLAG_AUTO_BUF_REG; 1198 1197 return true; 1199 1198 } 1200 1199 1201 1200 static bool ublk_prep_auto_buf_reg(struct ublk_queue *ubq, 1202 1201 struct request *req, struct ublk_io *io, 1202 + struct io_uring_cmd *cmd, 1203 1203 unsigned int issue_flags) 1204 1204 { 1205 1205 ublk_init_req_ref(ubq, io); 1206 1206 if (ublk_support_auto_buf_reg(ubq) && ublk_rq_has_data(req)) 1207 - return ublk_auto_buf_reg(ubq, req, io, issue_flags); 1207 + return ublk_auto_buf_reg(ubq, req, io, cmd, issue_flags); 1208 1208 1209 1209 return true; 1210 1210 } ··· 1280 1278 if (!ublk_start_io(ubq, req, io)) 1281 1279 return; 1282 1280 1283 - if (ublk_prep_auto_buf_reg(ubq, req, io, issue_flags)) 1281 + if (ublk_prep_auto_buf_reg(ubq, req, io, io->cmd, issue_flags)) 1284 1282 ublk_complete_io_cmd(io, req, UBLK_IO_RES_OK, issue_flags); 1285 1283 } 1286 1284