• Rabin Vincent's avatar
    ubifs: allow userspace to map mounts to volumes · 319c1042
    Rabin Vincent authored
    There currently appears to be no way for userspace to find out the
    underlying volume number for a mounted ubifs file system, since ubifs
    uses anonymous block devices.  The volume name is present in
    /proc/mounts but UBI volumes can be renamed after the volume has been
    mounted.
    
    To remedy this, show the UBI number and UBI volume number as part of the
    options visible under /proc/mounts.
    
    Also, accept and ignore the ubi= vol= options if they are used mounting
    (patch from Richard Weinberger).
    
     # mount -t ubifs ubi:baz x
     # mount
     ubi:baz on /root/x type ubifs (rw,relatime,ubi=0,vol=2)
     # ubirename /dev/ubi0 baz bazz
     # mount
     ubi:baz on /root/x type ubifs (rw,relatime,ubi=0,vol=2)
     # ubinfo -d 0 -n 2
     Volume ID:   2 (on ubi0)
     Type:        dynamic
     Alignment:   1
     Size:        67 LEBs (1063424 bytes, 1.0 MiB)
     State:       OK
     Name:        bazz
     Character device major/minor: 254:3
    Signed-off-by: default avatarRabin Vincent <rabinv@axis.com>
    Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
    319c1042
super.c 60.7 KB