On 2/24/25 02:56, Anuj gupta wrote:
#ifdef CONFIG_COMPAT
- if (req->ctx->compat)
+ if (io_is_compat(req->ctx))
return io_iov_compat_buffer_select_prep(rw);
#endif
Should the #ifdef CONFIG_COMPAT be removed here since io_is_compat() already
accounts for it?
We can if same is done for io_iov_compat_buffer_select_prep() and
we can prove it doesn't use anything compiled out for !COMPAT (which
seems so).
@@ -120,7 +120,7 @@ static int __io_import_iovec(int ddir, struct io_kiocb *req,
nr_segs = 1;
}
ret = __import_iovec(ddir, buf, sqe_len, nr_segs, &iov, &io->iter,
- req->ctx->compat);
+ io_is_compat(req->ctx));
Should we also update other places that use ctx->compat (e.g., rsrc.c, net.c,
uring_cmd.c) to use the new io_is_compat() helper for consistency?
That would be a wider messier change split in multiple patches, which
I was thinking to avoid. This patch is a good first step, and once
merged future changes can be made independently.
Let me see what I can do, but I don't want touching rsrc.c for now
to avoid unnecessary changes. And then more can be done to get more
code out of ifdef and let the compiler optimise it out.
--
Pavel Begunkov