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 333a7bb4cb9c..5e23152d04ad 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -927,9 +927,9 @@ EXPORT_SYMBOL_GPL(bd_unlink_disk_holder);
927 * when a disk has been changed -- either by a media change or online 927 * when a disk has been changed -- either by a media change or online
928 * resize. 928 * resize.
929 */ 929 */
930static void flush_disk(struct block_device *bdev) 930static void flush_disk(struct block_device *bdev, bool kill_dirty)
931{ 931{
932 if (__invalidate_device(bdev)) { 932 if (__invalidate_device(bdev, kill_dirty)) {
933 char name[BDEVNAME_SIZE] = ""; 933 char name[BDEVNAME_SIZE] = "";
934 934
935 if (bdev->bd_disk) 935 if (bdev->bd_disk)
@@ -966,7 +966,7 @@ void check_disk_size_change(struct gendisk *disk, struct block_device *bdev)
966 "%s: detected capacity change from %lld to %lld\n", 966 "%s: detected capacity change from %lld to %lld\n",
967 name, bdev_size, disk_size); 967 name, bdev_size, disk_size);
968 i_size_write(bdev->bd_inode, disk_size); 968 i_size_write(bdev->bd_inode, disk_size);
969 flush_disk(bdev); 969 flush_disk(bdev, false);
970 } 970 }
971} 971}
972EXPORT_SYMBOL(check_disk_size_change); 972EXPORT_SYMBOL(check_disk_size_change);
@@ -1019,7 +1019,7 @@ int check_disk_change(struct block_device *bdev)
1019 if (!(events & DISK_EVENT_MEDIA_CHANGE)) 1019 if (!(events & DISK_EVENT_MEDIA_CHANGE))
1020 return 0; 1020 return 0;
1021 1021
1022 flush_disk(bdev); 1022 flush_disk(bdev, true);
1023 if (bdops->revalidate_disk) 1023 if (bdops->revalidate_disk)
1024 bdops->revalidate_disk(bdev->bd_disk); 1024 bdops->revalidate_disk(bdev->bd_disk);
1025 return 1; 1025 return 1;
@@ -1601,7 +1601,7 @@ fail:
1601} 1601}
1602EXPORT_SYMBOL(lookup_bdev); 1602EXPORT_SYMBOL(lookup_bdev);
1603 1603
1604int __invalidate_device(struct block_device *bdev) 1604int __invalidate_device(struct block_device *bdev, bool kill_dirty)
1605{ 1605{
1606 struct super_block *sb = get_super(bdev); 1606 struct super_block *sb = get_super(bdev);
1607 int res = 0; 1607 int res = 0;
@@ -1614,7 +1614,7 @@ int __invalidate_device(struct block_device *bdev)
1614 * hold). 1614 * hold).
1615 */ 1615 */
1616 shrink_dcache_sb(sb); 1616 shrink_dcache_sb(sb);
1617 res = invalidate_inodes(sb); 1617 res = invalidate_inodes(sb, kill_dirty);
1618 drop_super(sb); 1618 drop_super(sb);
1619 } 1619 }
1620 invalidate_bdev(bdev); 1620 invalidate_bdev(bdev);