chiark / gitweb /
libudev: do not use any udev source file
[elogind.git] / extras / volume_id / lib / reiserfs.c
index abeb06b88f6f0f6245c81a929cede20e4345d17e..5c48c066337349ba36a2e5cfdb18b29c551b1767 100644 (file)
@@ -4,19 +4,24 @@
  * Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
  * Copyright (C) 2005 Tobias Klauser <tklauser@access.unizh.ch>
  *
- *     This program is free software; you can redistribute it and/or modify it
- *     under the terms of the GNU General Public License as published by the
- *     Free Software Foundation version 2 of the License.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 #ifndef _GNU_SOURCE
 #define _GNU_SOURCE 1
 #endif
 
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -25,7 +30,7 @@
 #include <ctype.h>
 
 #include "libvolume_id.h"
-#include "util.h"
+#include "libvolume_id-private.h"
 
 struct reiserfs_super_block {
        uint32_t        blocks_count;
@@ -54,19 +59,19 @@ struct reiser4_super_block {
 #define REISERFS1_SUPERBLOCK_OFFSET            0x2000
 #define REISERFS_SUPERBLOCK_OFFSET             0x10000
 
-int volume_id_probe_reiserfs(struct volume_id *id, uint64_t off)
+int volume_id_probe_reiserfs(struct volume_id *id, uint64_t off, uint64_t size)
 {
        struct reiserfs_super_block *rs;
        struct reiser4_super_block *rs4;
        uint8_t  *buf;
 
-       info("probing at offset 0x%llx", (unsigned long long) off);
+       info("probing at offset 0x%llx\n", (unsigned long long) off);
 
        buf = volume_id_get_buffer(id, off + REISERFS_SUPERBLOCK_OFFSET, 0x200);
        if (buf == NULL)
                return -1;
 
-       rs = (struct reiserfs_super_block *) buf;;
+       rs = (struct reiserfs_super_block *) buf;
        if (memcmp(rs->magic, "ReIsErFs", 8) == 0) {
                strcpy(id->type_version, "3.5");
                id->type = "reiserfs";
@@ -88,7 +93,7 @@ int volume_id_probe_reiserfs(struct volume_id *id, uint64_t off)
                strcpy(id->type_version, "4");
                volume_id_set_label_raw(id, rs4->label, 16);
                volume_id_set_label_string(id, rs4->label, 16);
-               volume_id_set_uuid(id, rs4->uuid, UUID_DCE);
+               volume_id_set_uuid(id, rs4->uuid, 0, UUID_DCE);
                id->type = "reiser4";
                goto found;
        }
@@ -109,7 +114,7 @@ int volume_id_probe_reiserfs(struct volume_id *id, uint64_t off)
 found_label:
        volume_id_set_label_raw(id, rs->label, 16);
        volume_id_set_label_string(id, rs->label, 16);
-       volume_id_set_uuid(id, rs->uuid, UUID_DCE);
+       volume_id_set_uuid(id, rs->uuid, 0, UUID_DCE);
 
 found:
        volume_id_set_usage(id, VOLUME_ID_FILESYSTEM);