Whamcloud - gitweb
Add support for detecting the reiser4 filesystem in the blkid library.
authorTheodore Ts'o <tytso@mit.edu>
Sat, 10 Sep 2005 15:48:38 +0000 (11:48 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 10 Sep 2005 15:48:38 +0000 (11:48 -0400)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/blkid/ChangeLog
lib/blkid/probe.c
lib/blkid/probe.h

index 76b8be6..8af5f8c 100644 (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
index cb37347..084492d 100644 (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 },
index efb9968..33e327d 100644 (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;