diff options
author | Christoph Hellwig <hch@lst.de> | 2023-01-25 07:58:38 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-01-26 10:30:56 -0700 |
commit | 439bc39b3cf0014b1b75075812f7ef0f8baa9674 (patch) | |
tree | 4bd20b14a92e4d1c88b7f666e4f50ef4056a64d7 /fs/direct-io.c | |
parent | 2241ab53cbb5cdb08a6b2d4688feb13971058f65 (diff) |
fs: move sb_init_dio_done_wq out of direct-io.c
sb_init_dio_done_wq is also used by the iomap code, so move it to
super.c in preparation for building direct-io.c conditionally.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20230125065839.191256-2-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/direct-io.c')
-rw-r--r-- | fs/direct-io.c | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/fs/direct-io.c b/fs/direct-io.c index 03d381377ae1..ab0d7ea89813 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c @@ -558,30 +558,6 @@ static inline int dio_bio_reap(struct dio *dio, struct dio_submit *sdio) return ret; } -/* - * Create workqueue for deferred direct IO completions. We allocate the - * workqueue when it's first needed. This avoids creating workqueue for - * filesystems that don't need it and also allows us to create the workqueue - * late enough so the we can include s_id in the name of the workqueue. - */ -int sb_init_dio_done_wq(struct super_block *sb) -{ - struct workqueue_struct *old; - struct workqueue_struct *wq = alloc_workqueue("dio/%s", - WQ_MEM_RECLAIM, 0, - sb->s_id); - if (!wq) - return -ENOMEM; - /* - * This has to be atomic as more DIOs can race to create the workqueue - */ - old = cmpxchg(&sb->s_dio_done_wq, NULL, wq); - /* Someone created workqueue before us? Free ours... */ - if (old) - destroy_workqueue(wq); - return 0; -} - static int dio_set_defer_completion(struct dio *dio) { struct super_block *sb = dio->inode->i_sb; |