Skip to content

Commit 9ce5505

Browse files
calebsanderkawasaki
authored andcommitted
ublk: move ublk_prep_cancel() to case UBLK_IO_COMMIT_AND_FETCH_REQ
UBLK_IO_COMMIT_AND_FETCH_REQ is the only one of __ublk_ch_uring_cmd()'s switch cases that doesn't return or goto. Move the logic following the switch into this case so it also returns. Drop the now unneeded default case. Signed-off-by: Caleb Sander Mateos <[email protected]> Reviewed-by: Ming Lei <[email protected]>
1 parent a9c49c6 commit 9ce5505

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

drivers/block/ublk_drv.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2232,18 +2232,16 @@ static int __ublk_ch_uring_cmd(struct io_uring_cmd *cmd,
22322232
ret = ublk_commit_and_fetch(ubq, io, cmd, ub_cmd, issue_flags);
22332233
if (ret)
22342234
goto out;
2235-
break;
2235+
2236+
ublk_prep_cancel(cmd, issue_flags, ubq, tag);
2237+
return -EIOCBQUEUED;
22362238
case UBLK_IO_NEED_GET_DATA:
22372239
io->addr = ub_cmd->addr;
22382240
if (!ublk_get_data(ubq, io))
22392241
return -EIOCBQUEUED;
22402242

22412243
return UBLK_IO_RES_OK;
2242-
default:
2243-
goto out;
22442244
}
2245-
ublk_prep_cancel(cmd, issue_flags, ubq, tag);
2246-
return -EIOCBQUEUED;
22472245

22482246
out:
22492247
pr_devel("%s: complete: cmd op %d, tag %d ret %x io_flags %x\n",

0 commit comments

Comments
 (0)