Loading fs/io-wq.c +10 −1 Original line number Diff line number Diff line Loading @@ -113,6 +113,8 @@ struct io_wq { struct mm_struct *mm; refcount_t refs; struct completion done; refcount_t use_refs; }; static bool io_worker_get(struct io_worker *worker) Loading Loading @@ -1073,6 +1075,7 @@ struct io_wq *io_wq_create(unsigned bounded, struct io_wq_data *data) ret = -ENOMEM; goto err; } refcount_set(&wq->use_refs, 1); reinit_completion(&wq->done); return wq; } Loading @@ -1093,7 +1096,7 @@ static bool io_wq_worker_wake(struct io_worker *worker, void *data) return false; } void io_wq_destroy(struct io_wq *wq) static void __io_wq_destroy(struct io_wq *wq) { int node; Loading @@ -1113,3 +1116,9 @@ void io_wq_destroy(struct io_wq *wq) kfree(wq->wqes); kfree(wq); } void io_wq_destroy(struct io_wq *wq) { if (refcount_dec_and_test(&wq->use_refs)) __io_wq_destroy(wq); } Loading
fs/io-wq.c +10 −1 Original line number Diff line number Diff line Loading @@ -113,6 +113,8 @@ struct io_wq { struct mm_struct *mm; refcount_t refs; struct completion done; refcount_t use_refs; }; static bool io_worker_get(struct io_worker *worker) Loading Loading @@ -1073,6 +1075,7 @@ struct io_wq *io_wq_create(unsigned bounded, struct io_wq_data *data) ret = -ENOMEM; goto err; } refcount_set(&wq->use_refs, 1); reinit_completion(&wq->done); return wq; } Loading @@ -1093,7 +1096,7 @@ static bool io_wq_worker_wake(struct io_worker *worker, void *data) return false; } void io_wq_destroy(struct io_wq *wq) static void __io_wq_destroy(struct io_wq *wq) { int node; Loading @@ -1113,3 +1116,9 @@ void io_wq_destroy(struct io_wq *wq) kfree(wq->wqes); kfree(wq); } void io_wq_destroy(struct io_wq *wq) { if (refcount_dec_and_test(&wq->use_refs)) __io_wq_destroy(wq); }