diff options
-rw-r--r-- | fs/block_dev.c | 21 | ||||
-rw-r--r-- | include/linux/fs.h | 1 |
2 files changed, 22 insertions, 0 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index c3fa19bd64df..4eeb69a88734 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -852,6 +852,27 @@ struct block_device *open_by_devnum(dev_t dev, unsigned mode) | |||
852 | 852 | ||
853 | EXPORT_SYMBOL(open_by_devnum); | 853 | EXPORT_SYMBOL(open_by_devnum); |
854 | 854 | ||
855 | /** | ||
856 | * revalidate_disk - wrapper for lower-level driver's revalidate_disk | ||
857 | * call-back | ||
858 | * | ||
859 | * @disk: struct gendisk to be revalidated | ||
860 | * | ||
861 | * This routine is a wrapper for lower-level driver's revalidate_disk | ||
862 | * call-backs. It is used to do common pre and post operations needed | ||
863 | * for all revalidate_disk operations. | ||
864 | */ | ||
865 | int revalidate_disk(struct gendisk *disk) | ||
866 | { | ||
867 | int ret = 0; | ||
868 | |||
869 | if (disk->fops->revalidate_disk) | ||
870 | ret = disk->fops->revalidate_disk(disk); | ||
871 | |||
872 | return ret; | ||
873 | } | ||
874 | EXPORT_SYMBOL(revalidate_disk); | ||
875 | |||
855 | /* | 876 | /* |
856 | * This routine checks whether a removable media has been changed, | 877 | * This routine checks whether a removable media has been changed, |
857 | * and invalidates all buffer-cache-entries in that case. This | 878 | * and invalidates all buffer-cache-entries in that case. This |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 02a9fb5a830c..d63461f97983 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -1722,6 +1722,7 @@ extern int fs_may_remount_ro(struct super_block *); | |||
1722 | */ | 1722 | */ |
1723 | #define bio_data_dir(bio) ((bio)->bi_rw & 1) | 1723 | #define bio_data_dir(bio) ((bio)->bi_rw & 1) |
1724 | 1724 | ||
1725 | extern int revalidate_disk(struct gendisk *); | ||
1725 | extern int check_disk_change(struct block_device *); | 1726 | extern int check_disk_change(struct block_device *); |
1726 | extern int __invalidate_device(struct block_device *); | 1727 | extern int __invalidate_device(struct block_device *); |
1727 | extern int invalidate_partition(struct gendisk *, int); | 1728 | extern int invalidate_partition(struct gendisk *, int); |