diff options
author | Andrew Morton <akpm@osdl.org> | 2006-07-30 03:03:28 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-08-06 20:52:14 -0700 |
commit | b02ef087a8379fc757b894d6d2e0deff79ccdf20 (patch) | |
tree | 79be80a1e34326d9ad924a46db62227e80fae040 /fs | |
parent | cd62705f099033ea8aeeb47688f4572b3532db93 (diff) |
invalidate_bdev() speedup
We can immediately bale 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>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs')
-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 23f1f3a6807..7f6d65925de 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -473,13 +473,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); } /* |