diff --git a/lib/blkid/ChangeLog b/lib/blkid/ChangeLog index 76b8be62..8af5f8cd 100644 --- a/lib/blkid/ChangeLog +++ b/lib/blkid/ChangeLog @@ -1,3 +1,7 @@ +2005-09-10 Theodore Ts'o + + * probe.c, probe.h: Add support for resier4 filesystem. + 2005-09-07 Theodore Ts'o * probe.c: Collapse vfat and fat code and make it more paranoid diff --git a/lib/blkid/probe.c b/lib/blkid/probe.c index cb373472..084492dc 100644 --- a/lib/blkid/probe.c +++ b/lib/blkid/probe.c @@ -323,6 +323,23 @@ static int probe_reiserfs(int fd __BLKID_ATTR((unused)), return 0; } +static int probe_reiserfs4(int fd __BLKID_ATTR((unused)), + blkid_cache cache __BLKID_ATTR((unused)), + blkid_dev dev, + struct blkid_magic *id, unsigned char *buf) +{ + struct reiser4_super_block *rs4 = (struct reiser4_super_block *) buf; + unsigned int blocksize; + const char *label = 0; + + if (strlen(rs4->rs4_label)) + label = rs4->rs4_label; + set_uuid(dev, rs4->rs4_uuid); + blkid_set_tag(dev, "LABEL", label, sizeof(rs4->rs4_label)); + + return 0; +} + static int probe_jfs(int fd __BLKID_ATTR((unused)), blkid_cache cache __BLKID_ATTR((unused)), blkid_dev dev, @@ -547,6 +564,7 @@ static struct blkid_magic type_array[] = { { "reiserfs", 64, 0x34, 9, "ReIsEr3Fs", probe_reiserfs }, { "reiserfs", 64, 0x34, 8, "ReIsErFs", probe_reiserfs }, { "reiserfs", 8, 20, 8, "ReIsErFs", probe_reiserfs }, + { "reiser4", 64, 0, 7, "ReIsEr4", probe_reiserfs4 }, { "vfat", 0, 0x52, 5, "MSWIN", probe_fat }, { "vfat", 0, 0x52, 8, "FAT32 ", probe_fat }, { "vfat", 0, 0x36, 5, "MSDOS", probe_fat }, diff --git a/lib/blkid/probe.h b/lib/blkid/probe.h index efb9968d..33e327d8 100644 --- a/lib/blkid/probe.h +++ b/lib/blkid/probe.h @@ -89,6 +89,14 @@ struct reiserfs_super_block { char rs_label[16]; }; +struct reiser4_super_block { + unsigned char rs4_magic[16]; + __u16 rs4_dummy[2]; + unsigned char rs4_uuid[16]; + unsigned char rs4_label[16]; + __u64 rs4_dummy2; +}; + struct jfs_super_block { unsigned char js_magic[4]; __u32 js_version;