aboutsummaryrefslogtreecommitdiffstats
path: root/fs/block_dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/block_dev.c')
-rw-r--r--fs/block_dev.c6
1 files changed, 4 insertions, 2 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