diff options
author | Gabriel Krisman Bertazi <krisman@suse.de> | 2024-12-16 15:46:14 -0500 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-12-27 10:08:11 -0700 |
commit | ef623a647f423c0d96aa75797cec182e3c5ba47d (patch) | |
tree | 048e7e5f3c2f655ae9e671abc28ead6b87063927 /io_uring/waitid.c | |
parent | d7f11616edf59b255f1302040604f584535876c7 (diff) |
io_uring: Move old async data allocation helper to header
There are two remaining uses of the old async data allocator that do not
rely on the alloc cache. I don't want to make them use the new
allocator helper because that would require a if(cache) check, which
will result in dead code for the cached case (for callers passing a
cache, gcc can't prove the cache isn't NULL, and will therefore preserve
the check. Since this is an inline function and just a few lines long,
keep a second helper to deal with cases where we don't have an async
data cache.
No functional change intended here. This is just moving the helper
around and making it inline.
Signed-off-by: Gabriel Krisman Bertazi <krisman@suse.de>
Link: https://lore.kernel.org/r/20241216204615.759089-9-krisman@suse.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/waitid.c')
-rw-r--r-- | io_uring/waitid.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/io_uring/waitid.c b/io_uring/waitid.c index daef5dd644f0..6778c0ee76c4 100644 --- a/io_uring/waitid.c +++ b/io_uring/waitid.c @@ -303,10 +303,10 @@ int io_waitid(struct io_kiocb *req, unsigned int issue_flags) struct io_waitid_async *iwa; int ret; - if (io_alloc_async_data(req)) + iwa = io_uring_alloc_async_data_nocache(req); + if (!iwa) return -ENOMEM; - iwa = req->async_data; iwa->req = req; ret = kernel_waitid_prepare(&iwa->wo, iw->which, iw->upid, &iw->info, |