engines/io_uring_cmd: allocate enough ranges for async trims
authorVincent Fu <vincent.fu@samsung.com>
Wed, 25 Oct 2023 18:47:45 +0000 (18:47 +0000)
committerVincent Fu <vincent.fu@samsung.com>
Wed, 25 Oct 2023 19:34:38 +0000 (15:34 -0400)
commitecc734c6b20f2d1729f0da45fb1490ca092f7e85
tree8303e452fbfbf3b7fd0a514fdd230343727aecd4
parentc11e22e92f3796f21eb15eb6ddc1614d9fa4f99d
engines/io_uring_cmd: allocate enough ranges for async trims

We round up the iodepth to the next highest power of 2. So io_u->index
can be greater than the iodepth specified by the user. Make sure we
allocate enough of the buffers used to store the ranges for async trim
commands when the iodepth specified by the user is not a power of 2.

Fixes: 4885a6eba420ce216e4102df3e42229e167d1b7b ("engines/io_uring_cmd:
make trims async")
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
engines/io_uring.c