]> git.ipfire.org Git - ipfire-2.x.git/blob - src/patches/suse-2.6.27.39/patches.drivers/bdev-resize-wrapper-for-revalidate_disk
Imported linux-2.6.27.39 suse/xen patches.
[ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.drivers / bdev-resize-wrapper-for-revalidate_disk
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
6
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.
10
11 We will use this wrapper in a later patch to adjust block device sizes
12 after an online resize (a _post_ operation).
13
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>
17 ---
18 fs/block_dev.c | 21 +++++++++++++++++++++
19 include/linux/fs.h | 1 +
20 2 files changed, 22 insertions(+)
21
22 --- a/fs/block_dev.c
23 +++ b/fs/block_dev.c
24 @@ -868,6 +868,27 @@ struct block_device *open_by_devnum(dev_
25
26 EXPORT_SYMBOL(open_by_devnum);
27
28 +/**
29 + * revalidate_disk - wrapper for lower-level driver's revalidate_disk
30 + * call-back
31 + *
32 + * @disk: struct gendisk to be revalidated
33 + *
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.
37 + */
38 +int revalidate_disk(struct gendisk *disk)
39 +{
40 + int ret = 0;
41 +
42 + if (disk->fops->revalidate_disk)
43 + ret = disk->fops->revalidate_disk(disk);
44 +
45 + return ret;
46 +}
47 +EXPORT_SYMBOL(revalidate_disk);
48 +
49 /*
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
55 */
56 #define bio_data_dir(bio) ((bio)->bi_rw & 1)
57
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);