[PATCH] UBIFS: Add /dev/ubiX_Y naming scheme in open_ubi

Artem Bityutskiy dedekind1 at gmail.com
Mon Sep 28 08:02:28 EDT 2009


On 09/28/2009 02:53 PM, Corentin Chary wrote:
>>> +     if (!strncmp("/dev/", name, 5))
>>> +             name = name + 5;
>>> +
>>>        if (name[0] != 'u' || name[1] != 'b' || name[2] != 'i')
>>>                return ERR_PTR(-EINVAL);
>>
>> But UBI volume may have arbitrary names. Could we invent something
>> better?
>
>
> Using name and kern_path we can find the corresponding inode (and
> major/minor informations).
> ubi_open_volume use ubi_num and vol_id.
> vol_id is minor()-1, but major is not related to ubi_num.
>
> UBI have a "ubi_major2num" internally, is it ok to export this symbol ?
>
> Then we could do something like
> ubi_open_volume(ubi_major2num(major()), minor()-1)

Sounds good.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)



More information about the linux-mtd mailing list