Commit f3332384 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] use the queue congestion API in ext2_preread_inode()

Use the new queue congestion detector in ext2_preread_inode().  Don't
try the speculative read if the read queue is congested.

Also, don't try it if the disk is write-congested.  Presumably it is
more important to get the dirty memory cleaned out.
parent 4cef1b04
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
#include "ext2.h" #include "ext2.h"
#include <linux/quotaops.h> #include <linux/quotaops.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/backing-dev.h>
#include <linux/buffer_head.h> #include <linux/buffer_head.h>
/* /*
* ialloc.c contains the inodes allocation and deallocation routines * ialloc.c contains the inodes allocation and deallocation routines
*/ */
...@@ -169,6 +169,13 @@ static void ext2_preread_inode(struct inode *inode) ...@@ -169,6 +169,13 @@ static void ext2_preread_inode(struct inode *inode)
unsigned long block; unsigned long block;
struct buffer_head *bh; struct buffer_head *bh;
struct ext2_group_desc * gdp; struct ext2_group_desc * gdp;
struct backing_dev_info *bdi;
bdi = inode->i_mapping->backing_dev_info;
if (bdi_read_congested(bdi))
return;
if (bdi_write_congested(bdi))
return;
block_group = (inode->i_ino - 1) / EXT2_INODES_PER_GROUP(inode->i_sb); block_group = (inode->i_ino - 1) / EXT2_INODES_PER_GROUP(inode->i_sb);
gdp = ext2_get_group_desc(inode->i_sb, block_group, &bh); gdp = ext2_get_group_desc(inode->i_sb, block_group, &bh);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment