[PATCH v2 12/35] ubi: introduce a interface to get cdev in ubi_volume

Richard Weinberger richard at nod.at
Mon Aug 3 13:56:37 PDT 2015


Am 30.07.2015 um 07:48 schrieb Dongsheng Yang:
> We want to fill the sb->s_cdev in ubifs_fill_super(),
> so, we need to add a interface in ubi to get the cdev
> of an ubi_volume.
> 
> Signed-off-by: Dongsheng Yang <yangds.fnst at cn.fujitsu.com>
> ---
>  drivers/mtd/ubi/kapi.c  | 6 ++++++
>  include/linux/mtd/ubi.h | 1 +
>  2 files changed, 7 insertions(+)
> 
> diff --git a/drivers/mtd/ubi/kapi.c b/drivers/mtd/ubi/kapi.c
> index e844887..d3d1982 100644
> --- a/drivers/mtd/ubi/kapi.c
> +++ b/drivers/mtd/ubi/kapi.c
> @@ -862,3 +862,9 @@ int ubi_unregister_volume_notifier(struct notifier_block *nb)
>  	return blocking_notifier_chain_unregister(&ubi_notifiers, nb);
>  }
>  EXPORT_SYMBOL_GPL(ubi_unregister_volume_notifier);
> +
> +inline struct cdev *ubi_get_volume_cdev(struct ubi_volume_desc *desc)
> +{
> +	return &(desc->vol->cdev);
> +}
> +EXPORT_SYMBOL_GPL(ubi_get_volume_cdev);
> diff --git a/include/linux/mtd/ubi.h b/include/linux/mtd/ubi.h
> index 1e271cb..301c6e9 100644
> --- a/include/linux/mtd/ubi.h
> +++ b/include/linux/mtd/ubi.h
> @@ -261,6 +261,7 @@ int ubi_leb_map(struct ubi_volume_desc *desc, int lnum);
>  int ubi_is_mapped(struct ubi_volume_desc *desc, int lnum);
>  int ubi_sync(int ubi_num);
>  int ubi_flush(int ubi_num, int vol_id, int lnum);
> +struct cdev *ubi_get_volume_cdev(struct ubi_volume_desc *desc);
>  
>  /*
>   * This function is the same as the 'ubi_leb_read()' function, but it does not
> 

Acked-by: Richard Weinberger <richard at nod.at>

Thanks,
//richard



More information about the linux-mtd mailing list