summaryrefslogtreecommitdiff
path: root/extras/volume_id/lib/gfs.c
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2008-05-28 12:25:09 +0200
committerKay Sievers <kay.sievers@vrfy.org>2008-05-28 20:07:17 +0200
commit2f2f54c5142c8c56441f9b1b307848531a2f2148 (patch)
treea62d87a794dd0e90c6f878e72669dbfb92e1340b /extras/volume_id/lib/gfs.c
parentbbf1599bb57795ba3a627b48c2c26589edc584c1 (diff)
volume_id: enable GFS probing code, add LABEL support
* enables GFS/GFS2 probing code (it's disabled now!) * adds support for LABELs -- it seems that locktable name is usable as a LABEL (at least according to libblkid). * removes extra check of sb_header.mh_format -- nothing in kernel and blkid checks this superblock entry. It seems that check GFS_MAGIC and GFS_METATYPE_SB is enough. Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'extras/volume_id/lib/gfs.c')
-rw-r--r--extras/volume_id/lib/gfs.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/extras/volume_id/lib/gfs.c b/extras/volume_id/lib/gfs.c
index 53382222ac..2cb16a8693 100644
--- a/extras/volume_id/lib/gfs.c
+++ b/extras/volume_id/lib/gfs.c
@@ -86,8 +86,7 @@ static int volume_id_probe_gfs_generic(struct volume_id *id, uint64_t off, int v
return -1;
if (be32_to_cpu(sbd->sb_header.mh_magic) == GFS_MAGIC &&
- be32_to_cpu(sbd->sb_header.mh_type) == GFS_METATYPE_SB &&
- be32_to_cpu(sbd->sb_header.mh_format) == GFS_FORMAT_SB) {
+ be32_to_cpu(sbd->sb_header.mh_type) == GFS_METATYPE_SB) {
if (vers == 1) {
if (be32_to_cpu(sbd->sb_fs_format) != GFS_FORMAT_FS ||
be32_to_cpu(sbd->sb_multihost_format) != GFS_FORMAT_MULTI)
@@ -102,6 +101,13 @@ static int volume_id_probe_gfs_generic(struct volume_id *id, uint64_t off, int v
}
else
return -1;
+
+ if (strlen(sbd->sb_locktable)) {
+ uint8_t *label = (uint8_t *) sbd->sb_locktable;
+
+ volume_id_set_label_raw(id, label, GFS_LOCKNAME_LEN);
+ volume_id_set_label_string(id, label, GFS_LOCKNAME_LEN);
+ }
strcpy(id->type_version, "1");
volume_id_set_usage(id, VOLUME_ID_FILESYSTEM);
return 0;