mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
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>
This commit is contained in:
parent
243294dae0
commit
0c002c2f74
@ -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
|
||||
|
@ -1722,6 +1722,7 @@ extern int fs_may_remount_ro(struct super_block *);
|
||||
*/
|
||||
#define bio_data_dir(bio) ((bio)->bi_rw & 1)
|
||||
|
||||
extern int revalidate_disk(struct gendisk *);
|
||||
extern int check_disk_change(struct block_device *);
|
||||
extern int __invalidate_device(struct block_device *);
|
||||
extern int invalidate_partition(struct gendisk *, int);
|
||||
|
Loading…
Reference in New Issue
Block a user