summaryrefslogtreecommitdiffstats
path: root/fs/block_dev.c
diff options
context:
space:
mode:
authorAndrew Patterson <andrew.patterson@hp.com>2008-09-04 22:27:20 +0200
committerJens Axboe <jens.axboe@oracle.com>2008-10-09 08:56:12 +0200
commit0c002c2f74e10baa9021d3ecc50585c6eafea568 (patch)
treec7d29fe0968b852f798f78bbd9231df155c56180 /fs/block_dev.c
parentblock: fix duplicate headers for /proc/partitions (diff)
downloadlinux-0c002c2f74e10baa9021d3ecc50585c6eafea568.tar.xz
linux-0c002c2f74e10baa9021d3ecc50585c6eafea568.zip
Wrapper for lower-level revalidate_disk routines.
This is a wrapper for the lower-level revalidate_disk call-backs such as sd_revalidate_disk(). It allows us to perform pre and post operations when calling them. We will use this wrapper in a later patch to adjust block device sizes after an online resize (a _post_ operation). Signed-off-by: Andrew Patterson <andrew.patterson@hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'fs/block_dev.c')
-rw-r--r--fs/block_dev.c21
1 files changed, 21 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)
EXPORT_SYMBOL(open_by_devnum);
+/**
+ * revalidate_disk - wrapper for lower-level driver's revalidate_disk
+ * call-back
+ *
+ * @disk: struct gendisk to be revalidated
+ *
+ * This routine is a wrapper for lower-level driver's revalidate_disk
+ * call-backs. It is used to do common pre and post operations needed
+ * for all revalidate_disk operations.
+ */
+int revalidate_disk(struct gendisk *disk)
+{
+ int ret = 0;
+
+ if (disk->fops->revalidate_disk)
+ ret = disk->fops->revalidate_disk(disk);
+
+ return ret;
+}
+EXPORT_SYMBOL(revalidate_disk);
+
/*
* This routine checks whether a removable media has been changed,
* and invalidates all buffer-cache-entries in that case. This