summaryrefslogtreecommitdiff
path: root/lib/blkid
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2005-09-10 11:48:38 -0400
committerTheodore Ts'o <tytso@mit.edu>2005-09-10 11:48:38 -0400
commitbb626bcd546a039b39b9f25e65881b36b2abe24f (patch)
tree262896bad618744bf361e0e6a8b84a67d636befb /lib/blkid
parent038d2bedaad526f91c9e4f55184bcaa59e245e27 (diff)
downloade2fsprogs-bb626bcd546a039b39b9f25e65881b36b2abe24f.tar.gz
Add support for detecting the reiser4 filesystem in the blkid library.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'lib/blkid')
-rw-r--r--lib/blkid/ChangeLog4
-rw-r--r--lib/blkid/probe.c18
-rw-r--r--lib/blkid/probe.h8
3 files changed, 30 insertions, 0 deletions
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 <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
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;