• Mike Lockwood's avatar
    fatfs: add FAT_IOCTL_GET_VOLUME_ID · 6e5b93ee
    Mike Lockwood authored
    This patch, originally from Android kernel, adds vfat ioctl command
    FAT_IOCTL_GET_VOLUME_ID, with this command we can get the vfat volume ID
    using following code:
    
    	ioctl(fd, FAT_IOCTL_GET_VOLUME_ID, &volume_ID)
    
    This patch is a modified version of the patch by Mike Lockwood, with
    changes from Dmitry Pervushin, who noticed the original patch makes some
    volume IDs abiguous with error returns: for example, if volume id is
    0xFFFFFDAD, that matches -ENOIOCTLCMD, we get "FFFFFFFF" from the user
    space.
    
    So add a parameter to ioctl to get the correct volume ID.
    
    Android uses vfat volume ID to identify different sd card, when a new sd
    card is inserted to device, android can scan the media on it and pop up
    new contents.
    Signed-off-by: default avatarBintian Wang <bintian.wang@linaro.org>
    Cc: dmitry pervushin <dpervushin@gmail.com>
    Cc: Mike Lockwood <lockwood@android.com>
    Cc: Colin Cross <ccross@android.com>
    Acked-by: default avatarOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
    Cc: John Stultz <john.stultz@linaro.org>
    Cc: Sean McNeil <sean@mcneil.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    6e5b93ee
fat.h 13.7 KB