1 ext4: make __ext4_get_inode_loc plug
3 From: zhangjs <zachary@baishancloud.com>
5 Add a blk_plug to prevent the inode table readahead from being
6 submitted as small I/O requests.
8 Signed-off-by: zhangjs <zachary@baishancloud.com>
9 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 Reviewed-by: Jan Kara <jack@suse.cz>
12 fs/ext4/inode.c | 3 +++
13 1 file changed, 3 insertions(+)
15 diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
16 index ed1d8f9ce5f9..11d7c2e403e9 100644
19 @@ -4570,6 +4570,7 @@ static int __ext4_get_inode_loc(struct inode *inode,
20 struct buffer_head *bh;
21 struct super_block *sb = inode->i_sb;
23 + struct blk_plug plug;
24 int inodes_per_block, inode_offset;
27 @@ -4658,6 +4659,7 @@ static int __ext4_get_inode_loc(struct inode *inode,
28 * If we need to do any I/O, try to pre-readahead extra
29 * blocks from the inode table.
31 + blk_start_plug(&plug);
32 if (EXT4_SB(sb)->s_inode_readahead_blks) {
33 ext4_fsblk_t b, end, table;
35 @@ -4688,6 +4690,7 @@ static int __ext4_get_inode_loc(struct inode *inode,
37 bh->b_end_io = end_buffer_read_sync;
38 submit_bh(REQ_OP_READ, REQ_META | REQ_PRIO, bh);
39 + blk_finish_plug(&plug);
41 if (!buffer_uptodate(bh)) {
42 EXT4_ERROR_INODE_BLOCK(inode, block,