summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarel Zak2009-01-23 23:27:17 +0100
committerKarel Zak2009-02-11 23:35:24 +0100
commitf38ac42666536a7217df7d116556d0900f3e5d95 (patch)
tree0678b510ae5addec10229108584620164426b95d
parentblkid: fix ..._strncpy_uuid (diff)
downloadkernel-qcow2-util-linux-f38ac42666536a7217df7d116556d0900f3e5d95.tar.gz
kernel-qcow2-util-linux-f38ac42666536a7217df7d116556d0900f3e5d95.tar.xz
kernel-qcow2-util-linux-f38ac42666536a7217df7d116556d0900f3e5d95.zip
blkid: add ocfs2 version
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r--libs/blkid/src/probers/ocfs.c63
-rw-r--r--tests/expected/blkid/low-probe-ocfs21
2 files changed, 55 insertions, 9 deletions
diff --git a/libs/blkid/src/probers/ocfs.c b/libs/blkid/src/probers/ocfs.c
index 12e4418a6..a7219be18 100644
--- a/libs/blkid/src/probers/ocfs.c
+++ b/libs/blkid/src/probers/ocfs.c
@@ -20,7 +20,7 @@ struct ocfs_volume_header {
unsigned char signature[128];
char mount[128];
unsigned char mount_len[2];
-};
+} __attribute__((packed));
struct ocfs_volume_label {
unsigned char disk_lock[48];
@@ -28,7 +28,7 @@ struct ocfs_volume_label {
unsigned char label_len[2];
unsigned char vol_id[16];
unsigned char vol_id_len[2];
-};
+} __attribute__((packed));
#define ocfsmajor(o) ( (uint32_t) o.major_version[0] \
+ (((uint32_t) o.major_version[1]) << 8) \
@@ -44,18 +44,59 @@ struct ocfs_volume_label {
#define ocfsmountlen(o) ((uint32_t)o.mount_len[0] + (((uint32_t) o.mount_len[1]) << 8))
struct ocfs2_super_block {
- unsigned char signature[8];
- unsigned char s_dummy1[184];
- unsigned char s_dummy2[80];
- char s_label[64];
- unsigned char s_uuid[16];
-};
+ uint8_t i_signature[8];
+ uint32_t i_generation;
+ int16_t i_suballoc_slot;
+ uint16_t i_suballoc_bit;
+ uint32_t i_reserved0;
+ uint32_t i_clusters;
+ uint32_t i_uid;
+ uint32_t i_gid;
+ uint64_t i_size;
+ uint16_t i_mode;
+ uint16_t i_links_count;
+ uint32_t i_flags;
+ uint64_t i_atime;
+ uint64_t i_ctime;
+ uint64_t i_mtime;
+ uint64_t i_dtime;
+ uint64_t i_blkno;
+ uint64_t i_last_eb_blk;
+ uint32_t i_fs_generation;
+ uint32_t i_atime_nsec;
+ uint32_t i_ctime_nsec;
+ uint32_t i_mtime_nsec;
+ uint64_t i_reserved1[9];
+ uint64_t i_pad1;
+ uint16_t s_major_rev_level;
+ uint16_t s_minor_rev_level;
+ uint16_t s_mnt_count;
+ int16_t s_max_mnt_count;
+ uint16_t s_state;
+ uint16_t s_errors;
+ uint32_t s_checkinterval;
+ uint64_t s_lastcheck;
+ uint32_t s_creator_os;
+ uint32_t s_feature_compat;
+ uint32_t s_feature_incompat;
+ uint32_t s_feature_ro_compat;
+ uint64_t s_root_blkno;
+ uint64_t s_system_dir_blkno;
+ uint32_t s_blocksize_bits;
+ uint32_t s_clustersize_bits;
+ uint16_t s_max_slots;
+ uint16_t s_reserved1;
+ uint32_t s_reserved2;
+ uint64_t s_first_cluster_group;
+ uint8_t s_label[64];
+ uint8_t s_uuid[16];
+} __attribute__((packed));
struct oracle_asm_disk_label {
char dummy[32];
char dl_tag[8];
char dl_id[24];
-};
+} __attribute__((packed));
static int probe_ocfs(blkid_probe pr, const struct blkid_idmag *mag)
{
@@ -107,6 +148,10 @@ static int probe_ocfs2(blkid_probe pr, const struct blkid_idmag *mag)
blkid_probe_set_label(pr, (unsigned char *) osb->s_label, sizeof(osb->s_label));
blkid_probe_set_uuid(pr, osb->s_uuid);
+
+ blkid_probe_sprintf_version(pr, "%u.%u",
+ osb->s_major_rev_level, osb->s_minor_rev_level);
+
return 0;
}
diff --git a/tests/expected/blkid/low-probe-ocfs2 b/tests/expected/blkid/low-probe-ocfs2
index 0ee2bdd0e..2463e2add 100644
--- a/tests/expected/blkid/low-probe-ocfs2
+++ b/tests/expected/blkid/low-probe-ocfs2
@@ -4,3 +4,4 @@ ID_FS_TYPE=ocfs2
ID_FS_USAGE=filesystem
ID_FS_UUID=6b6bfbea-3a79-4f0c-b166-a20776102445
ID_FS_UUID_ENC=6b6bfbea-3a79-4f0c-b166-a20776102445
+ID_FS_VERSION=0.90