From: Mohammed Anees Date: Tue, 12 Nov 2024 11:38:34 +0000 (+0530) Subject: fs:aio: Remove TODO comment suggesting hash or array usage in io_cancel() X-Git-Tag: v6.13-rc1~229^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c4d7d90747f4e8b528c8cd0a2d9ac01dc4a9339e;p=thirdparty%2Fkernel%2Flinux.git 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 Link: https://lore.kernel.org/r/20241112113906.15825-1-pvmohammedanees2003@gmail.com Reviewed-by: Jan Kara Signed-off-by: Christian Brauner --- diff --git a/fs/aio.c b/fs/aio.c index e8920178b50f7..72e3970f42256 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -2191,7 +2191,6 @@ SYSCALL_DEFINE3(io_cancel, aio_context_t, ctx_id, struct iocb __user *, iocb, return -EINVAL; spin_lock_irq(&ctx->ctx_lock); - /* TODO: use a hash or array, this sucks. */ list_for_each_entry(kiocb, &ctx->active_reqs, ki_list) { if (kiocb->ki_res.obj == obj) { ret = kiocb->ki_cancel(&kiocb->rw);