Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring/alloc_cache: get rid of _nocache() helper

Just allow passing in NULL for the cache, if the type in question
doesn't have a cache associated with it.

Signed-off-by: Jens Axboe <axboe@kernel.dk>

+9 -13
+7 -11
io_uring/io_uring.h
··· 228 228 static inline void *io_uring_alloc_async_data(struct io_alloc_cache *cache, 229 229 struct io_kiocb *req) 230 230 { 231 - req->async_data = io_cache_alloc(cache, GFP_KERNEL); 232 - if (req->async_data) 233 - req->flags |= REQ_F_ASYNC_DATA; 234 - return req->async_data; 235 - } 231 + if (cache) { 232 + req->async_data = io_cache_alloc(cache, GFP_KERNEL); 233 + } else { 234 + const struct io_issue_def *def = &io_issue_defs[req->opcode]; 236 235 237 - static inline void *io_uring_alloc_async_data_nocache(struct io_kiocb *req) 238 - { 239 - const struct io_issue_def *def = &io_issue_defs[req->opcode]; 240 - 241 - WARN_ON_ONCE(!def->async_size); 242 - req->async_data = kmalloc(def->async_size, GFP_KERNEL); 236 + WARN_ON_ONCE(!def->async_size); 237 + req->async_data = kmalloc(def->async_size, GFP_KERNEL); 238 + } 243 239 if (req->async_data) 244 240 req->flags |= REQ_F_ASYNC_DATA; 245 241 return req->async_data;
+1 -1
io_uring/timeout.c
··· 544 544 545 545 if (WARN_ON_ONCE(req_has_async_data(req))) 546 546 return -EFAULT; 547 - data = io_uring_alloc_async_data_nocache(req); 547 + data = io_uring_alloc_async_data(NULL, req); 548 548 if (!data) 549 549 return -ENOMEM; 550 550 data->req = req;
+1 -1
io_uring/waitid.c
··· 303 303 struct io_waitid_async *iwa; 304 304 int ret; 305 305 306 - iwa = io_uring_alloc_async_data_nocache(req); 306 + iwa = io_uring_alloc_async_data(NULL, req); 307 307 if (!iwa) 308 308 return -ENOMEM; 309 309