Re: [PATCH 1/2] block: add a return value to set_capacity_revalidate_and_notify

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Christoph,

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

> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
Reviewed-by: Petr Vorel <pvorel@xxxxxxx>

Kind regards,
Petr
> ---
>  block/genhd.c         | 5 ++++-
>  include/linux/genhd.h | 2 +-
>  2 files changed, 5 insertions(+), 2 deletions(-)

> diff --git a/block/genhd.c b/block/genhd.c
> index 0a273211fec283..9387f050c248a7 100644
> --- a/block/genhd.c
> +++ b/block/genhd.c
> @@ -49,7 +49,7 @@ static void disk_release_events(struct gendisk *disk);
>   * Set disk capacity and notify if the size is not currently
>   * 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)
>  {
>  	sector_t capacity = get_capacity(disk);
> @@ -62,7 +62,10 @@ void set_capacity_revalidate_and_notify(struct gendisk *disk, sector_t size,
>  		char *envp[] = { "RESIZE=1", NULL };

>  		kobject_uevent_env(&disk_to_dev(disk)->kobj, KOBJ_CHANGE, envp);
> +		return true;
>  	}
> +
> +	return false;
>  }

>  EXPORT_SYMBOL_GPL(set_capacity_revalidate_and_notify);
> diff --git a/include/linux/genhd.h b/include/linux/genhd.h
> index 38f23d75701379..03da3f603d309c 100644
> --- a/include/linux/genhd.h
> +++ b/include/linux/genhd.h
> @@ -315,7 +315,7 @@ static inline int get_disk_ro(struct gendisk *disk)
>  extern void disk_block_events(struct gendisk *disk);
>  extern void disk_unblock_events(struct gendisk *disk);
>  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);

>  /* drivers/char/random.c */



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux