From: Christoph Hellwig Date: Tue, 11 Jan 2022 09:15:33 +0000 (+0100) Subject: move blk_wake_io_task next to wake_up_process X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Fremove-blk_needs_flush_plug;p=users%2Fhch%2Fblock.git move blk_wake_io_task next to wake_up_process There is nothing block layer specific in blk_wake_io_task, so move it next to wake_up_process and lose the blk_ prefix. Signed-off-by: Christoph Hellwig --- diff --git a/block/fops.c b/block/fops.c index 4d0e220f379e..533a88d32d3f 100644 --- a/block/fops.c +++ b/block/fops.c @@ -48,7 +48,7 @@ static void blkdev_bio_end_io_simple(struct bio *bio) struct task_struct *waiter = bio->bi_private; WRITE_ONCE(bio->bi_private, NULL); - blk_wake_io_task(waiter); + wake_io_task(waiter); } static ssize_t __blkdev_direct_IO_simple(struct kiocb *iocb, @@ -169,7 +169,7 @@ static void blkdev_bio_end_io(struct bio *bio) struct task_struct *waiter = dio->waiter; WRITE_ONCE(dio->waiter, NULL); - blk_wake_io_task(waiter); + wake_io_task(waiter); } } diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c index 03ea367df19a..19bcfd6d3c8c 100644 --- a/fs/iomap/direct-io.c +++ b/fs/iomap/direct-io.c @@ -155,7 +155,7 @@ static void iomap_dio_bio_end_io(struct bio *bio) if (dio->wait_for_completion) { struct task_struct *waiter = dio->submit.waiter; WRITE_ONCE(dio->submit.waiter, NULL); - blk_wake_io_task(waiter); + wake_io_task(waiter); } else if (dio->flags & IOMAP_DIO_WRITE) { struct inode *inode = file_inode(dio->iocb->ki_filp); diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 56351ac48909..f0054c0ea016 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -1230,19 +1230,6 @@ extern int bdev_read_page(struct block_device *, sector_t, struct page *); extern int bdev_write_page(struct block_device *, sector_t, struct page *, struct writeback_control *); -static inline void blk_wake_io_task(struct task_struct *waiter) -{ - /* - * If we're polling, the task itself is doing the completions. For - * that case, we don't need to signal a wakeup, it's enough to just - * mark us as RUNNING. - */ - if (waiter == current) - __set_current_state(TASK_RUNNING); - else - wake_up_process(waiter); -} - unsigned long disk_start_io_acct(struct gendisk *disk, unsigned int sectors, unsigned int op); void disk_end_io_acct(struct gendisk *disk, unsigned int op, diff --git a/include/linux/sched.h b/include/linux/sched.h index 78c351e35fec..0c2b7f59ed5c 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1911,6 +1911,19 @@ extern int wake_up_state(struct task_struct *tsk, unsigned int state); extern int wake_up_process(struct task_struct *tsk); extern void wake_up_new_task(struct task_struct *tsk); +static inline void wake_io_task(struct task_struct *waiter) +{ + /* + * If we're polling, the task itself is doing the completions. For + * that case, we don't need to signal a wakeup, it's enough to just + * mark us as RUNNING. + */ + if (waiter == current) + __set_current_state(TASK_RUNNING); + else + wake_up_process(waiter); +} + #ifdef CONFIG_SMP extern void kick_process(struct task_struct *tsk); #else diff --git a/mm/page_io.c b/mm/page_io.c index 9725c7e1eeea..b7603da53b0b 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -119,7 +119,7 @@ out: WRITE_ONCE(bio->bi_private, NULL); bio_put(bio); if (waiter) { - blk_wake_io_task(waiter); + wake_io_task(waiter); put_task_struct(waiter); } }