1 ext4: remove ext4_ioend_wait()
3 From: Jan Kara <jack@suse.cz>
5 Now that we clear PageWriteback after extent conversion, there's no
6 need to wait for io_end processing in ext4_evict_inode(). Running
7 AIO/DIO keeps file reference until aio_complete() is called so
8 ext4_evict_inode() cannot be called. For io_end structures resulting
9 from buffered IO waiting is happening because we wait for
10 PageWriteback in truncate_inode_pages().
12 Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
13 Signed-off-by: Jan Kara <jack@suse.cz>
14 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
17 fs/ext4/inode.c | 5 +++--
18 fs/ext4/page-io.c | 19 -------------------
19 3 files changed, 3 insertions(+), 22 deletions(-)
21 diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
22 index c161746..cc4904d 100644
25 @@ -2653,7 +2653,6 @@ extern int ext4_move_extents(struct file *o_filp, struct file *d_filp,
27 extern int __init ext4_init_pageio(void);
28 extern void ext4_exit_pageio(void);
29 -extern void ext4_ioend_shutdown(struct inode *);
30 extern ext4_io_end_t *ext4_init_io_end(struct inode *inode, gfp_t flags);
31 extern ext4_io_end_t *ext4_get_io_end(ext4_io_end_t *io_end);
32 extern int ext4_put_io_end(ext4_io_end_t *io_end);
33 diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
34 index c55b09a..ec12da2 100644
37 @@ -218,7 +218,8 @@ void ext4_evict_inode(struct inode *inode)
38 filemap_write_and_wait(&inode->i_data);
40 truncate_inode_pages(&inode->i_data, 0);
41 - ext4_ioend_shutdown(inode);
43 + WARN_ON(atomic_read(&EXT4_I(inode)->i_ioend_count));
47 @@ -228,8 +229,8 @@ void ext4_evict_inode(struct inode *inode)
48 if (ext4_should_order_data(inode))
49 ext4_begin_ordered_truncate(inode, 0);
50 truncate_inode_pages(&inode->i_data, 0);
51 - ext4_ioend_shutdown(inode);
53 + WARN_ON(atomic_read(&EXT4_I(inode)->i_ioend_count));
54 if (is_bad_inode(inode))
57 diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
58 index 6ee5bd3..ce8c15a 100644
59 --- a/fs/ext4/page-io.c
60 +++ b/fs/ext4/page-io.c
61 @@ -46,25 +46,6 @@ void ext4_exit_pageio(void)
65 - * This function is called by ext4_evict_inode() to make sure there is
66 - * no more pending I/O completion work left to do.
68 -void ext4_ioend_shutdown(struct inode *inode)
70 - wait_queue_head_t *wq = ext4_ioend_wq(inode);
72 - wait_event(*wq, (atomic_read(&EXT4_I(inode)->i_ioend_count) == 0));
74 - * We need to make sure the work structure is finished being
75 - * used before we let the inode get destroyed.
77 - if (work_pending(&EXT4_I(inode)->i_rsv_conversion_work))
78 - cancel_work_sync(&EXT4_I(inode)->i_rsv_conversion_work);
79 - if (work_pending(&EXT4_I(inode)->i_unrsv_conversion_work))
80 - cancel_work_sync(&EXT4_I(inode)->i_unrsv_conversion_work);
84 * Print an buffer I/O error compatible with the fs/buffer.c. This
85 * provides compatibility with dmesg scrapers that look for a specific
86 * buffer I/O error message. We really need a unified error reporting