2008-06-08 Robert Millan <rmh@aybabtu.com>

* include/grub/ntfs.h (struct grub_ntfs_bpb): Rename `serial_number' to
        `num_serial' (for consistency with other variables).
        (struct grub_ntfs_data): Add `uuid' member.
        * fs/ntfs.c (grub_ntfs_mount): Initialize `data->uuid'.
        (grub_ntfs_uuid): New function.
        (grub_ntfs_fs): Reference grub_ntfs_uuid() in `uuid' struct member.
This commit is contained in:
robertmh 2008-06-08 19:18:58 +00:00
parent dc20b0f9f5
commit ad4936a035
3 changed files with 42 additions and 1 deletions

View File

@ -1,3 +1,12 @@
2008-06-08 Robert Millan <rmh@aybabtu.com>
* include/grub/ntfs.h (struct grub_ntfs_bpb): Rename `serial_number' to
`num_serial' (for consistency with other variables).
(struct grub_ntfs_data): Add `uuid' member.
* fs/ntfs.c (grub_ntfs_mount): Initialize `data->uuid'.
(grub_ntfs_uuid): New function.
(grub_ntfs_fs): Reference grub_ntfs_uuid() in `uuid' struct member.
2008-06-07 Pavel Roskin <proski@gnu.org>
* util/biosdisk.c (open_device): Revert last change to the

View File

@ -830,6 +830,8 @@ grub_ntfs_mount (grub_disk_t disk)
(disk, data->mft_start, 0, data->mft_size << BLK_SHR, data->mmft.buf))
goto fail;
data->uuid = grub_le_to_cpu64 (bpb.num_serial);
if (fixup (data, data->mmft.buf, data->mft_size, "FILE"))
goto fail;
@ -1078,6 +1080,34 @@ fail:
return grub_errno;
}
static grub_err_t
grub_ntfs_uuid (grub_device_t device, char **uuid)
{
struct grub_ntfs_data *data;
grub_disk_t disk = device->disk;
#ifndef GRUB_UTIL
grub_dl_ref (my_mod);
#endif
data = grub_ntfs_mount (disk);
if (data)
{
*uuid = grub_malloc (16 + sizeof ('\0'));
grub_sprintf (*uuid, "%016llx", data->uuid);
}
else
*uuid = NULL;
#ifndef GRUB_UTIL
grub_dl_unref (my_mod);
#endif
grub_free (data);
return grub_errno;
}
static struct grub_fs grub_ntfs_fs = {
.name = "ntfs",
.dir = grub_ntfs_dir,
@ -1085,6 +1115,7 @@ static struct grub_fs grub_ntfs_fs = {
.read = grub_ntfs_read,
.close = grub_ntfs_close,
.label = grub_ntfs_label,
.uuid = grub_ntfs_uuid,
.next = 0
};

View File

@ -115,7 +115,7 @@ struct grub_ntfs_bpb
grub_int8_t reserved_4[3];
grub_int8_t clusters_per_index;
grub_int8_t reserved_5[3];
grub_uint64_t serial_number;
grub_uint64_t num_serial;
grub_uint32_t checksum;
} __attribute__ ((packed));
@ -151,6 +151,7 @@ struct grub_ntfs_data
grub_uint32_t spc;
grub_uint32_t blocksize;
grub_uint32_t mft_start;
grub_uint64_t uuid;
};
struct grub_ntfs_comp