dmraid ./configure ./configure.in include/dmra ...
Subsystems (2)
CVSROOT: /cvs/dm
Module name: dmraid
Changes by: [email protected] 2008-06-20 21:52:19
Modified files:
. : configure configure.in
include/dmraid : display.h dmraid.h format.h lib_context.h
list.h locking.h metadata.h misc.h reconfig.h
lib : .export.sym version.h
lib/activate : activate.c devmapper.c
lib/datastruct : byteorder.h
lib/device : ata.c ata.h dev-io.h scan.c scsi.c scsi.h
lib/display : display.c
lib/format : format.c register.h
lib/format/ataraid: asr.c asr.h hpt37x.c hpt37x.h hpt45x.c
hpt45x.h isw.c isw.h jm.c jm.h lsi.c lsi.h nv.c nv.h pdc.c pdc.h sil.c sil.h via.c via.h
lib/format/ddf : ddf1.c ddf1.h ddf1_crc.c ddf1_cvt.c ddf1_cvt.h
ddf1_dump.c ddf1_lib.c ddf1_lib.h
lib/format/partition: dos.c dos.h lib/format/template: template.c template.h
lib/locking : locking.c
lib/log : log.c
lib/metadata : log_ops.c metadata.c reconfig.c
lib/misc : file.c init.c lib_context.c misc.c workaround.c
lib/mm : dbg_malloc.c
man : dmraid.8
tools : VERSION commands.c commands.h dmraid.c
toollib.c toollib.h
Log message:
Intel Software RAID create/delete/spare/rebuild support
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/configure.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/configure.in.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/include/dmraid/display.h.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/include/dmraid/dmraid.h.diff?cvsroot=dm&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/include/dmraid/format.h.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/include/dmraid/lib_context.h.diff?cvsroot=dm&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/include/dmraid/list.h.diff?cvsroot=dm&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/include/dmraid/locking.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.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/include/dmraid/misc.h.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=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/.export.sym.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.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/activate/activate.c.diff?cvsroot=dm&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/activate/devmapper.c.diff?cvsroot=dm&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/datastruct/byteorder.h.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/device/ata.c.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/device/ata.h.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/device/dev-io.h.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/device/scan.c.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/device/scsi.c.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/device/scsi.h.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/display/display.c.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.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/register.h.diff?cvsroot=dm&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ataraid/asr.c.diff?cvsroot=dm&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ataraid/asr.h.diff?cvsroot=dm&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ataraid/hpt37x.c.diff?cvsroot=dm&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ataraid/hpt37x.h.diff?cvsroot=dm&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ataraid/hpt45x.c.diff?cvsroot=dm&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ataraid/hpt45x.h.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.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ataraid/isw.h.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.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ataraid/jm.h.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.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ataraid/lsi.h.diff?cvsroot=dm&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ataraid/nv.c.diff?cvsroot=dm&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ataraid/nv.h.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.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ataraid/pdc.h.diff?cvsroot=dm&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ataraid/sil.c.diff?cvsroot=dm&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ataraid/sil.h.diff?cvsroot=dm&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ataraid/via.c.diff?cvsroot=dm&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ataraid/via.h.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ddf/ddf1.c.diff?cvsroot=dm&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ddf/ddf1.h.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ddf/ddf1_crc.c.diff?cvsroot=dm&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ddf/ddf1_cvt.c.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ddf/ddf1_cvt.h.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ddf/ddf1_dump.c.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ddf/ddf1_lib.c.diff?cvsroot=dm&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/ddf/ddf1_lib.h.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/partition/dos.c.diff?cvsroot=dm&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/partition/dos.h.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/template/template.c.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/format/template/template.h.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.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/log/log.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=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/metadata/metadata.c.diff?cvsroot=dm&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/metadata/reconfig.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.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/misc/init.c.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/misc/lib_context.c.diff?cvsroot=dm&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/misc/misc.c.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/misc/workaround.c.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/mm/dbg_malloc.c.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/man/dmraid.8.diff?cvsroot=dm&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/tools/VERSION.diff?cvsroot=dm&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/tools/commands.c.diff?cvsroot=dm&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/tools/commands.h.diff?cvsroot=dm&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/tools/dmraid.c.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/tools/toollib.c.diff?cvsroot=dm&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/tools/toollib.h.diff?cvsroot=dm&r1=1.1&r2=1.2
configure +27 -1
@@ -854,8 +854,10 @@ --enable-jobs=NUM Number of jobs to run simultaneously --enable-libselinux Use this to link the tools to libselinux --enable-libsepol Use this to link the tools to libsepol - --enable-mini Use this to create a minimal binrary suitable + --enable-mini Use this to create a minimal binary suitable for early boot environments + --enable-led Use this to enable LED support + --enable-intel_led Use this to enable Intel LED support --disable-native_log Disable native metadata logging. Default is enabled --enable-static_link Use this to link the tools to the dmraid and devmapper libraries statically. Default is dynamic linking
@@ -4513,6 +4515,22 @@ DMRAID_MINI=no fi; +# Check whether --enable-led or --disable-led was given. +if test "${enable_led+set}" = set; then + enableval="$enable_led" + DMRAID_LED=$enableval +else + DMRAID_LED=no +fi; + +# Check whether --enable-intel_led or --disable-intel_led was given. +if test "${enable_intel_led+set}" = set; then + enableval="$enable_intel_led" + DMRAID_INTEL_LED=$enableval +else + DMRAID_INTEL_LED=no +fi; + echo $ac_n "checking whether to disable native metadata logging""... $ac_c" 1>&6 # Check whether --enable-native_log or --disable-native_log was given. if test "${enable_native_log+set}" = set; then
@@ -4577,6 +4595,14 @@ fi fi +if test x$DMRAID_LED = xyes; then + CFLAGS="$CFLAGS -DDMRAID_LED" +fi + +if test x$DMRAID_INTEL_LED = xyes; then + CFLAGS="$CFLAGS -DDMRAID_LED -DDMRAID_INTEL_LED" +fi + if test x$DEBUG = xyes; then FLAVOUR="${FLAVOUR}debug " fi
configure.in +15 -1
@@ -107,9 +107,15 @@ AC_ARG_ENABLE(libsepol, [ --enable-libsepol Use this to link the tools to libsepol ], LIBSEPOL=$enableval, LIBSEPOL=no) dnl Enables mini binary -AC_ARG_ENABLE(mini, [ --enable-mini Use this to create a minimal binrary suitable +AC_ARG_ENABLE(mini, [ --enable-mini Use this to create a minimal binary suitable for early boot environments], DMRAID_MINI=$enableval, DMRAID_MINI=no) +dnl Enables LED support +AC_ARG_ENABLE(led, [ --enable-led Use this to enable LED support], DMRAID_LED=$enableval, DMRAID_LED=no) + +dnl Enables Intel LED support +AC_ARG_ENABLE(intel_led, [ --enable-intel_led Use this to enable Intel LED support], DMRAID_INTEL_LED=$enableval, DMRAID_INTEL_LED=no) + echo $ac_n "checking whether to disable native metadata logging""... $ac_c" 1>&6 dnl Disable native metadata logging AC_ARG_ENABLE(native_log, [ --disable-native_log Disable native metadata logging. Default is enabled], \
@@ -155,6 +161,14 @@ fi fi +if test x$DMRAID_LED = xyes; then + CFLAGS="$CFLAGS -DDMRAID_LED" +fi + +if test x$DMRAID_INTEL_LED = xyes; then + CFLAGS="$CFLAGS -DDMRAID_LED -DDMRAID_INTEL_LED" +fi + if test x$DEBUG = xyes; then FLAVOUR="${FLAVOUR}debug " fi
include/dmraid/display.h +6 -6
@@ -9,15 +9,15 @@#define _DISPLAY_H_enum dev_type { -DEVICE =0x01 ,/* ALL devices */ -RAID =0x02 ,/* RAID devices */ -NATIVE =0x04 ,/* Native metadata of RAID devices */ -SET =0x08 ,/* RAID sets */ +DEVICE =0x01 ,/* ALL devices */ +RAID =0x02 ,/* RAID devices */ +NATIVE =0x04 ,/* Native metadata of RAID devices */ +SET =0x08 ,/* RAID sets */ };enum active_type { -D_ALL =0x01 ,/* All devices */ -D_ACTIVE =0x02 ,/* Active devices only */ +D_ALL =0x01 ,/* All devices */ +D_ACTIVE =0x02 ,/* Active devices only */ D_INACTIVE =0x04 ,/* Inactive devices only */ };
include/dmraid/dmraid.h +7 -4
@@ -1,7 +1,10 @@/* -* Copyright (C) 2004,2005 Heinz Mauelshagen, Red Hat GmbH. +* Copyright (C) 2004-2008 Heinz Mauelshagen, Red Hat GmbH. * All rights reserved. * +* Copyright (C) 2007 Intel Corporation. All rights reserved. +* November, 2007 - additions for Create, Delete, Rebuild & Raid 10. +* * See file LICENSE at the top of this source tree for license information. */
@@ -56,7 +59,7 @@*/ extern const char *get_set_type (struct lib_context *lc,void *rs);extern const char *get_set_name (struct lib_context *lc,void *rs); -extern int group_set (struct lib_context *lc,char *name); +extern int group_set (struct lib_context *lc,char **name);extern char *libdmraid_make_table (struct lib_context *lc,struct raid_set *rs);enum activate_type {
@@ -65,8 +68,8 @@ };extern void process_sets (struct lib_context *lc, -int (*func)(struct lib_context *lc,void *rs,int arg), -int arg,enum set_type type); +int (*func) (struct lib_context * lc,void *rs, +int arg),int arg,enum set_type type);extern int change_set (struct lib_context *lc,enum activate_type what,void *rs);
include/dmraid/format.h +110 -41
223 lines not on this page · raw message
include/dmraid/lib_context.h +115 -16
183 lines not on this page · raw message
include/dmraid/list.h +13 -4
@@ -1,7 +1,10 @@/* -* Copyright (C) 2004,2005 Heinz Mauelshagen, Red Hat GmbH. +* Copyright (C) 2004-2008 Heinz Mauelshagen, Red Hat GmbH. * All rights reserved. * +* Copyright (C) 2007 Intel Corporation. All rights reserved. +* November, 2007 - additions for Create, Delete, Rebuild & Raid 10. +* * See file LICENSE at the top of this source tree for license information. */
@@ -23,9 +26,9 @@#define list_empty (pos) ((pos)->next == pos) -static inline void __list_add (struct list_head *new, -struct list_head *prev, -struct list_head *next) +static inline void +__list_add (struct list_head *new, +struct list_head *prev,struct list_head *next) { next->prev = new; new->next = next;
@@ -74,4 +77,10 @@ pos != (head); \ pos = n, n = pos->next) +#define list_for_each_entry_safe (pos, n, head, member) \ + for (pos = list_entry((head)->next, typeof(*pos), member),\ + n = list_entry(pos->member.next, typeof(*pos), member); \ + &pos->member != (head); \ +pos = n, n = list_entry(pos->member.next, typeof(*pos), member)) +#endif
include/dmraid/locking.h +3 -3
@@ -17,9 +17,9 @@struct lib_context ;struct locking {const char *name; -int (*lock)(struct lib_context *lc,struct resource *res); -void (*unlock)(struct lib_context *lc,struct resource *res); -void *private;/* Private context. */ +int (*lock) (struct lib_context * lc,struct resource * res); +void (*unlock) (struct lib_context * lc,struct resource * res); +void *private;/* Private context. */ };extern int init_locking (struct lib_context *lc);
include/dmraid/metadata.h +77 -67
256 lines not on this page · raw message
include/dmraid/misc.h +23 -4
@@ -1,13 +1,18 @@/* -* Copyright (C) 2004,2005 Heinz Mauelshagen, Red Hat GmbH. +* Copyright (C) 2004-2005 Heinz Mauelshagen, Red Hat GmbH. * All rights reserved. * +* Copyright (C) 2007 Intel Corporation. All rights reserved. +* November, 2007 - additions for Create, Delete, Rebuild & Raid 10. +* * See file LICENSE at the top of this source tree for license information. */ #ifndef _MISC_H_#define _MISC_H_ +#define DM_ASSERT (__cond) do { if (!(__cond)) { printf("ASSERT file:%s line:%d fuction:%s cond: %s\n", __FILE__, __LINE__, __FUNCTION__, #__cond); } } while(0); +extern struct lib_context *libdmraid_init (int argc,char **argv);extern void libdmraid_exit (struct lib_context *lc);
@@ -16,8 +21,10 @@extern char *get_basename (struct lib_context *lc,char *str);extern char *get_dirname (struct lib_context *lc,char *str);extern char *remove_white_space (struct lib_context *lc,char *str,size_t len); +extern void remove_tail_space (char *str);extern char *remove_delimiter (char *ptr,char c);extern void add_delimiter (char **ptr,char c); +extern char *replace_delimiter (char *str,char delim,char c);extern int mk_dir (struct lib_context *lc,const char *dir);
@@ -31,21 +38,33 @@extern void free_string (struct lib_context *lc,char **string);extern int p_fmt (struct lib_context *lc,char **string,const char *fmt, ...); -static inline uint64_t round_down (uint64_t what,unsigned int by) +static inline uint64_t +round_down (uint64_t what,unsigned int by) {return what & ~((uint64_t ) by -1 ); } -static inline uint64_t round_up (uint64_t what,unsigned int by) +static inline uint64_t +round_up (uint64_t what,unsigned int by) {uint64_t t =round_down (what, by);return t == what ? t : t + by; } -static inline uint64_t div_up (uint64_t what,unsigned int by) +static inline uint64_t +div_up (uint64_t what,unsigned int by) {return round_up (what, by) / by; } + +#ifdef DMRAID_LED +/* Definitions for LED support */ +#define LED_OFF 0 +#define LED_REBUILD 1 + +int led (char *rd,int status); +#endif +#endif
include/dmraid/reconfig.h +6 -2
@@ -2,8 +2,8 @@* Copyright (C) 2006 Darrick Wong, IBM. * All rights reserved. * -* Copyright (C) 2006 Heinz Mauelshagen Red Hat GmbH. -* All rights reserved. +* Copyright (C) 2006-2008 Heinz Mauelshagen Red Hat GmbH. +* All rights reserved. * * See the file LICENSE at the top of this source tree for license information. */
@@ -50,5 +50,9 @@ struct raid_dev *rd);extern void end_log (struct lib_context *lc,struct list_head *log);extern int revert_log (struct lib_context *lc,struct list_head *log); +extern int hot_spare_add (struct lib_context *lc,struct raid_set *rs); +extern struct raid_set *find_group (struct lib_context *lc, +struct raid_set *sub_rs); +extern int rebuild_raidset (struct lib_context *lc,char *set_name);#endif
lib/.export.sym +58 -51
109 lines not on this page · raw message
lib/version.h +1 -1
@@ -7,6 +7,6 @@#define DMRAID_LIB_SUBMINOR_VERSION 0#define DMRAID_LIB_VERSION_SUFFIX "rc15" -#define DMRAID_LIB_DATE "(2008.04.02)" +#define DMRAID_LIB_DATE "(2008.06.20)"#endif
lib/activate/activate.c +260 -146
804 lines not on this page · raw message
lib/activate/devmapper.c +64 -47
252 lines not on this page · raw message
lib/datastruct/byteorder.h +20 -17
@@ -16,30 +16,33 @@#ifdef DM_BYTEORDER_SWAB -static inline uint64_t le64_to_cpu (uint64_t x) +static inline uint64_t +le64_to_cpu (uint64_t x) { -return ((((uint64_t )x &0x00000000000000ffULL ) <<56 ) | - (((uint64_t )x &0x000000000000ff00ULL ) <<40 ) | - (((uint64_t )x &0x0000000000ff0000ULL ) <<24 ) | - (((uint64_t )x &0x00000000ff000000ULL ) <<8 ) | - (((uint64_t )x &0x000000ff00000000ULL ) >>8 ) | - (((uint64_t )x &0x0000ff0000000000ULL ) >>24 ) | - (((uint64_t )x &0x00ff000000000000ULL ) >>40 ) | - (((uint64_t )x &0xff00000000000000ULL ) >>56 )); +return ((((uint64_t ) x &0x00000000000000ffULL ) <<56 ) | + (((uint64_t ) x &0x000000000000ff00ULL ) <<40 ) | + (((uint64_t ) x &0x0000000000ff0000ULL ) <<24 ) | + (((uint64_t ) x &0x00000000ff000000ULL ) <<8 ) | + (((uint64_t ) x &0x000000ff00000000ULL ) >>8 ) | + (((uint64_t ) x &0x0000ff0000000000ULL ) >>24 ) | + (((uint64_t ) x &0x00ff000000000000ULL ) >>40 ) | + (((uint64_t ) x &0xff00000000000000ULL ) >>56 )); } -static inline int32_t le32_to_cpu (int32_t x) +static inline int32_t +le32_to_cpu (int32_t x) { -return ((((u_int32_t )x &0x000000ffU ) <<24 ) | - (((u_int32_t )x &0x0000ff00U ) <<8 ) | - (((u_int32_t )x &0x00ff0000U ) >>8 ) | - (((u_int32_t )x &0xff000000U ) >>24 )); +return ((((u_int32_t ) x &0x000000ffU ) <<24 ) | + (((u_int32_t ) x &0x0000ff00U ) <<8 ) | + (((u_int32_t ) x &0x00ff0000U ) >>8 ) | + (((u_int32_t ) x &0xff000000U ) >>24 )); } -static inline int16_t le16_to_cpu (int16_t x) +static inline int16_t +le16_to_cpu (int16_t x) { -return ((((u_int16_t )x &0x00ff ) <<8 ) | - (((u_int16_t )x &0xff00 ) >>8 )); +return ((((u_int16_t ) x &0x00ff ) <<8 ) | + (((u_int16_t ) x &0xff00 ) >>8 )); }#define CVT64 (x) do { x = le64_to_cpu(x); } while(0)
lib/device/ata.c +8 -4
@@ -15,7 +15,8 @@#include "dev-io.h" #include "ata.h" -int get_ata_serial (struct lib_context *lc,int fd,struct dev_info *di) +int +get_ata_serial (struct lib_context *lc,int fd,struct dev_info *di) {int ret =0 ;const int cmd_offset =4 ;
@@ -26,11 +27,14 @@ buf[0 ] =ATA_IDENTIFY_DEVICE ; buf[3 ] =1 ;if (!ioctl (fd,HDIO_DRIVE_CMD , buf)) { - ata_ident = (struct ata_identify *) &buf[cmd_offset]; -if ((di->serial =dbg_strdup (remove_white_space (lc, (char *) ata_ident->serial,ATA_SERIAL_LEN )))) + ata_ident = (struct ata_identify *) &buf[cmd_offset]; +if ((di->serial = +dbg_strdup (remove_white_space + (lc, (char *) ata_ident->serial, +ATA_SERIAL_LEN )))) ret =1 ; } - +dbg_free (buf); }
lib/device/ata.h +3 -3
@@ -13,10 +13,10 @@struct ata_identify {unsigned short dummy[10 ];#define ATA_SERIAL_LEN 20 -unsigned char serial[ATA_SERIAL_LEN ]; +unsigned char serial[ATA_SERIAL_LEN ];unsigned short dummy1[3 ]; -unsigned char fw_rev[8 ]; -unsigned char model[40 ]; +unsigned char fw_rev[8 ]; +unsigned char model[40 ];unsigned short dummy2[33 ];unsigned short major_rev_num;unsigned short minor_rev_num;
lib/device/dev-io.h +2 -2
@@ -12,8 +12,8 @@#include <sys/stat.h> #include "internal.h" -#define BLKGETSIZE _IO(0x12, 0x60)/* get block device size */ -#define BLKSSZGET _IO(0x12, 0x68)/* get block device sector size */ +#define BLKGETSIZE _IO(0x12, 0x60)/* get block device size */ +#define BLKSSZGET _IO(0x12, 0x68)/* get block device sector size */ #define DMRAID_SECTOR_SIZE 512
lib/device/scan.c +41 -34
186 lines not on this page · raw message
lib/device/scsi.c +54 -27
138 lines not on this page · raw message
lib/device/scsi.h +7 -1
@@ -1,13 +1,18 @@/* -* Copyright (C) 2004,2005 Heinz Mauelshagen, Red Hat GmbH. +* Copyright (C) 2004-2008 Heinz Mauelshagen, Red Hat GmbH. * All rights reserved. * +* Copyright (C) 2007 Intel Corporation. All rights reserved. +* November, 2007 - additions for Create, Delete, Rebuild & Raid 10. +* * See file LICENSE at the top of this source tree for license information. */ #ifndef _SCSI_H_#define _SCSI_H_ +#include <scsi/sg.h> +/* Ioctl types possible (SG = SCSI generic, OLD = old SCSI command ioctl. */ enum ioctl_type { SG,
@@ -16,5 +21,6 @@int get_scsi_serial (struct lib_context *lc,int fd,struct dev_info *di,enum ioctl_type type); +int get_scsi_id (struct lib_context *lc,int fd,struct sg_scsi_id *sg_id);#endif
lib/display/display.c +112 -93
403 lines not on this page · raw message
lib/format/format.c +125 -99
59 lines not on this page · raw message
lib/format/register.h +1 -2
Lines of this file are not shown. View the raw message.
lib/format/ataraid/asr.c +180 -144
324 lines not on this page · raw message
lib/format/ataraid/asr.h +170 -173
343 lines not on this page · raw message
lib/format/ataraid/hpt37x.c +88 -70
158 lines not on this page · raw message
lib/format/ataraid/hpt37x.h +33 -34
67 lines not on this page · raw message
lib/format/ataraid/hpt45x.c +73 -58
131 lines not on this page · raw message
lib/format/ataraid/hpt45x.h +17 -17
Lines of this file are not shown. View the raw message.
lib/format/ataraid/isw.c +2235 -376
2,611 lines not on this page · raw message
lib/format/ataraid/isw.h +111 -37
148 lines not on this page · raw message
lib/format/ataraid/jm.c +81 -61
142 lines not on this page · raw message
lib/format/ataraid/jm.h +16 -16
Lines of this file are not shown. View the raw message.
lib/format/ataraid/lsi.c +75 -57
132 lines not on this page · raw message
lib/format/ataraid/lsi.h +13 -13
Lines of this file are not shown. View the raw message.
lib/format/ataraid/nv.c +74 -55
129 lines not on this page · raw message
lib/format/ataraid/nv.h +28 -28
56 lines not on this page · raw message
lib/format/ataraid/pdc.c +110 -87
197 lines not on this page · raw message
lib/format/ataraid/pdc.h +33 -33
66 lines not on this page · raw message
lib/format/ataraid/sil.c +114 -87
201 lines not on this page · raw message
lib/format/ataraid/sil.h +44 -44
88 lines not on this page · raw message
lib/format/ataraid/via.c +80 -58
138 lines not on this page · raw message
lib/format/ataraid/via.h +18 -18
Lines of this file are not shown. View the raw message.
lib/format/ddf/ddf1.c +162 -144
306 lines not on this page · raw message
lib/format/ddf/ddf1.h +113 -113
226 lines not on this page · raw message
lib/format/ddf/ddf1_crc.c +54 -40
94 lines not on this page · raw message
lib/format/ddf/ddf1_cvt.c +26 -15
41 lines not on this page · raw message
lib/format/ddf/ddf1_cvt.h +1 -1
Lines of this file are not shown. View the raw message.
lib/format/ddf/ddf1_dump.c +34 -23
57 lines not on this page · raw message
lib/format/ddf/ddf1_lib.c +29 -26
55 lines not on this page · raw message
lib/format/ddf/ddf1_lib.h +11 -8
Lines of this file are not shown. View the raw message.
lib/format/partition/dos.c +81 -71
152 lines not on this page · raw message
lib/format/partition/dos.h +12 -12
Lines of this file are not shown. View the raw message.
lib/format/template/template.c +53 -44
97 lines not on this page · raw message
lib/format/template/template.h +2 -2
Lines of this file are not shown. View the raw message.
lib/locking/locking.c +17 -11
Lines of this file are not shown. View the raw message.
lib/log/log.c +8 -5
Lines of this file are not shown. View the raw message.
lib/metadata/log_ops.c +7 -4
Lines of this file are not shown. View the raw message.
lib/metadata/metadata.c +1198 -192
1,390 lines not on this page · raw message
lib/metadata/reconfig.c +628 -66
694 lines not on this page · raw message
lib/misc/file.c +24 -19
43 lines not on this page · raw message
lib/misc/init.c +10 -4
Lines of this file are not shown. View the raw message.
lib/misc/lib_context.c +61 -44
105 lines not on this page · raw message
lib/misc/misc.c +109 -26
135 lines not on this page · raw message
lib/misc/workaround.c +5 -4
Lines of this file are not shown. View the raw message.
lib/mm/dbg_malloc.c +30 -20
50 lines not on this page · raw message
man/dmraid.8 +187 -420
607 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
+.br
+01: RAID10 (stripe on top of mirrors) Note: Intel OROM displays this as RAID10
+
+.TP
+.I {-n|--native_log} [device-path...]
+Display metadata in native, vendor-specific format.
+In case a metadata format handler is chosen with
+.B -f
+only RAID devices with such format will be displayed in native format.
+If device-path(s) is/are given on the command line, native metadata output
+is restricted to those listed.
+.TP
+.I [{-P|--partchar} CHAR]
+Use CHAR as the separator between the device name and the partition number.
+.TP
+.I {-R| --rebuild} RAID-set [device-path]
+Rebuild raid array after a drive has failed and a new drive is added.
+For Intel chipset based systems, there are two methods in which a new drive
+is added to the system.
+
+1. Using OROM to identify a new drive
+ During system reboot, enter OROM and mark the new drive as the rebuild drive.
+ After booting to the OS, use the dmraid command to rebuild.
+
+ Example: dmraid -R raid_set
+
+2. Using dmraid to identify a new drive
+ Boot to the OS and use the dmraid command with the new drive as
+the second parameter.
+
+ Example: dmraid -R raid_set /dev/sdc
+
+3. Using hot spare drive
+ Mark a drive as hot spare using the "dmraid -f isw -S" command. Then use the dmraid command to start the rebuild.
+
+ Example: dmraid -R raid_set
+
+.TP
+.I {-x|--remove} [RAID-set]
+Delete one or all existing software RAID devices from the metadata.
+
+.TP
+.I -f FORMAT-handler {-C|--create} --type raidlevel [--size=setsize --strip stripsize] --disk "device-path, device-path [,device-path]"
+Delete one or all existing Configure a software RAID device and store the configuration data in a group of hard drive devices consisting of this array. This command requires the following options:
+
+-f FORMAT-handler
+.br
+ metadata format (see "dmraid -l")
+.br
+--type digit[digit...]
+.br
+ specify the raid level of the software RAID set.
+.br
+ 0: raid0
+.br
+ 1: raid1
+.br
+ 5: raid5
+.br
+ 01: raid01 (isw raid10)
+.br
+--size: [digits[k|K|m|M|g|G][b|B]]
+.br
+ specify the size of the RAID set.The number is an integer followed by [kKmMgG] and/or [bB].
+.br
+ b: byte (default)
+.br
+ B: block (512 bytes)
+.br
+ K or K: on the base of 1024
+.br
+ m or M: on the base of 1024*1024
+.br
+ g or G: on the base of 1024*1024*1024
+.br
+If this option is missing, it's set to the default value pre-configured by the vendor. Note that different vendors may apply different constraints on the granularity of the size or the minimal value. +.br
+--strip: [digits[k|K|m|M|g|G][b|B]]
+.br
+ specify the strip size of a RAID1, RAID5, and RAID10 RAID set (as above)
+.br
+--disk: device-path[{,| }device-path...]
+.br
+ specify the array of the hard drives, e.g. /dev/sda.
+
+.TP
+.I -f FORMAT-handler -S -M device-path
+.I -S -M device-path
+
+This command adds hot spare support for one or more RAID sets.
+
+1. When used with a format handler, which supports hot spare sets (e.g. isw), a hot spare is marked to be used when rebuilding any RAID set of that format.
+2. When used when specifying a RAID set, the drive is added to that RAID set and will be used only to rebuild that set. Note: If the specified name does not match an existing RAID-set, a set with the new name will be created. +
+.TP
+.I {-r|--raid_devices} [device-path...]
+List all discovered RAID devices with format, RAID level, sectors used
+and data offset into the device.
+In case a metadata format handler is chosen with
+.B -f
+, only RAID devices with such format can be discovered. Useful if devices
+have multiple metadata signatures.
+If
+.B -D
+is added to
+.B -r
+the RAID metadata gets dumped into a subdirectory named dmraid.format_name
+(eg. format_name = isw) in files named devicename.dat.
+The byte offset where the metadata is located on the device is written
+into files named devicename.offset and the size of the device in sectors
+into files named devicename.size.
+
+If
+.B -E
+is added to
+.B -r
+the RAID metadata on the devices gets conditionally erased.
+Useful to erase old metadata after new one of different type has been
+stored on a device in order to avoid discovering both. If you enter
+.B -E
+option
+.B -D
+will be enforced in order to have a fallback in case the wrong metadata
+got erased.
+Manual copying back onto the device is needed to recover from erasing
+the wrong metadata using the dumped files devicename_formatname.dat
+and devicename_formatname.offset.
+Eg, to restore all *.dat files in the working directory to the respective devices:
+
+.br
+for f in *.dat
+.br
+do
+.br
+ dd if=$f of=/dev/${f%%.dat} \\
+.br
+ seek=cat ${f%%dat}offset bs=1
+.br
+done
+.br
+
+If device-path(s) is/are given on the command line, the above actions
+are restricted to those listed.
+Add
+.B -c
+to display RAID device names only and
+.B -cc
+for CSV column output of RAID device properties.
+See description of
+.B -c
+above for FIELD identifiers.
+
+.TP
+.I --separator SEPARATOR
+Use SEPARATOR as a delimiter for all options taking or displaying lists.
+
+.TP
+.I -s... [a|i] [RAID-set...]
+Display properties of RAID sets. Multiple RAID set names can be given
+on the command line which don't need to be fully specified (eg, "dmraid -s hpt"
+would display all discovered Highpoint RAID sets). Enter
+.B -s
+twice to display RAID subsets too.
+Add
+.B -c
+to display names of RAID sets only,
+.B -cc
+for CSV column output of RAID set properties and
+.B -ccc
+for inclusion of block devices in the listing. Doesn't imply
+.B -s -s
+to show RAID subsets (implied for group sets, e.g. isw).
+Add
+.B -g
+to include information about group RAID sets (as with Intel Software
+RAID) in the listing.
+See description of
+.B -c
+above for FIELD identifiers.
+Note: Size is given in sectors (not bytes).
+
+.TP
+.I [-v|--verbose]...
+Enable verbose runtime information output. Opion can be given multiple times
+increasing the verbosity level.
+
+.SH EXAMPLES
+"dmraid -l" lists all supported metadata formats with their names along with
+some descriptive information, eg:
+.br
+hpt37x : (+) Highpoint HPT37X
+.br
+hpt45x : (+) Highpoint HPT45X
+.br
+isw : (+) Intel Software RAID
+.br
+lsi : (0) LSI Logic MegaRAID
+.br
+nvidia : (+) NVidia RAID
+.br
+pdc : (+) Promise FastTrack
+.br
+sil : (+) Silicon Image(tm) Medley(tm)
+.br
+via : (+) VIA Software RAID
+.br
+dos : (+) DOS partitions on SW RAIDs
+.br
+(0): Discover, (+): Discover+Activate
+
+"dmraid -ay" activates all software RAID sets discovered.
+
+"dmraid -an" deactivates all active software RAID sets which are not open
+(eg, mounted filesystem on them).
+
+"dmraid -ay -f pdc" (pdc looked up from "dmraid -l") activates all
+software RAID sets with Promise format discovered and ignores all other
+supported formats.
+
+"dmraid -r" discovers all software RAID devices supported on your system, eg:
+.br
+/dev/dm-46: hpt45x, "hpt45x_chidjhaiaa-0", striped, ok, 320172928 sectors, data@ 0
+.br
+/dev/dm-50: hpt45x, "hpt45x_chidjhaiaa-0", striped, ok, 320172928 sectors, data@ 0
+.br
+/dev/dm-54: hpt45x, "hpt45x_chidjhaiaa-1", striped, ok, 320172928 sectors, data@ 0
+.br
+/dev/dm-58: hpt45x, "hpt45x_chidjhaiaa-1", striped, ok, 320172928 sectors, data@ 0
+
+
+"dmraid -s -s hpt45x_chidjhaiaa" displays properties of
+set "hpt45x_chidjhaiaa", eg:
+.br
+*** Superset
+.br
+name : hpt45x_chidjhaiaa
+.br
+size : 640345856
+.br
+stride : 128
+.br
+type : raid10
+.br
+status : ok
+.br
+subsets: 2
+.br
+dev : 4
+.br
+spare : 0
+.br
+---> Subset
+.br
+name : hpt45x_chidjhaiaa-0
+.br
+size : 640345856
+.br
+stride : 128
+.br
+type : stripe
+.br
+status : ok
+.br
+subsets: 0
+.br
+dev : 2
+.br
+spare : 0
+.br
+---> Subset
+.br
+name : hpt45x_chidjhaiaa-1
+.br
+size : 640345856
+.br
+stride : 128
+.br
+type : stripe
+.br
+status : ok
+.br
+subsets: 0
+.br
+dev : 2
+.br
+spare : 0
+.br
+
+"dmraid -s -ccs hpt45" displays properties in column format of all sets
+and subsets with hpt45* format, eg:
+.br
+hpt45x_chidjhaiaa,640345856,128,raid10,ok,4,0
+.br
+hpt45x_chidjhaiaa-a,640345856,128,stripe,ok,2,0
+.br
+hpt45x_chidjhaiaa-b,640345856,128,stripe,ok,2,0
+
+"dmraid -r --sep : -cpath:size" display paths and sizes in sectors for
+RAID devices in column format using ':' as a delimiter, eg:
+.br
+/dev/dm-8:320173055
+.br
+/dev/dm-12:320173055
+.br
+/dev/dm-22:320173055
+.br
+/dev/dm-26:320173055
+.br
+/dev/dm-30:586114703
+.br
+/dev/dm-34:586114703
+.br
+/dev/dm-38:586114703
+.br
+/dev/dm-42:586114703
+.br
+/dev/dm-46:156301487
+.br
+/dev/dm-50:156301487
+.br
+/dev/dm-54:390624896
+.br
+/dev/dm-58:390624896
+.br
+/dev/dm-62:390624896
+.br
+/dev/dm-66:390624896
+
+"dmraid -f isw -C Raid0 --type 0 --strip 8k --size 20g --disk "/dev/sdb /dev/sdc"" creates an ISW volume with
+a name of "Raid0", 20Gig bytes in total, and 8kilo bytes strip size on two disks.
+
+"dmraid -f isw -C Test0 --type 0 --disk "/dev/sdd /dev/sde"" creates an ISW volume with the default size and strip size.
+
+"dmraid -f isw -C Test10 --type 01 --strip 128B --disk "/dev/sda /dev/sdb /dev/sdc /dev/sdd" creates a stacked
+RAID device, RAID10 (isw format), with a name of "Test10", 128 blocks (512bytes) strip size , and the default volume size on
+4 disks.
+
+"dmraid -f isw -S -M /dev/sde" marks the device /dev/sde as a hot spare for rebuild
+
+"dmraid -R isw_djaggchdde_RAID1 /dev/sde" starts rebuild of the RAID volume on device /dev/sde
+
+.SH DIAGNOSTICS
+dmraid returns an exit code of 0 for success or 1 for error.
+
+.SH AUTHOR
+Heinz Mauelshagen <[email protected]>
tools/VERSION +1 -1
Lines of this file are not shown. View the raw message.
tools/commands.c +556 -372
928 lines not on this page · raw message
tools/commands.h +4 -74
78 lines not on this page · raw message
tools/dmraid.c +4 -4
Lines of this file are not shown. View the raw message.
tools/toollib.c +24 -47
71 lines not on this page · raw message
tools/toollib.h +2 -2
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.