dmraid ./CHANGELOG ./CREDITS ./KNOWN_BUGS ./RE ...
Subsystems (2)
CVSROOT: /cvs/dm
Module name: dmraid
Changes by: [email protected] 2008-02-22 17:04:36
Modified files:
. : CHANGELOG CREDITS KNOWN_BUGS README TODO
include/dmraid : dmraid.h list.h metadata.h
lib : Makefile.in internal.h version.h
lib/activate : activate.c activate.h devmapper.c devmapper.h
lib/format : format.c ondisk.h register.h
lib/format/ataraid: asr.c asr.h hpt37x.c hpt37x.h hpt45x.c isw.c
jm.c lsi.c nv.c pdc.c sil.c sil.h via.c
lib/format/partition: dos.c
lib/locking : locking.c
lib/metadata : metadata.c
lib/misc : file.c
tools : Makefile.in VERSION
Added files:
include/dmraid : reconfig.h
lib/format/ataraid: .isw.c.swp .jm.c.swp lib/format/ddf : README ddf1.c ddf1.c.orig ddf1.h ddf1_crc.c
ddf1_crc.h ddf1_cvt.c ddf1_cvt.h ddf1_dump.c ddf1_dump.h ddf1_lib.c ddf1_lib.h
lib/metadata : log_ops.c reconfig.c
Log message:
1.0.0.rc12 checkin
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/CHANGELOG.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/CREDITS.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/KNOWN_BUGS.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/README.diff?cvsroot=dm&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/TODO.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/include/dmraid/reconfig.h.diff?cvsroot=dm&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/include/dmraid/dmraid.h.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/include/dmraid/list.h.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/include/dmraid/metadata.h.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/Makefile.in.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/internal.h.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/version.h.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/activate/activate.c.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/activate/activate.h.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/activate/devmapper.c.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/activate/devmapper.h.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/format.c.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ondisk.h.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/register.h.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ataraid/.isw.c.swp.diff?cvsroot=dm&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ataraid/.jm.c.swp.diff?cvsroot=dm&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ataraid/asr.c.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ataraid/asr.h.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ataraid/hpt37x.c.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ataraid/hpt37x.h.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ataraid/hpt45x.c.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ataraid/isw.c.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ataraid/jm.c.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ataraid/lsi.c.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ataraid/nv.c.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ataraid/pdc.c.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ataraid/sil.c.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ataraid/sil.h.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ataraid/via.c.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ddf/README.diff?cvsroot=dm&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ddf/ddf1.c.diff?cvsroot=dm&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ddf/ddf1.c.orig.diff?cvsroot=dm&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ddf/ddf1.h.diff?cvsroot=dm&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ddf/ddf1_crc.c.diff?cvsroot=dm&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ddf/ddf1_crc.h.diff?cvsroot=dm&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ddf/ddf1_cvt.c.diff?cvsroot=dm&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ddf/ddf1_cvt.h.diff?cvsroot=dm&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ddf/ddf1_dump.c.diff?cvsroot=dm&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ddf/ddf1_dump.h.diff?cvsroot=dm&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ddf/ddf1_lib.c.diff?cvsroot=dm&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ddf/ddf1_lib.h.diff?cvsroot=dm&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/partition/dos.c.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/locking/locking.c.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/metadata/log_ops.c.diff?cvsroot=dm&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/metadata/reconfig.c.diff?cvsroot=dm&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/metadata/metadata.c.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/misc/file.c.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/tools/Makefile.in.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/tools/VERSION.diff?cvsroot=dm&r1=1.1&r2=1.2
CHANGELOG +22 -0
@@ -1,4 +1,26 @@ +Changelog from dmraid 1.0.0.rc11 to 1.0.0.rc12 2006.09.22 + + +FIXES: +------ +o sil.c: quorate() OBO fix +o activate.c: handler() OBO fix +o added log_zero_sectors() to various metadata format handlers + +FEATURES: +--------- +o added SNIA DDF1 support (IBM) +o added reload functionality to devmapper.c (IBM) +o sil.[ch]: added JBOD support + + +MISCELANIOUS: +------------- +o streamlined devmapper.c + + + Changelog from dmraid 1.0.0.rc10 to 1.0.0.rc11 2006.05.16 FIXES:
CREDITS +2 -1
@@ -5,6 +5,7 @@ o Jane Liu for the NVidia RAID metadata format handler -o Darrick J. Wong for the Adpatec HostRAID ASR metadata format handler +o Darrick J. Wong for the SNIA DDF1 and + Adaptec HostRAID ASR metadata format handlers o various helpful people who provided metadata samples
KNOWN_BUGS +1 -1
@@ -1,5 +1,5 @@ -KNOWN_BUGS in dmraid 1.0.0.rc11 2005.05.16 +KNOWN_BUGS in dmraid 1.0.0.rc12 2005.05.15 o "dmraid --sets[a/i]" doesn't work properly. Use the short option -s.
README +2 -1
@@ -1,6 +1,6 @@ ******************************************************************************** * * -* dmraid (Device-Mapper Software RAID support tool) 1.0.0.rc11 2006.05.15 * +* dmraid (Device-Mapper Software RAID support tool) 1.0.0.rc12 2006.05.15 * * * * (C)opyright 2004-2006 Heinz Mauelshagen, Red Hat GmbH. * * All rights reserved. *
@@ -26,6 +26,7 @@ NVidia NForce Promise FastTrack Silicon Image Medley +SNIA DDF1 VIA Software RAID Beside hints, enhancement proposals and patches, I want to know, if the mappings
TODO +3 -10
@@ -1,19 +1,15 @@ --- dmraid 1.0.0.rc11 TODO -- 2006.05.15 +-- dmraid 1.0.0.rc12 TODO -- 2006.09.19 + +o use kpartx instead of my own metadata format handlers o more enhancements for RAID set consistency checks o neater -s output; something better than just paragraphs for super- and subsets ? -o higher RAID levels above 1; main restriction to support these is - the need for device-mapper targets which map RAID4 and RAID5 - (Alpha patch for device-mapper RAID4/RAID5 target on my people page now) - o MD metadata format handler -o SNIA DDF metadata format handler - o enhance metadata write feature in order to be able to store state changes persistently; needs an event() method to inform the metadata handler about state changes recognized eg, at the device-mapper interface layer
@@ -24,9 +20,6 @@ o more cleanup and enhance debug and verbose output -o support other partitions than MSDOS on Software RAID devices or - use kpartx instead ? - o regular expressions for metadata format, RAID device and RAID set selection o does dmraid need a config file ?
/cvs/dm/dmraid/include/dmraid/reconfig.h,v --> standard output revision 1.1
- renamed from include/dmraid/reconfig.h +54 -0
54 lines not on this page · raw message
include/dmraid/dmraid.h +2 -0
@@ -17,6 +17,7 @@#include <dmraid/display.h> #include <dmraid/format.h> #include <dmraid/metadata.h> +#include <dmraid/reconfig.h> /* * Library init/exit
@@ -43,6 +44,7 @@extern int discover_devices (struct lib_context *lc,char **devnodes);extern void discover_raid_devices (struct lib_context *lc,char **devices);extern void discover_partitions (struct lib_context *lc); +extern int write_dev (struct lib_context *lc,struct raid_dev *rd,int erase);/* * Erase ondisk metadata.
include/dmraid/list.h +7 -0
@@ -19,6 +19,8 @@#define INIT_LIST_HEAD (a) do { (a)->next = (a)->prev = a; } while(0) +#define LIST_HEAD (a) struct list_head a = { .next = &a, .prev = &a } +#define list_empty (pos) ((pos)->next == pos) static inline void __list_add(struct list_head *new,
@@ -44,6 +46,11 @@ (pos)->next = (pos)->prev =0 ; \ } +#define list_del_init (pos) { \ + list_del(pos); \ + INIT_LIST_HEAD(pos); \ +} +/* Pointer to a struct 'type' derived from 'pos' and list_head* 'member'. */ #define list_entry (pos, type, member) \ ((type*) ((char*)pos - (unsigned long)(&((type*)0)->member)))
include/dmraid/metadata.h +17 -0
@@ -81,6 +81,18 @@ s_setup = 0x20, /* Only during RAID setup transition. */ }; +/* +* Mapping struct for RAID status unification. +* +* Format handler allocates an array and inserts mappings +* from format specific status to the unified ones above. +*/ +enum compare {AND ,EQUAL }; +struct states { +unsigned int status; +enum status unified_status; +}; +/* Check macros for states. */ #define S_UNDEF (status) ((status) & s_undef)#define S_BROKEN (status) ((status) & s_broken)
@@ -195,6 +207,8 @@enum status status;/* Status of set. */ }; +extern struct raid_set *get_raid_set (struct lib_context *lc, +struct raid_dev *rd);extern struct dmraid_format *get_format (struct raid_set *rs);extern const char *get_type (struct lib_context *lc,enum type type);extern const char *get_dm_type (struct lib_context *lc,enum type type);
@@ -244,11 +258,14 @@extern void discover_raid_devices (struct lib_context *lc,char **devices);extern void discover_partitions (struct lib_context *lc);extern unsigned int count_devices (struct lib_context *lc,enum dev_type type); +extern enum status rd_status (struct states *states,unsigned int status, +enum compare cmp);extern enum type rd_type (struct types *types,unsigned int type);extern void file_metadata (struct lib_context *lc,const char *handler,char *path,void *data,size_t size,uint64_t offset);extern void file_dev_size (struct lib_context *lc,const char *handler,struct dev_info *di); +extern int write_dev (struct lib_context *lc,struct raid_dev *rd,int erase);extern int erase_metadata (struct lib_context *lc);#endif
lib/Makefile.in +7 -1
@@ -18,7 +18,9 @@ format/format.c \ locking/locking.c \ log/log.c \ + metadata/log_ops.c \ metadata/metadata.c \ + metadata/reconfig.c \ misc/file.c \ misc/init.c \ misc/lib_context.c \
@@ -35,7 +37,11 @@ format/ataraid/pdc.c \ format/ataraid/sil.c \ format/ataraid/via.c \ - format/ataraid/asr.c \ + format/ddf/ddf1.c \ + format/ddf/ddf1_lib.c \ + format/ddf/ddf1_crc.c \ + format/ddf/ddf1_cvt.c \ + format/ddf/ddf1_dump.c \ format/partition/dos.c OBJECTS=$(SOURCES:%.c=%.o)
lib/internal.h +2 -0
@@ -13,6 +13,7 @@#endif #include <ctype.h> +#include <errno.h> #include <fcntl.h> #include <inttypes.h> #include <limits.h>
@@ -34,6 +35,7 @@#include <dmraid/format.h> #include <dmraid/metadata.h> #include "activate/activate.h" +#include <dmraid/reconfig.h> #ifndef u_int16_t#define u_int16_t uint16_t
lib/version.h +3 -3
@@ -1,12 +1,12 @@#ifndef DMRAID_LIB_VERSION -#define DMRAID_LIB_VERSION "1.0.0.rc11" +#define DMRAID_LIB_VERSION "1.0.0.rc12"#define DMRAID_LIB_MAJOR_VERSION 1#define DMRAID_LIB_MINOR_VERSION 0#define DMRAID_LIB_SUBMINOR_VERSION 0 -#define DMRAID_LIB_VERSION_SUFFIX "rc11" +#define DMRAID_LIB_VERSION_SUFFIX "rc12" -#define DMRAID_LIB_DATE "(2006.05.15)" +#define DMRAID_LIB_DATE "(2006.09.15)"#endif
lib/activate/activate.c +65 -1
84 lines not on this page · raw message
lib/activate/activate.h +1 -0
@@ -11,6 +11,7 @@enum activate_type {A_ACTIVATE ,A_DEACTIVATE , +A_RELOAD , };int change_set (struct lib_context *lc,enum activate_type what,void *rs);
lib/activate/devmapper.c +50 -20
105 lines not on this page · raw message
lib/activate/devmapper.h +3 -0
@@ -13,5 +13,8 @@int dm_remove (struct lib_context *lc,struct raid_set *rs);int dm_status (struct lib_context *lc,struct raid_set *rs);int dm_version (struct lib_context *lc,char *version,size_t size); +int dm_suspend (struct lib_context *lc,struct raid_set *rs); +int dm_resume (struct lib_context *lc,struct raid_set *rs); +int dm_reload (struct lib_context *lc,struct raid_set *rs,char *table);#endif
lib/format/format.c +15 -13
@@ -35,22 +35,24 @@struct format_member {const unsigned short offset; -const unsigned char all; -const unsigned char method; +const unsigned char flags;const char *msg; } __attribute__ ((packed)); +enum {FMT_ALL =0x01 ,FMT_METHOD =0x02 } format_flags; +#define IS_FMT_ALL (member) (member->flags & FMT_ALL) +#define IS_FMT_METHOD (member) (member->flags & FMT_METHOD)static struct format_member format_member[] = { - {offset (name),1 ,0 ,"name" }, - {offset (descr),1 ,0 ,"description" }, - {offset (caps),0 ,0 ,"capabilities" }, - {offset (read),1 ,1 ,"read" }, - {offset (write),0 ,1 ,"write" }, - {offset (group),1 ,1 ,"group" }, - {offset (check),1 ,1 ,"check" }, - {offset (events),0 ,0 ,"events array" }, + {offset (name),FMT_ALL ,"name" }, + {offset (descr),FMT_ALL ,"description" }, + {offset (caps),0 ,"capabilities" }, + {offset (read),FMT_ALL |FMT_METHOD ,"read" }, + {offset (write),FMT_METHOD ,"write" }, + {offset (group),FMT_ALL |FMT_METHOD ,"group" }, + {offset (check),FMT_ALL |FMT_METHOD ,"check" }, + {offset (events),0 ,"events array" }, #ifdef NATIVE_LOG - {offset (log),0 ,1 ,"log" }, + {offset (log),FMT_METHOD ,"log" }, #endif };#undef offset
@@ -58,12 +60,12 @@static int check_member (struct lib_context *lc,struct dmraid_format *fmt,struct format_member *member) { -if ((!member->all && fmt->format !=FMT_RAID ) || +if ((!IS_FMT_ALL (member) && fmt->format !=FMT_RAID ) || *((unsigned long *) (((unsigned char *) fmt) + member->offset)))return 0 ;LOG_ERR (lc,1 ,"%s: missing metadata format handler %s%s" , - fmt->name, member->msg, member->method ?" method" :"" ); + fmt->name, member->msg,IS_FMT_METHOD (member) ?" method" :"" ); } static int check_format_handler(struct lib_context *lc,
lib/format/ondisk.h +2 -1
@@ -18,7 +18,8 @@#include "ataraid/pdc.h" #include "ataraid/via.h" #include "ataraid/sil.h" -#include "ataraid/asr.h" + +#include "ddf/ddf1.h" #include "partition/dos.h"
lib/format/register.h +1 -0
@@ -16,6 +16,7 @@/* Metadata format handlers. */ xx(asr) + xx(ddf1) xx(hpt37x) xx(hpt45x) xx(isw)
/cvs/dm/dmraid/lib/format/ataraid/.isw.c.swp,v --> standard output revision 1.1
Binary files /cvs/dm/dmraid/lib/format/ataraid/.isw.c.swp and - differ
co: output error: Broken pipe
co aborted
/cvs/dm/dmraid/lib/format/ataraid/.jm.c.swp,v --> standard output revision 1.1
Binary files /cvs/dm/dmraid/lib/format/ataraid/.jm.c.swp and - differ
co: output error: Broken pipe
co aborted
lib/format/ataraid/asr.c +493 -215
982 lines not on this page · raw message
lib/format/ataraid/asr.h +3 -1
@@ -137,7 +137,8 @@uint16_t blockStorageTid;uint32_t curAppBlock;uint32_t appBurstCount; -uint8_t name[16 ];/* Full name of the array. */ +#define ASR_NAMELEN 16 +uint8_t name[ASR_NAMELEN ];/* Full name of the array. */ } __attribute__ ((packed));struct asr_raidtable
@@ -148,6 +149,7 @@uint32_t rversion;/* Version of the RAID config table */ uint16_t maxelm;/* Maximum number of elements */ uint16_t elmcnt;/* Element Count (number used) */ +#define ASR_TBLELMCNT 7uint16_t elmsize;/* Size of an individual raidCLine */ uint16_t rchksum;/* RAID table check sum (no rconfTblV2)*/
lib/format/ataraid/hpt37x.c +37 -26
106 lines not on this page · raw message
lib/format/ataraid/hpt37x.h +2 -1
@@ -79,6 +79,7 @@uint8_t boot_protect;uint8_t error_log_entries;uint8_t error_log_index; +#define HPT37X_MAX_ERRORLOG 32struct hpt37x_errorlog {uint32_t timestamp;
@@ -90,7 +91,7 @@uint8_t status;uint8_t sectors; uint32_t lba; - } errorlog[32 ]; + } errorlog[HPT37X_MAX_ERRORLOG ];uint8_t filler[60 ]; } __attribute__ ((packed));#endif
lib/format/ataraid/hpt45x.c +11 -11
@@ -1,4 +1,6 @@/* +* Highpoint 45X ATARAID series metadata format handler. +* * Copyright (C) 2004,2005 Heinz Mauelshagen, Red Hat GmbH. * All rights reserved. *
@@ -6,8 +8,6 @@*/ /* -* Highpoint 45X ATARAID metadata format handler. -* * hpt45x_read(), hpt45x_group() and group_rd() profited from * Carl-Daniel Hailfinger's raiddetect code. */
@@ -65,18 +65,18 @@return hpt->magic ==HPT45X_MAGIC_BAD ? s_broken : s_ok; } -/* Mapping of HPT 45X types to generic types */ -static struct types types[] = { - {HPT45X_T_SPAN , t_linear}, - {HPT45X_T_RAID0 , t_raid0}, - {HPT45X_T_RAID1 , t_raid1}, -/* FIXME: handle RAID 3+5 */ - {0 , t_undef} -}; -/* Neutralize disk type */ static enum type type (struct hpt45x *hpt) { +/* Mapping of HPT 45X types to generic types */ +static struct types types[] = { + {HPT45X_T_SPAN , t_linear}, + {HPT45X_T_RAID0 , t_raid0}, + {HPT45X_T_RAID1 , t_raid1}, +/* FIXME: handle RAID 4+5 */ + {0 , t_undef}, + }; +return hpt->magic_0 ?rd_type (types, (unsigned int ) hpt->type) : t_spare; }
lib/format/ataraid/isw.c +16 -16
@@ -1,4 +1,6 @@/* +* Intel Software RAID metadata format handler. +* * Copyright (C) 2004,2005 Heinz Mauelshagen, Red Hat GmbH. * All rights reserved. *
@@ -6,8 +8,6 @@*/ /* -* Intel Software RAID metadata format handler. -* * isw_read() etc. profited from Carl-Daniel Hailfinger's raiddetect code. * * Profited from the Linux 2.4 iswraid driver by
@@ -101,19 +101,16 @@return s_undef; } -/* -* Mapping of Intel types to generic types. -*/ -static struct types types[] = { - {ISW_T_RAID0 , t_raid0}, - {ISW_T_RAID1 , t_raid1}, - {ISW_T_RAID5 , t_raid5_la}, - {0 , t_undef}, -}; -/* Neutralize disk type. */ static enum type type (struct raid_dev *rd) { +/* Mapping of Intel types to generic types. */ +static struct types types[] = { + {ISW_T_RAID0 , t_raid0}, + {ISW_T_RAID1 , t_raid1}, + {ISW_T_RAID5 , t_raid5_la}, + {0 , t_undef}, + };struct isw_dev *dev = rd->private.ptr; return dev ? rd_type(types, (unsigned int) dev->vol.map.raid_level) :
@@ -229,7 +226,8 @@static int is_isw (struct lib_context *lc,struct dev_info *di,struct isw *isw) { -if (strncmp ((const char *) isw->sig,MPB_SIGNATURE ,sizeof (MPB_SIGNATURE ) -1 )) +if (strncmp ((const char *) isw->sig,MPB_SIGNATURE , +sizeof (MPB_SIGNATURE ) -1 ))return 0 ;/* Check version info, older versions supported */
@@ -437,9 +435,10 @@ r->fmt = rd->fmt; r->offset = dev->vol.map.pba_of_lba0; - r->sectors = dev->vol.map.blocks_per_member; +if ((r->sectors = dev->vol.map.blocks_per_member)) + goto out; - goto out; +log_zero_sectors (lc, rd->di->path, handler); free:free_raid_dev (lc, &r);
@@ -792,7 +791,8 @@ rd->fmt = &isw_format; rd->offset =ISW_DATAOFFSET ; - rd->sectors = info->u64 >>9 ; +if (!(rd->sectors = info->u64 >>9 )) +return log_zero_sectors (lc, di->path, handler); rd->status =status (lc, rd); rd->type = t_group;
lib/format/ataraid/jm.c +14 -14
@@ -1,13 +1,12 @@/* +* JMicron metadata format handler. +* * Copyright (C) 2006 Heinz Mauelshagen, Red Hat GmbH. * All rights reserved. * * See file LICENSE at the top of this source tree for license information. */ -/* -* JMicron ATARAID metadata format handler. -*/ #define HANDLER "jmicron"#include "internal.h"
@@ -59,18 +58,18 @@return jm->attribute & ~(JM_MOUNT |JM_BOOTABLE |JM_BADSEC |JM_ACTIVE |JM_UNSYNC |JM_NEWEST ) ? s_broken : s_ok; } -/* Mapping of JM types to generic types */ -static struct types types[] = { - {JM_T_JBOD , t_linear}, - {JM_T_RAID0 , t_raid0}, - {JM_T_RAID01 , t_raid1}, - {JM_T_RAID1 , t_raid1}, - {0 , t_undef} -}; -/* Neutralize disk type */ static enum type type (struct jm *jm) { +/* Mapping of JM types to generic types */ +static struct types types[] = { + {JM_T_JBOD , t_linear}, + {JM_T_RAID0 , t_raid0}, + {JM_T_RAID01 , t_raid1}, + {JM_T_RAID1 , t_raid1}, + {0 , t_undef}, + }; +return rd_type (types, (unsigned int ) jm->mode); }
@@ -83,7 +82,8 @@while (count--) sum += *p++; -return sum; +/* FIXME: shouldn't this be one value only ? */ +return sum ==0 || sum ==1 ; }static inline unsigned int segment (uint32_t m)
@@ -219,7 +219,7 @@return !strncmp ((const char *) jm->signature,JM_SIGNATURE ,JM_SIGNATURE_LEN ) - && !checksum (jm); + &&checksum (jm); } static int setup_rd(struct lib_context *lc, struct raid_dev *rd,
lib/format/ataraid/lsi.c +13 -13
@@ -1,4 +1,6 @@/* +* LSI Logic MegaRAID (and MegaIDE ?) ATARAID metadata format handler. +* * Copyright (C) 2004,2005 Heinz Mauelshagen, Red Hat GmbH. * All rights reserved. *
@@ -6,10 +8,7 @@*/ /* -* LSI Logic MegaRAID (and MegaIDE ?) ATARAID metadata format handler. -* -* Needs more metadata reengineering and grouping logic coding. -* +* FIXME: needs more metadata reengineering and grouping logic coding. */ #define HANDLER "lsi"
@@ -63,17 +62,17 @@return ret; } -/* Mapping of LSI Logic types to generic types */ -static struct types types[] = { - {LSI_T_RAID0 , t_raid0 }, - {LSI_T_RAID1 , t_raid1 }, - {LSI_T_RAID10 , t_raid0 }, - {0 , t_undef} -}; -/* Neutralize disk type */ static enum type type (struct lsi *lsi) { +/* Mapping of LSI Logic types to generic types */ +static struct types types[] = { + {LSI_T_RAID0 , t_raid0 }, + {LSI_T_RAID1 , t_raid1 }, + {LSI_T_RAID10 , t_raid0 }, + {0 , t_undef} + }; +return rd_type (types, (unsigned int ) lsi->type); }
@@ -353,7 +352,8 @@ rd->offset =LSI_DATAOFFSET ;/* FIXME: propper size ? */ - rd->sectors = rd->meta_areas->offset; +if (!(rd->sectors = rd->meta_areas->offset)) +return log_zero_sectors (lc, di->path, handler);return (rd->name =name (lc, rd,1 )) ?1 :0 ; }
lib/format/ataraid/nv.c +28 -34
93 lines not on this page · raw message
lib/format/ataraid/pdc.c +11 -13
@@ -1,4 +1,6 @@/* +* Promise FastTrak ATARAID metadata format handler. +* * Copyright (C) 2004,2005 Heinz Mauelshagen, Red Hat GmbH. * All rights reserved. *
@@ -6,8 +8,6 @@*/ /* -* Promise FastTrak ATARAID metadata format handler. -* * pdc_read() and pdc_group() profited from * Carl-Daniel Hailfinger's raiddetect code. */
@@ -65,18 +65,7 @@return PDC_BROKEN (pdc) ? s_broken : s_ok; } -/* -* Mapping of Promise types to generic types. -*/ #define PDC_T_RAID10 0x2/* Not defind by Promise (yet). */ -static struct types types[] = { - {PDC_T_SPAN , t_linear}, - {PDC_T_RAID0 , t_raid0}, - {PDC_T_RAID1 , t_raid1}, - {PDC_T_RAID10 , t_raid0}, - {0 , t_undef} -}; -static int is_raid10 (struct pdc *pdc) { return pdc->raid.type == PDC_T_RAID10 ||
@@ -86,6 +75,15 @@/* Neutralize disk type */ static enum type type (struct pdc *pdc) { +/* Mapping of Promise types to generic types. */ +static struct types types[] = { + {PDC_T_SPAN , t_linear}, + {PDC_T_RAID0 , t_raid0}, + {PDC_T_RAID1 , t_raid1}, + {PDC_T_RAID10 , t_raid0}, + {0 , t_undef} + }; +if (is_raid10 (pdc)) pdc->raid.type =PDC_T_RAID10 ;
lib/format/ataraid/sil.c +40 -41
133 lines not on this page · raw message
lib/format/ataraid/sil.h +1 -0
@@ -50,6 +50,7 @@#define SIL_T_RAID10 2#define SIL_T_RAID5 16#define SIL_T_SPARE 3 +#define SIL_T_JBOD 255int8_t drives_per_striped_set;/* 0x118 */ int8_t striped_set_number;/* 0x119 */ int8_t drives_per_mirrored_set;/* 0x11A */
lib/format/ataraid/via.c +13 -14
@@ -1,13 +1,12 @@/* +* VIA metadata format handler. +* * Copyright (C) 2004,2005 Heinz Mauelshagen, Red Hat GmbH. * All rights reserved. * * See file DISCLAIMER at the top of this source tree for license information. */ -/* -* VIA metadata format handler. -*/ #define HANDLER "via"#include "internal.h"
@@ -95,18 +94,18 @@return via->array.disk.in_disk_array ? s_ok : s_undef; } -/* Mapping of via types to generic types */ -static struct types types[] = { - {VIA_T_SPAN , t_linear }, - {VIA_T_RAID0 , t_raid0 }, - {VIA_T_RAID1 , t_raid1 }, - {VIA_T_RAID01 , t_raid0 }, - {0 , t_undef} -}; -/* Neutralize disk type using generic metadata type mapping function */ static enum type type (struct via *via) { +/* Mapping of via types to generic types */ +static struct types types[] = { + {VIA_T_SPAN , t_linear }, + {VIA_T_RAID0 , t_raid0 }, + {VIA_T_RAID1 , t_raid1 }, + {VIA_T_RAID01 , t_raid0 }, + {0 , t_undef} + }; +return rd_type (types, (unsigned int )VIA_RAID_TYPE (via)); }
@@ -142,7 +141,6 @@while (i--) sum += ((uint8_t *) via)[i]; -printf ("sum=%u via->checksum=%u\n" , sum, via->checksum);return sum == via->checksum; }
@@ -407,7 +405,8 @@ rd->type =type (via); rd->offset =VIA_DATAOFFSET ; - rd->sectors = rd->meta_areas->offset; +if (!(rd->sectors = rd->meta_areas->offset)) +return log_zero_sectors (lc, di->path, handler);return (rd->name =name (lc, rd,1 )) ?1 :0 ; }
/cvs/dm/dmraid/lib/format/ddf/README,v --> standard output revision 1.1
- renamed from lib/format/ddf/README +3 -0
@@ -0,0 +1,3 @@ + +This directory contains the SNIA DDF1 metadata format handler +
/cvs/dm/dmraid/lib/format/ddf/ddf1.c,v --> standard output revision 1.1
- renamed from lib/format/ddf/ddf1.c +966 -0
788 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
/cvs/dm/dmraid/lib/format/ddf/ddf1.c.orig,v --> standard output revision 1.1
- renamed from lib/format/ddf/ddf1.c.orig +1047 -0
1,047 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
/cvs/dm/dmraid/lib/format/ddf/ddf1.h,v --> standard output revision 1.1
- renamed from lib/format/ddf/ddf1.h +273 -0
273 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
/cvs/dm/dmraid/lib/format/ddf/ddf1_crc.c,v --> standard output revision 1.1
- renamed from lib/format/ddf/ddf1_crc.c +178 -0
178 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
/cvs/dm/dmraid/lib/format/ddf/ddf1_crc.h,v --> standard output revision 1.1
- renamed from lib/format/ddf/ddf1_crc.h +23 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
/cvs/dm/dmraid/lib/format/ddf/ddf1_cvt.c,v --> standard output revision 1.1
- renamed from lib/format/ddf/ddf1_cvt.c +254 -0
254 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
/cvs/dm/dmraid/lib/format/ddf/ddf1_cvt.h,v --> standard output revision 1.1
- renamed from lib/format/ddf/ddf1_cvt.h +36 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
/cvs/dm/dmraid/lib/format/ddf/ddf1_dump.c,v --> standard output revision 1.1
- renamed from lib/format/ddf/ddf1_dump.c +281 -0
281 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
/cvs/dm/dmraid/lib/format/ddf/ddf1_dump.h,v --> standard output revision 1.1
- renamed from lib/format/ddf/ddf1_dump.h +24 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
/cvs/dm/dmraid/lib/format/ddf/ddf1_lib.c,v --> standard output revision 1.1
- renamed from lib/format/ddf/ddf1_lib.c +102 -0
102 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
/cvs/dm/dmraid/lib/format/ddf/ddf1_lib.h,v --> standard output revision 1.1
- renamed from lib/format/ddf/ddf1_lib.h +53 -0
53 lines not on this page · raw message
lib/format/partition/dos.c +23 -6
Lines of this file are not shown. View the raw message.
lib/locking/locking.c +0 -2
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
/cvs/dm/dmraid/lib/metadata/log_ops.c,v --> standard output revision 1.1
- renamed from lib/metadata/log_ops.c +54 -0
54 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
/cvs/dm/dmraid/lib/metadata/reconfig.c,v --> standard output revision 1.1
- renamed from lib/metadata/reconfig.c +237 -0
237 lines not on this page · raw message
lib/metadata/metadata.c +39 -10
49 lines not on this page · raw message
lib/misc/file.c +0 -1
Lines of this file are not shown. View the raw message.
tools/Makefile.in +1 -1
Lines of this file are not shown. View the raw message.
tools/VERSION +1 -1
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.