aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/block_dev.c6
-rw-r--r--fs/buffer.c3
-rw-r--r--include/linux/buffer_head.h1
3 files changed, 6 insertions, 4 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 21e59acbcfdf..6fe49b9349ea 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -55,10 +55,12 @@ static sector_t max_block(struct block_device *bdev)
55 return retval; 55 return retval;
56} 56}
57 57
58/* Kill _all_ buffers, dirty or not.. */ 58/* Kill _all_ buffers and pagecache , dirty or not.. */
59static void kill_bdev(struct block_device *bdev) 59static void kill_bdev(struct block_device *bdev)
60{ 60{
61 invalidate_bdev(bdev); 61 if (bdev->bd_inode->i_mapping->nrpages == 0)
62 return;
63 invalidate_bh_lrus();
62 truncate_inode_pages(bdev->bd_inode->i_mapping, 0); 64 truncate_inode_pages(bdev->bd_inode->i_mapping, 0);
63} 65}
64 66
diff --git a/fs/buffer.c b/fs/buffer.c
index 630df3e6fe0c..80291aad6de6 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -44,7 +44,6 @@
44#include <linux/bit_spinlock.h> 44#include <linux/bit_spinlock.h>
45 45
46static int fsync_buffers_list(spinlock_t *lock, struct list_head *list); 46static int fsync_buffers_list(spinlock_t *lock, struct list_head *list);
47static void invalidate_bh_lrus(void);
48 47
49#define BH_ENTRY(list) list_entry((list), struct buffer_head, b_assoc_buffers) 48#define BH_ENTRY(list) list_entry((list), struct buffer_head, b_assoc_buffers)
50 49
@@ -1403,7 +1402,7 @@ static void invalidate_bh_lru(void *arg)
1403 put_cpu_var(bh_lrus); 1402 put_cpu_var(bh_lrus);
1404} 1403}
1405 1404
1406static void invalidate_bh_lrus(void) 1405void invalidate_bh_lrus(void)
1407{ 1406{
1408 on_each_cpu(invalidate_bh_lru, NULL, 1, 1); 1407 on_each_cpu(invalidate_bh_lru, NULL, 1, 1);
1409} 1408}
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 632c50b21386..5c6e12853a9b 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -182,6 +182,7 @@ void __brelse(struct buffer_head *);
182void __bforget(struct buffer_head *); 182void __bforget(struct buffer_head *);
183void __breadahead(struct block_device *, sector_t block, unsigned int size); 183void __breadahead(struct block_device *, sector_t block, unsigned int size);
184struct buffer_head *__bread(struct block_device *, sector_t block, unsigned size); 184struct buffer_head *__bread(struct block_device *, sector_t block, unsigned size);
185void invalidate_bh_lrus(void);
185struct buffer_head *alloc_buffer_head(gfp_t gfp_flags); 186struct buffer_head *alloc_buffer_head(gfp_t gfp_flags);
186void free_buffer_head(struct buffer_head * bh); 187void free_buffer_head(struct buffer_head * bh);
187void FASTCALL(unlock_buffer(struct buffer_head *bh)); 188void FASTCALL(unlock_buffer(struct buffer_head *bh));