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 (Артём Битюцкий)
--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html