diff options
Diffstat (limited to 'fs/fat/fat.c')
-rw-r--r-- | fs/fat/fat.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/fs/fat/fat.c b/fs/fat/fat.c index 47344bb57e..157dad60a4 100644 --- a/fs/fat/fat.c +++ b/fs/fat/fat.c @@ -810,7 +810,6 @@ static void fat_itr_child(fat_itr *itr, fat_itr *parent) */ void *fat_next_cluster(fat_itr *itr, unsigned int *nbytes) { - fsdata *mydata = itr->fsdata; /* for silly macros */ int ret; u32 sect; u32 read_size; @@ -838,8 +837,8 @@ void *fat_next_cluster(fat_itr *itr, unsigned int *nbytes) read_size = itr->fsdata->clust_size; } - debug("FAT read(sect=%d), clust_size=%d, read_size=%u, DIRENTSPERBLOCK=%zd\n", - sect, itr->fsdata->clust_size, read_size, DIRENTSPERBLOCK); + log_debug("FAT read(sect=%d), clust_size=%d, read_size=%u\n", + sect, itr->fsdata->clust_size, read_size); /* * NOTE: do_fat_read_at() had complicated logic to deal w/ @@ -1378,3 +1377,21 @@ void fat_closedir(struct fs_dir_stream *dirs) void fat_close(void) { } + +int fat_uuid(char *uuid_str) +{ + boot_sector bs; + volume_info volinfo; + int fatsize; + int ret; + u8 *id; + + ret = read_bootsectandvi(&bs, &volinfo, &fatsize); + if (ret) + return ret; + + id = volinfo.volume_id; + sprintf(uuid_str, "%02X%02X-%02X%02X", id[3], id[2], id[1], id[0]); + + return 0; +} |