1 Subject: Wrapper for lower-level revalidate_disk routines.
2 From: Andrew Patterson <andrew.patterson@hp.com>
3 Date: Thu Oct 9 08:56:12 2008 +0200:
4 Git: 0c002c2f74e10baa9021d3ecc50585c6eafea568
5 References: FATE#302348,FATE#303786
7 This is a wrapper for the lower-level revalidate_disk call-backs such
8 as sd_revalidate_disk(). It allows us to perform pre and post
9 operations when calling them.
11 We will use this wrapper in a later patch to adjust block device sizes
12 after an online resize (a _post_ operation).
14 Signed-off-by: Andrew Patterson <andrew.patterson@hp.com>
15 Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 Signed-off-by: Hannes Reinecke <hare@suse.de>
18 fs/block_dev.c | 21 +++++++++++++++++++++
19 include/linux/fs.h | 1 +
20 2 files changed, 22 insertions(+)
24 @@ -868,6 +868,27 @@ struct block_device *open_by_devnum(dev_
26 EXPORT_SYMBOL(open_by_devnum);
29 + * revalidate_disk - wrapper for lower-level driver's revalidate_disk
32 + * @disk: struct gendisk to be revalidated
34 + * This routine is a wrapper for lower-level driver's revalidate_disk
35 + * call-backs. It is used to do common pre and post operations needed
36 + * for all revalidate_disk operations.
38 +int revalidate_disk(struct gendisk *disk)
42 + if (disk->fops->revalidate_disk)
43 + ret = disk->fops->revalidate_disk(disk);
47 +EXPORT_SYMBOL(revalidate_disk);
50 * This routine checks whether a removable media has been changed,
51 * and invalidates all buffer-cache-entries in that case. This
52 --- a/include/linux/fs.h
53 +++ b/include/linux/fs.h
54 @@ -1742,6 +1742,7 @@ extern int fs_may_remount_ro(struct supe
56 #define bio_data_dir(bio) ((bio)->bi_rw & 1)
58 +extern int revalidate_disk(struct gendisk *);
59 extern int check_disk_change(struct block_device *);
60 extern int __invalidate_device(struct block_device *);
61 extern int invalidate_partition(struct gendisk *, int);