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.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 94d41db62004..f05bf16cd979 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -933,9 +933,9 @@ EXPORT_SYMBOL_GPL(bd_unlink_disk_holder);
933 * when a disk has been changed -- either by a media change or online 933 * when a disk has been changed -- either by a media change or online
934 * resize. 934 * resize.
935 */ 935 */
936static void flush_disk(struct block_device *bdev) 936static void flush_disk(struct block_device *bdev, bool kill_dirty)
937{ 937{
938 if (__invalidate_device(bdev)) { 938 if (__invalidate_device(bdev, kill_dirty)) {
939 char name[BDEVNAME_SIZE] = ""; 939 char name[BDEVNAME_SIZE] = "";
940 940
941 if (bdev->bd_disk) 941 if (bdev->bd_disk)
@@ -972,7 +972,7 @@ void check_disk_size_change(struct gendisk *disk, struct block_device *bdev)
972 "%s: detected capacity change from %lld to %lld\n", 972 "%s: detected capacity change from %lld to %lld\n",
973 name, bdev_size, disk_size); 973 name, bdev_size, disk_size);
974 i_size_write(bdev->bd_inode, disk_size); 974 i_size_write(bdev->bd_inode, disk_size);
975 flush_disk(bdev); 975 flush_disk(bdev, false);
976 } 976 }
977} 977}
978EXPORT_SYMBOL(check_disk_size_change); 978EXPORT_SYMBOL(check_disk_size_change);
@@ -1025,7 +1025,7 @@ int check_disk_change(struct block_device *bdev)
1025 if (!(events & DISK_EVENT_MEDIA_CHANGE)) 1025 if (!(events & DISK_EVENT_MEDIA_CHANGE))
1026 return 0; 1026 return 0;
1027 1027
1028 flush_disk(bdev); 1028 flush_disk(bdev, true);
1029 if (bdops->revalidate_disk) 1029 if (bdops->revalidate_disk)
1030 bdops->revalidate_disk(bdev->bd_disk); 1030 bdops->revalidate_disk(bdev->bd_disk);
1031 return 1; 1031 return 1;
@@ -1606,7 +1606,7 @@ fail:
1606} 1606}
1607EXPORT_SYMBOL(lookup_bdev); 1607EXPORT_SYMBOL(lookup_bdev);
1608 1608
1609int __invalidate_device(struct block_device *bdev) 1609int __invalidate_device(struct block_device *bdev, bool kill_dirty)
1610{ 1610{
1611 struct super_block *sb = get_super(bdev); 1611 struct super_block *sb = get_super(bdev);
1612 int res = 0; 1612 int res = 0;
@@ -1619,7 +1619,7 @@ int __invalidate_device(struct block_device *bdev)
1619 * hold). 1619 * hold).
1620 */ 1620 */
1621 shrink_dcache_sb(sb); 1621 shrink_dcache_sb(sb);
1622 res = invalidate_inodes(sb); 1622 res = invalidate_inodes(sb, kill_dirty);
1623 drop_super(sb); 1623 drop_super(sb);
1624 } 1624 }
1625 invalidate_bdev(bdev); 1625 invalidate_bdev(bdev);