Skip to content

Commit e37dfc0

Browse files
committed
io_uring/io-wq: move hash helpers to the top
Just in preparation for using them higher up in the function, move these generic helpers. Signed-off-by: Jens Axboe <[email protected]>
1 parent 28be240 commit e37dfc0

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

io_uring/io-wq.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,16 @@ static bool io_acct_cancel_pending_work(struct io_wq *wq,
150150
static void create_worker_cb(struct callback_head *cb);
151151
static void io_wq_cancel_tw_create(struct io_wq *wq);
152152

153+
static inline unsigned int __io_get_work_hash(unsigned int work_flags)
154+
{
155+
return work_flags >> IO_WQ_HASH_SHIFT;
156+
}
157+
158+
static inline unsigned int io_get_work_hash(struct io_wq_work *work)
159+
{
160+
return __io_get_work_hash(atomic_read(&work->flags));
161+
}
162+
153163
static bool io_worker_get(struct io_worker *worker)
154164
{
155165
return refcount_inc_not_zero(&worker->ref);
@@ -454,16 +464,6 @@ static void __io_worker_idle(struct io_wq_acct *acct, struct io_worker *worker)
454464
}
455465
}
456466

457-
static inline unsigned int __io_get_work_hash(unsigned int work_flags)
458-
{
459-
return work_flags >> IO_WQ_HASH_SHIFT;
460-
}
461-
462-
static inline unsigned int io_get_work_hash(struct io_wq_work *work)
463-
{
464-
return __io_get_work_hash(atomic_read(&work->flags));
465-
}
466-
467467
static bool io_wait_on_hash(struct io_wq *wq, unsigned int hash)
468468
{
469469
bool ret = false;

0 commit comments

Comments
 (0)