X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=extras%2Fvolume_id%2Fvolume_id%2Fisw_raid.c;h=745b42f2d111410e4e34321d365491fdd26af3b0;hb=79bd4f222954a331aafcd7d0164742a60b570294;hp=c703f3fe270eb276e22abcf5eb8bc4e67a7e8158;hpb=afa3c553b1ff0ceb3e038cdf86d9261a8b8aa5d6;p=elogind.git diff --git a/extras/volume_id/volume_id/isw_raid.c b/extras/volume_id/volume_id/isw_raid.c index c703f3fe2..745b42f2d 100644 --- a/extras/volume_id/volume_id/isw_raid.c +++ b/extras/volume_id/volume_id/isw_raid.c @@ -3,19 +3,9 @@ * * Copyright (C) 2005 Kay Sievers * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * 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. */ #ifndef _GNU_SOURCE @@ -32,7 +22,6 @@ #include #include #include -#include #include "volume_id.h" #include "logging.h" @@ -40,20 +29,20 @@ #include "isw_raid.h" struct isw_meta { - __u8 sig[32]; - __u32 check_sum; - __u32 mpb_size; - __u32 family_num; - __u32 generation_num; + uint8_t sig[32]; + uint32_t check_sum; + uint32_t mpb_size; + uint32_t family_num; + uint32_t generation_num; } __attribute__((packed)); #define ISW_SIGNATURE "Intel Raid ISM Cfg Sig. " -int volume_id_probe_intel_software_raid(struct volume_id *id, __u64 off, __u64 size) +int volume_id_probe_intel_software_raid(struct volume_id *id, uint64_t off, uint64_t size) { - const __u8 *buf; - __u64 meta_off; + const uint8_t *buf; + uint64_t meta_off; struct isw_meta *isw; dbg("probing at offset 0x%llx, size 0x%llx", @@ -72,7 +61,7 @@ int volume_id_probe_intel_software_raid(struct volume_id *id, __u64 off, __u64 s return -1; volume_id_set_usage(id, VOLUME_ID_RAID); - strncpy(id->type_version, &isw->sig[sizeof(ISW_SIGNATURE)-1], 6); + memcpy(id->type_version, &isw->sig[sizeof(ISW_SIGNATURE)-1], 6); id->type = "isw_raid_member"; return 0;