summaryrefslogtreecommitdiff
path: root/extras/volume_id/lib/ufs.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@suse.de>2006-08-05 00:02:58 +0200
committerKay Sievers <kay.sievers@suse.de>2006-08-05 00:02:58 +0200
commiteb82b76dedc1482b6434c46fee84d3ef13cb9648 (patch)
treef21493d9ce182f42187afa2643b83e423311b562 /extras/volume_id/lib/ufs.c
parentb5adfb4f3387a5dcfcdb5a5996c249b1d14aa44a (diff)
libvolume_id: read ufs2 label
Taken from the FreeBSD HAL repository.
Diffstat (limited to 'extras/volume_id/lib/ufs.c')
-rw-r--r--extras/volume_id/lib/ufs.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/extras/volume_id/lib/ufs.c b/extras/volume_id/lib/ufs.c
index 2713a63d4d..4ace8c99fd 100644
--- a/extras/volume_id/lib/ufs.c
+++ b/extras/volume_id/lib/ufs.c
@@ -205,6 +205,18 @@ int volume_id_probe_ufs(struct volume_id *id, uint64_t off, uint64_t size)
found:
volume_id_set_usage(id, VOLUME_ID_FILESYSTEM);
id->type = "ufs";
+ switch (magic) {
+ case UFS_MAGIC:
+ strcpy(id->type_version, "1");
+ break;
+ case UFS2_MAGIC:
+ strcpy(id->type_version, "2");
+ volume_id_set_label_raw(id, ufs->fs_u11.fs_u2.fs_volname, 32);
+ volume_id_set_label_string(id, ufs->fs_u11.fs_u2.fs_volname, 32);
+ break;
+ default:
+ break;
+ }
return 0;
}