Skip to content

Commit c4d7d90

Browse files
donutAneesbrauner
authored andcommitted
fs:aio: Remove TODO comment suggesting hash or array usage in io_cancel()
The comment suggests a hash or array approach to store the active requests. Currently it iterates through all the active requests and when found deletes the requested request, in the linked list. However io_cancel() isn’t a frequently used operation, and optimizing it wouldn’t bring a substantial benefit to real users and the increased complexity of maintaining a hashtable for this would be significant and will slow down other operation. Therefore remove this TODO to avoid people spending time improving this. Signed-off-by: Mohammed Anees <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Jan Kara <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent 1c82587 commit c4d7d90

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

fs/aio.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2191,7 +2191,6 @@ SYSCALL_DEFINE3(io_cancel, aio_context_t, ctx_id, struct iocb __user *, iocb,
21912191
return -EINVAL;
21922192

21932193
spin_lock_irq(&ctx->ctx_lock);
2194-
/* TODO: use a hash or array, this sucks. */
21952194
list_for_each_entry(kiocb, &ctx->active_reqs, ki_list) {
21962195
if (kiocb->ki_res.obj == obj) {
21972196
ret = kiocb->ki_cancel(&kiocb->rw);

0 commit comments

Comments
 (0)