diff options
author | Andrew Morton <akpm@osdl.org> | 2006-07-30 14:03:28 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-08-01 00:28:38 +0400 |
commit | 0e1dfc66b6ec94984a4778132147a8aa36461d58 (patch) | |
tree | 225a8e044e021a5a337704bc1f5ea862a5f75375 /fs/buffer.c | |
parent | a268cefebceeb2046dfdfa301f041c2468536852 (diff) | |
download | linux-0e1dfc66b6ec94984a4778132147a8aa36461d58.tar.xz |
[PATCH] invalidate_bdev() speedup
We can immediately bail from invalidate_bdev() if the blockdev has no
pagecache.
This solves the huge IPI storms which hald is causing on the big ia64
machines when it polls CDROM drives.
Acked-by: Jes Sorensen <jes@sgi.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/buffer.c')
-rw-r--r-- | fs/buffer.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/buffer.c b/fs/buffer.c index 3660dcb97591..71649ef9b658 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -470,13 +470,18 @@ out: pass does the actual I/O. */ void invalidate_bdev(struct block_device *bdev, int destroy_dirty_buffers) { + struct address_space *mapping = bdev->bd_inode->i_mapping; + + if (mapping->nrpages == 0) + return; + invalidate_bh_lrus(); /* * FIXME: what about destroy_dirty_buffers? * We really want to use invalidate_inode_pages2() for * that, but not until that's cleaned up. */ - invalidate_inode_pages(bdev->bd_inode->i_mapping); + invalidate_inode_pages(mapping); } /* |