Displaying 1 result from an estimated 1 matches for "ext2_fs_uuid".
2013 Nov 21
0
[PATCH] FSUUID for ext2 filesystem
...ll zero */
cache_init(fs->fs_dev, fs->block_shift);
cs = _get_cache_block(fs->fs_dev, 0);
@@ -321,6 +324,41 @@ static int ext2_fs_init(struct fs_info *fs)
return fs->block_shift;
}
+#define EXT2_UUID_LEN (4 + 4 + 1 + 4 + 1 + 4 + 1 + 4 + 1 + 4 + 4 + 4 + 1)
+static char *ext2_fs_uuid(struct fs_info *fs)
+{
+ char *uuid = NULL;
+
+ uuid = malloc(EXT2_UUID_LEN);
+ if (!uuid)
+ return NULL;
+
+ if (snprintf(uuid, EXT2_UUID_LEN,
+ "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
+ EXT2_SB(fs)->s_uuid[0],
+...