Commit 7e890c37 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

block: add a return value to set_capacity_revalidate_and_notify

Return if the function ended up sending an uevent or not.

Cc: stable@vger.kernel.org # v5.9
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarPetr Vorel <pvorel@suse.cz>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 2bd645b2
...@@ -49,7 +49,7 @@ static void disk_release_events(struct gendisk *disk); ...@@ -49,7 +49,7 @@ static void disk_release_events(struct gendisk *disk);
* Set disk capacity and notify if the size is not currently * Set disk capacity and notify if the size is not currently
* zero and will not be set to zero * zero and will not be set to zero
*/ */
void set_capacity_revalidate_and_notify(struct gendisk *disk, sector_t size, bool set_capacity_revalidate_and_notify(struct gendisk *disk, sector_t size,
bool update_bdev) bool update_bdev)
{ {
sector_t capacity = get_capacity(disk); sector_t capacity = get_capacity(disk);
...@@ -62,7 +62,10 @@ void set_capacity_revalidate_and_notify(struct gendisk *disk, sector_t size, ...@@ -62,7 +62,10 @@ void set_capacity_revalidate_and_notify(struct gendisk *disk, sector_t size,
char *envp[] = { "RESIZE=1", NULL }; char *envp[] = { "RESIZE=1", NULL };
kobject_uevent_env(&disk_to_dev(disk)->kobj, KOBJ_CHANGE, envp); kobject_uevent_env(&disk_to_dev(disk)->kobj, KOBJ_CHANGE, envp);
return true;
} }
return false;
} }
EXPORT_SYMBOL_GPL(set_capacity_revalidate_and_notify); EXPORT_SYMBOL_GPL(set_capacity_revalidate_and_notify);
......
...@@ -315,7 +315,7 @@ static inline int get_disk_ro(struct gendisk *disk) ...@@ -315,7 +315,7 @@ static inline int get_disk_ro(struct gendisk *disk)
extern void disk_block_events(struct gendisk *disk); extern void disk_block_events(struct gendisk *disk);
extern void disk_unblock_events(struct gendisk *disk); extern void disk_unblock_events(struct gendisk *disk);
extern void disk_flush_events(struct gendisk *disk, unsigned int mask); extern void disk_flush_events(struct gendisk *disk, unsigned int mask);
void set_capacity_revalidate_and_notify(struct gendisk *disk, sector_t size, bool set_capacity_revalidate_and_notify(struct gendisk *disk, sector_t size,
bool update_bdev); bool update_bdev);
/* drivers/char/random.c */ /* drivers/char/random.c */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment