X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=extras%2Fvolume_id%2Flib%2Freiserfs.c;h=5c48c066337349ba36a2e5cfdb18b29c551b1767;hp=abeb06b88f6f0f6245c81a929cede20e4345d17e;hb=3eb46ec6ddeb31d9886ebb736d1d7b3534d2f354;hpb=f7dd3a57a40282f1c3fb9ad90a30d58b31b64ff8 diff --git a/extras/volume_id/lib/reiserfs.c b/extras/volume_id/lib/reiserfs.c index abeb06b88..5c48c0663 100644 --- a/extras/volume_id/lib/reiserfs.c +++ b/extras/volume_id/lib/reiserfs.c @@ -4,19 +4,24 @@ * Copyright (C) 2004 Kay Sievers * Copyright (C) 2005 Tobias Klauser * - * 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 . */ #ifndef _GNU_SOURCE #define _GNU_SOURCE 1 #endif -#ifdef HAVE_CONFIG_H -# include -#endif - #include #include #include @@ -25,7 +30,7 @@ #include #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);