Add support for detecting the reiser4 filesystem in the blkid library.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
bitmap-optimize
Theodore Ts'o 2005-09-10 11:48:38 -04:00
parent 038d2bedaa
commit bb626bcd54
3 changed files with 30 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2005-09-10 Theodore Ts'o <tytso@mit.edu>
* probe.c, probe.h: Add support for resier4 filesystem.
2005-09-07 Theodore Ts'o <tytso@mit.edu>
* probe.c: Collapse vfat and fat code and make it more paranoid

View File

@ -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 },

View File

@ -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;