Skip to content

Commit

Permalink
ubd_drv: update io->addr for UBD_IO_COMMIT_AND_FETCH_REQ
Browse files Browse the repository at this point in the history
Now we only update io->addr for UBD_IO_FETCH_REQ command which is
issued when starting device, this way requires that buffer has to
be pre-allocated, and not flexible enough.

Update io->addr in both UBD_IO_FETCH_REQ and
UBD_IO_COMMIT_AND_FETCH_REQ, then application can cover buffer
allocation, such as take the buffer for post-handling request,
then complete the request with new buffer.

Signed-off-by: Ming Lei <ming.lei@redhat.com>
  • Loading branch information
Ming Lei committed Jun 7, 2022
1 parent 22badb1 commit 0a964a1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/block/ubd/ubd_drv.c
Expand Up @@ -655,6 +655,7 @@ static int ubd_ch_uring_cmd(struct io_uring_cmd *cmd, unsigned int issue_flags)
io->addr = ub_cmd->addr;
break;
case UBD_IO_COMMIT_AND_FETCH_REQ:
io->addr = ub_cmd->addr;
io->flags |= UBD_IO_FLAG_ACTIVE;
fallthrough;
case UBD_IO_COMMIT_REQ:
Expand Down

0 comments on commit 0a964a1

Please sign in to comment.