VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Pavel Begunkov <asml.silence@gmail.com> 2020-01-28 03:15:47 +0300 committer: Jens Axboe <axboe@kernel.dk> 2020-01-28 17:44:40 -0700 commit: eba6f5a330cf042bb0001f0b5e8cbf21be1b25d6 parent: cccf0ee834559ae0b327b40290e14f6a2a017177
Commit Summary:
io-wq: allow grabbing existing io-wq
Diffstat:
1 file changed, 7 insertions, 0 deletions
diff --git a/fs/io-wq.c b/fs/io-wq.c
index 7ccedc82a703..f7eb577ccd2d 100644
--- a/fs/io-wq.c
+++ b/fs/io-wq.c
@@ -1114,6 +1114,14 @@ err:
 	return ERR_PTR(ret);
 }
 
+bool io_wq_get(struct io_wq *wq, struct io_wq_data *data)
+{
+	if (data->get_work != wq->get_work || data->put_work != wq->put_work)
+		return false;
+
+	return refcount_inc_not_zero(&wq->use_refs);
+}
+
 static bool io_wq_worker_wake(struct io_worker *worker, void *data)
 {
 	wake_up_process(worker->task);