summaryrefslogtreecommitdiff
path: root/fs/ext4
diff options
context:
space:
mode:
authorzhangjs <zachary@baishancloud.com>2019-06-20 06:41:29 +0300
committerTheodore Ts'o <tytso@mit.edu>2019-06-20 06:41:29 +0300
commitb03755ad6f33b7b8cd7312a3596a2dbf496de6e7 (patch)
tree206cf9a475b38dcc9173fcffb0e61c4ba1d66c73 /fs/ext4
parentc60990b361cc0a08e7b442a8191d89e9304c2d62 (diff)
downloadlinux-b03755ad6f33b7b8cd7312a3596a2dbf496de6e7.tar.xz
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 <zachary@baishancloud.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/inode.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index ed1d8f9ce5f9..11d7c2e403e9 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -4570,6 +4570,7 @@ static int __ext4_get_inode_loc(struct inode *inode,
struct buffer_head *bh;
struct super_block *sb = inode->i_sb;
ext4_fsblk_t block;
+ struct blk_plug plug;
int inodes_per_block, inode_offset;
iloc->bh = NULL;
@@ -4658,6 +4659,7 @@ make_io:
* If we need to do any I/O, try to pre-readahead extra
* blocks from the inode table.
*/
+ blk_start_plug(&plug);
if (EXT4_SB(sb)->s_inode_readahead_blks) {
ext4_fsblk_t b, end, table;
unsigned num;
@@ -4688,6 +4690,7 @@ make_io:
get_bh(bh);
bh->b_end_io = end_buffer_read_sync;
submit_bh(REQ_OP_READ, REQ_META | REQ_PRIO, bh);
+ blk_finish_plug(&plug);
wait_on_buffer(bh);
if (!buffer_uptodate(bh)) {
EXT4_ERROR_INODE_BLOCK(inode, block,