mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-12-29 17:25:38 +00:00
io_uring/cancel: get rid of init_hash_table() helper
All it does is initialize the lists, just move the INIT_HLIST_HEAD() into the one caller. Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
ba4366f57b
commit
8abf47a8d6
@ -232,14 +232,6 @@ int io_async_cancel(struct io_kiocb *req, unsigned int issue_flags)
|
|||||||
return IOU_OK;
|
return IOU_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_hash_table(struct io_hash_table *table, unsigned size)
|
|
||||||
{
|
|
||||||
unsigned int i;
|
|
||||||
|
|
||||||
for (i = 0; i < size; i++)
|
|
||||||
INIT_HLIST_HEAD(&table->hbs[i].list);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int __io_sync_cancel(struct io_uring_task *tctx,
|
static int __io_sync_cancel(struct io_uring_task *tctx,
|
||||||
struct io_cancel_data *cd, int fd)
|
struct io_cancel_data *cd, int fd)
|
||||||
{
|
{
|
||||||
|
@ -20,7 +20,6 @@ int io_async_cancel(struct io_kiocb *req, unsigned int issue_flags);
|
|||||||
|
|
||||||
int io_try_cancel(struct io_uring_task *tctx, struct io_cancel_data *cd,
|
int io_try_cancel(struct io_uring_task *tctx, struct io_cancel_data *cd,
|
||||||
unsigned int issue_flags);
|
unsigned int issue_flags);
|
||||||
void init_hash_table(struct io_hash_table *table, unsigned size);
|
|
||||||
|
|
||||||
int io_sync_cancel(struct io_ring_ctx *ctx, void __user *arg);
|
int io_sync_cancel(struct io_ring_ctx *ctx, void __user *arg);
|
||||||
bool io_cancel_req_match(struct io_kiocb *req, struct io_cancel_data *cd);
|
bool io_cancel_req_match(struct io_kiocb *req, struct io_cancel_data *cd);
|
||||||
|
@ -263,13 +263,15 @@ static int io_alloc_hash_table(struct io_hash_table *table, unsigned bits)
|
|||||||
{
|
{
|
||||||
unsigned hash_buckets = 1U << bits;
|
unsigned hash_buckets = 1U << bits;
|
||||||
size_t hash_size = hash_buckets * sizeof(table->hbs[0]);
|
size_t hash_size = hash_buckets * sizeof(table->hbs[0]);
|
||||||
|
int i;
|
||||||
|
|
||||||
table->hbs = kmalloc(hash_size, GFP_KERNEL);
|
table->hbs = kmalloc(hash_size, GFP_KERNEL);
|
||||||
if (!table->hbs)
|
if (!table->hbs)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
table->hash_bits = bits;
|
table->hash_bits = bits;
|
||||||
init_hash_table(table, hash_buckets);
|
for (i = 0; i < hash_buckets; i++)
|
||||||
|
INIT_HLIST_HEAD(&table->hbs[i].list);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user