Skip to content

Commit b03755a

Browse files
zhangjstytso
authored andcommitted
ext4: make __ext4_get_inode_loc plug
Add a blk_plug to prevent the inode table readahead from being submitted as small I/O requests. Signed-off-by: zhangjs <[email protected]> Signed-off-by: Theodore Ts'o <[email protected]> Reviewed-by: Jan Kara <[email protected]>
1 parent c60990b commit b03755a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/ext4/inode.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4570,6 +4570,7 @@ static int __ext4_get_inode_loc(struct inode *inode,
45704570
struct buffer_head *bh;
45714571
struct super_block *sb = inode->i_sb;
45724572
ext4_fsblk_t block;
4573+
struct blk_plug plug;
45734574
int inodes_per_block, inode_offset;
45744575

45754576
iloc->bh = NULL;
@@ -4658,6 +4659,7 @@ static int __ext4_get_inode_loc(struct inode *inode,
46584659
* If we need to do any I/O, try to pre-readahead extra
46594660
* blocks from the inode table.
46604661
*/
4662+
blk_start_plug(&plug);
46614663
if (EXT4_SB(sb)->s_inode_readahead_blks) {
46624664
ext4_fsblk_t b, end, table;
46634665
unsigned num;
@@ -4688,6 +4690,7 @@ static int __ext4_get_inode_loc(struct inode *inode,
46884690
get_bh(bh);
46894691
bh->b_end_io = end_buffer_read_sync;
46904692
submit_bh(REQ_OP_READ, REQ_META | REQ_PRIO, bh);
4693+
blk_finish_plug(&plug);
46914694
wait_on_buffer(bh);
46924695
if (!buffer_uptodate(bh)) {
46934696
EXT4_ERROR_INODE_BLOCK(inode, block,

0 commit comments

Comments
 (0)