diff options
| author | Ming Lei <ming.lei@redhat.com> | 2025-11-01 21:31:18 +0800 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2025-11-03 08:34:59 -0700 |
| commit | c28ba6b6c51d090103800eb1c7679c32f6501dbc (patch) | |
| tree | 55b40d064749640a31ebb767fa39c8166889a224 /rust/kernel | |
| parent | 529d4d6327880e5c60f4e0def39b3faaa7954e54 (diff) | |
ublk: use struct_size() for allocation
Convert ublk_queue to use struct_size() for allocation.
Changes in this commit:
1. Update ublk_init_queue() to use struct_size(ubq, ios, depth)
instead of manual size calculation (sizeof(struct ublk_queue) +
depth * sizeof(struct ublk_io)).
This provides better type safety and makes the code more maintainable
by using standard kernel macro for flexible array handling.
Meantime annotate ublk_queue.ios by __counted_by().
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>
Diffstat (limited to 'rust/kernel')
0 files changed, 0 insertions, 0 deletions
