Remove lots of unnecessary white space.

Now that I am using white-space mode in Emacs I can see all of this,
and I don't like it :-)

Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown 2013-06-19 12:31:45 +10:00
parent e6dd89da86
commit 1011e8344a
51 changed files with 68 additions and 201 deletions

View File

@ -1897,4 +1897,3 @@ int assemble_container_content(struct supertype *st, int mdfd,
} }
} }
#endif #endif

2
Grow.c
View File

@ -1537,7 +1537,6 @@ int Grow_reshape(char *devname, int fd,
struct mdinfo info; struct mdinfo info;
struct mdinfo *sra; struct mdinfo *sra;
if (ioctl(fd, GET_ARRAY_INFO, &array) < 0) { if (ioctl(fd, GET_ARRAY_INFO, &array) < 0) {
pr_err("%s is not an active md array - aborting\n", pr_err("%s is not an active md array - aborting\n",
devname); devname);
@ -2793,7 +2792,6 @@ static int reshape_array(char *container, int fd, char *devname,
Manage_subdevs(devname, fd, devlist, verbose, Manage_subdevs(devname, fd, devlist, verbose,
0,NULL, 0); 0,NULL, 0);
if (reshape.backup_blocks == 0 && data_offset) if (reshape.backup_blocks == 0 && data_offset)
reshape.backup_blocks = reshape.before.data_disks * info->array.chunk_size/512; reshape.backup_blocks = reshape.before.data_disks * info->array.chunk_size/512;
if (reshape.backup_blocks == 0) { if (reshape.backup_blocks == 0) {

View File

@ -298,4 +298,3 @@ DISTRO_MAKEFILE := $(wildcard distropkg/Makefile)
ifdef DISTRO_MAKEFILE ifdef DISTRO_MAKEFILE
include $(DISTRO_MAKEFILE) include $(DISTRO_MAKEFILE)
endif endif

View File

@ -204,7 +204,6 @@ int Monitor(struct mddev_dev *devlist,
} }
} }
while (! finished) { while (! finished) {
int new_found = 0; int new_found = 0;
struct state *st; struct state *st;
@ -855,7 +854,6 @@ static dev_t container_choose_spare(struct state *from, struct state *to,
return dev; return dev;
} }
static void try_spare_migration(struct state *statelist, struct alert_info *info) static void try_spare_migration(struct state *statelist, struct alert_info *info)
{ {
struct state *from; struct state *from;

View File

@ -124,4 +124,3 @@ int Query(char *dev)
} }
return 0; return 0;
} }

View File

@ -147,7 +147,6 @@ void free_line(char *line)
dl_free(line); dl_free(line);
} }
struct conf_dev { struct conf_dev {
struct conf_dev *next; struct conf_dev *next;
char *name; char *name;
@ -568,7 +567,6 @@ void mailfromline(char *line)
} }
} }
static char *alert_program = NULL; static char *alert_program = NULL;
void programline(char *line) void programline(char *line)
{ {
@ -987,7 +985,6 @@ int devname_matches(char *name, char *match)
else if (strncmp(match, "/dev/", 5) == 0) else if (strncmp(match, "/dev/", 5) == 0)
match += 5; match += 5;
if (strncmp(name, "md", 2) == 0 && if (strncmp(name, "md", 2) == 0 &&
isdigit(name[2])) isdigit(name[2]))
name += 2; name += 2;

View File

@ -11,7 +11,6 @@ char *strncpy(char *dest, const char *src, size_t n) __THROW;
void *xcalloc(size_t num, size_t size); void *xcalloc(size_t num, size_t size);
#include "dlink.h" #include "dlink.h"
void *dl_head() void *dl_head()
{ {
void *h; void *h;

4
lib.c
View File

@ -112,8 +112,6 @@ char *fd2devnm(int fd)
return NULL; return NULL;
} }
/* /*
* convert a major/minor pair for a block device into a name in /dev, if possible. * convert a major/minor pair for a block device into a name in /dev, if possible.
* On the first call, walk /dev collecting name. * On the first call, walk /dev collecting name.
@ -233,8 +231,6 @@ char *map_dev_preferred(int major, int minor, int create,
return preferred ? preferred : regular; return preferred ? preferred : regular;
} }
/* conf_word gets one word from the conf file. /* conf_word gets one word from the conf file.
* if "allow_key", then accept words at the start of a line, * if "allow_key", then accept words at the start of a line,
* otherwise stop when such a word is found. * otherwise stop when such a word is found.

View File

@ -639,7 +639,6 @@ static void manage_new(struct mdstat_ent *mdstat,
GET_LEVEL|GET_CHUNK|GET_DISKS|GET_COMPONENT| GET_LEVEL|GET_CHUNK|GET_DISKS|GET_COMPONENT|
GET_DEGRADED|GET_DEVS|GET_OFFSET|GET_SIZE|GET_STATE); GET_DEGRADED|GET_DEVS|GET_OFFSET|GET_SIZE|GET_STATE);
if (!mdi) if (!mdi)
return; return;
new = xcalloc(1, sizeof(*new)); new = xcalloc(1, sizeof(*new));

View File

@ -46,7 +46,6 @@
#include <sys/file.h> #include <sys/file.h>
#include <ctype.h> #include <ctype.h>
#define MAP_READ 0 #define MAP_READ 0
#define MAP_NEW 1 #define MAP_NEW 1
#define MAP_LOCK 2 #define MAP_LOCK 2
@ -105,7 +104,6 @@ int map_write(struct map_ent *mel)
mapname[0]) == 0; mapname[0]) == 0;
} }
static FILE *lf = NULL; static FILE *lf = NULL;
int map_lock(struct map_ent **melp) int map_lock(struct map_ent **melp)
{ {

3
maps.c
View File

@ -24,7 +24,6 @@
#include "mdadm.h" #include "mdadm.h"
/* name/number mappings */ /* name/number mappings */
mapping_t r5layout[] = { mapping_t r5layout[] = {
@ -97,7 +96,6 @@ mapping_t pers[] = {
{ NULL, 0} { NULL, 0}
}; };
mapping_t modes[] = { mapping_t modes[] = {
{ "assemble", ASSEMBLE}, { "assemble", ASSEMBLE},
{ "build", BUILD}, { "build", BUILD},
@ -150,4 +148,3 @@ int map_name(mapping_t *map, char *name)
} }
return UnSet; return UnSet;
} }

1
md_p.h
View File

@ -196,4 +196,3 @@ static inline __u64 md_event(mdp_super_t *sb) {
} }
#endif #endif

1
md_u.h
View File

@ -120,4 +120,3 @@ typedef struct mdu_param_s
} mdu_param_t; } mdu_param_t;
#endif #endif

View File

@ -29,7 +29,6 @@
#include "md_p.h" #include "md_p.h"
#include <ctype.h> #include <ctype.h>
static int scan_assemble(struct supertype *ss, static int scan_assemble(struct supertype *ss,
struct context *c, struct context *c,
struct mddev_ident *ident); struct mddev_ident *ident);
@ -40,7 +39,6 @@ static int misc_list(struct mddev_dev *devlist,
char *dump_directory, char *dump_directory,
struct supertype *ss, struct context *c); struct supertype *ss, struct context *c);
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
int mode = 0; int mode = 0;
@ -423,7 +421,6 @@ int main(int argc, char *argv[])
writemostly = 2; writemostly = 2;
continue; continue;
case O(GROW,'z'): case O(GROW,'z'):
case O(CREATE,'z'): case O(CREATE,'z'):
case O(BUILD,'z'): /* size */ case O(BUILD,'z'): /* size */

View File

@ -621,4 +621,3 @@ AUTO +1.x homehost \-all
.SH SEE ALSO .SH SEE ALSO
.BR mdadm (8), .BR mdadm (8),
.BR md (4). .BR md (4).

View File

@ -51,7 +51,6 @@ extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence));
#define srandom srand #define srandom srand
#endif #endif
#include <linux/kdev_t.h> #include <linux/kdev_t.h>
/*#include <linux/fs.h> */ /*#include <linux/fs.h> */
#include <sys/mount.h> #include <sys/mount.h>
@ -162,7 +161,6 @@ extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence));
#endif #endif
#endif /* __KLIBC__ */ #endif /* __KLIBC__ */
/* /*
* min()/max()/clamp() macros that also do * min()/max()/clamp() macros that also do
* strict type-checking.. See the * strict type-checking.. See the
@ -448,7 +446,6 @@ typedef struct mapping {
int num; int num;
} mapping_t; } mapping_t;
struct mdstat_ent { struct mdstat_ent {
char *dev; char *dev;
char devnm[32]; char devnm[32];
@ -605,7 +602,6 @@ static inline char *map_dev(int major, int minor, int create)
struct active_array; struct active_array;
struct metadata_update; struct metadata_update;
/* 'struct reshape' records the intermediate states of /* 'struct reshape' records the intermediate states of
* a general reshape. * a general reshape.
* The starting geometry is converted to the 'before' geometry * The starting geometry is converted to the 'before' geometry
@ -1156,7 +1152,6 @@ struct stat64;
extern int add_dev(const char *name, const struct stat *stb, int flag, struct FTW *s); extern int add_dev(const char *name, const struct stat *stb, int flag, struct FTW *s);
extern int Manage_ro(char *devname, int fd, int readonly); extern int Manage_ro(char *devname, int fd, int readonly);
extern int Manage_run(char *devname, int fd, int quiet); extern int Manage_run(char *devname, int fd, int quiet);
extern int Manage_stop(char *devname, int fd, int quiet, extern int Manage_stop(char *devname, int fd, int quiet,
@ -1436,7 +1431,6 @@ char *xstrdup(const char *str);
#define LEVEL_CONTAINER (-100) #define LEVEL_CONTAINER (-100)
#define LEVEL_UNSUPPORTED (-200) #define LEVEL_UNSUPPORTED (-200)
/* faulty stuff */ /* faulty stuff */
#define WriteTransient 0 #define WriteTransient 0
@ -1456,7 +1450,6 @@ char *xstrdup(const char *str);
#define ModeMask 0x1f #define ModeMask 0x1f
#define ModeShift 5 #define ModeShift 5
#ifdef __TINYC__ #ifdef __TINYC__
#undef minor #undef minor
#undef major #undef major
@ -1494,7 +1487,6 @@ char *xstrdup(const char *str);
#define ALGORITHM_ROTATING_N_RESTART 9 /* DDF PRL=6 RLQ=2 */ #define ALGORITHM_ROTATING_N_RESTART 9 /* DDF PRL=6 RLQ=2 */
#define ALGORITHM_ROTATING_N_CONTINUE 10 /*DDF PRL=6 RLQ=3 */ #define ALGORITHM_ROTATING_N_CONTINUE 10 /*DDF PRL=6 RLQ=3 */
/* For every RAID5 algorithm we define a RAID6 algorithm /* For every RAID5 algorithm we define a RAID6 algorithm
* with exactly the same layout for data and parity, and * with exactly the same layout for data and parity, and
* with the Q block always on the last device (N-1). * with the Q block always on the last device (N-1).

View File

@ -26,7 +26,6 @@ enum array_state { clear, inactive, suspended, readonly, read_auto,
enum sync_action { idle, reshape, resync, recover, check, repair, bad_action }; enum sync_action { idle, reshape, resync, recover, check, repair, bad_action };
struct active_array { struct active_array {
struct mdinfo info; struct mdinfo info;
struct supertype *container; struct supertype *container;
@ -73,7 +72,6 @@ extern struct active_array *discard_this;
extern struct active_array *pending_discard; extern struct active_array *pending_discard;
extern struct md_generic_cmd *active_cmd; extern struct md_generic_cmd *active_cmd;
void remove_pidfile(char *devname); void remove_pidfile(char *devname);
void do_monitor(struct supertype *container); void do_monitor(struct supertype *container);
void do_manager(struct supertype *container); void do_manager(struct supertype *container);
@ -97,4 +95,3 @@ static inline int is_resync_complete(struct mdinfo *array)
return 1; return 1;
return 0; return 0;
} }

View File

@ -53,5 +53,3 @@ chmod +x initramfs/init
) > init.cpio.gz ) > init.cpio.gz
rm -rf initramfs rm -rf initramfs
ls -l init.cpio.gz ls -l init.cpio.gz

1
msg.c
View File

@ -78,7 +78,6 @@ static int recv_buf(int fd, void* buf, int len, int tmo)
return 0; return 0;
} }
int send_message(int fd, struct metadata_update *msg, int tmo) int send_message(int fd, struct metadata_update *msg, int tmo)
{ {
__s32 len = msg->len; __s32 len = msg->len;

1
msg.h
View File

@ -17,7 +17,6 @@
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
struct mdinfo; struct mdinfo;
struct metadata_update; struct metadata_update;

3
part.h
View File

@ -26,7 +26,6 @@
/* Structure definitions ext for MBR and GPT partition tables /* Structure definitions ext for MBR and GPT partition tables
*/ */
#define MBR_SIGNATURE_MAGIC __cpu_to_le16(0xAA55) #define MBR_SIGNATURE_MAGIC __cpu_to_le16(0xAA55)
#define MBR_PARTITIONS 4 #define MBR_PARTITIONS 4
@ -49,8 +48,6 @@ struct MBR {
__u16 magic; __u16 magic;
} __attribute__((packed)); } __attribute__((packed));
#define GPT_SIGNATURE_MAGIC __cpu_to_le64(0x5452415020494645ULL) #define GPT_SIGNATURE_MAGIC __cpu_to_le64(0x5452415020494645ULL)
#define MBR_GPT_PARTITION_TYPE 0xEE #define MBR_GPT_PARTITION_TYPE 0xEE

View File

@ -30,7 +30,6 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <limits.h> #include <limits.h>
static int devpath_to_ll(const char *dev_path, const char *entry, static int devpath_to_ll(const char *dev_path, const char *entry,
unsigned long long *val); unsigned long long *val);
@ -125,7 +124,6 @@ struct sys_dev *find_driver_devices(const char *bus, const char *driver)
return head; return head;
} }
static struct sys_dev *intel_devices=NULL; static struct sys_dev *intel_devices=NULL;
static time_t valid_time = 0; static time_t valid_time = 0;
@ -155,7 +153,6 @@ static int devpath_to_ll(const char *dev_path, const char *entry, unsigned long
return n; return n;
} }
static __u16 devpath_to_vendor(const char *dev_path) static __u16 devpath_to_vendor(const char *dev_path)
{ {
char path[strlen(dev_path) + strlen("/vendor") + 1]; char path[strlen(dev_path) + strlen("/vendor") + 1];
@ -254,7 +251,6 @@ static int scan(const void *start, const void *end, const void *data)
return 0; return 0;
} }
const struct imsm_orom *imsm_platform_test(enum sys_dev_type hba_id, int *populated, const struct imsm_orom *imsm_platform_test(enum sys_dev_type hba_id, int *populated,
struct imsm_orom *imsm_orom) struct imsm_orom *imsm_orom)
{ {
@ -289,8 +285,6 @@ const struct imsm_orom *imsm_platform_test(enum sys_dev_type hba_id, int *popula
return imsm_orom; return imsm_orom;
} }
static const struct imsm_orom *find_imsm_hba_orom(enum sys_dev_type hba_id) static const struct imsm_orom *find_imsm_hba_orom(enum sys_dev_type hba_id)
{ {
unsigned long align; unsigned long align;
@ -346,7 +340,6 @@ static const struct imsm_orom *find_imsm_hba_orom(enum sys_dev_type hba_id)
(c) & 0xff, ((c) >> 8) & 0xff, \ (c) & 0xff, ((c) >> 8) & 0xff, \
(d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }}) (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }})
#define SYS_EFI_VAR_PATH "/sys/firmware/efi/vars" #define SYS_EFI_VAR_PATH "/sys/firmware/efi/vars"
#define SCU_PROP "RstScuV" #define SCU_PROP "RstScuV"
#define AHCI_PROP "RstSataV" #define AHCI_PROP "RstSataV"
@ -447,7 +440,6 @@ const struct imsm_orom *find_imsm_capability(enum sys_dev_type hba_id)
{ {
const struct imsm_orom *cap=NULL; const struct imsm_orom *cap=NULL;
if ((cap = find_imsm_efi(hba_id)) != NULL) if ((cap = find_imsm_efi(hba_id)) != NULL)
return cap; return cap;
if ((cap = find_imsm_hba_orom(hba_id)) != NULL) if ((cap = find_imsm_hba_orom(hba_id)) != NULL)

View File

@ -133,7 +133,6 @@ static inline int imsm_orom_has_chunk(const struct imsm_orom *orom, int chunk)
return !!(orom->sss & (1 << (fs - 1))); return !!(orom->sss & (1 << (fs - 1)));
} }
/** /**
* fls - find last (most-significant) bit set * fls - find last (most-significant) bit set
* @x: the word to search * @x: the word to search
@ -208,4 +207,3 @@ int disk_attached_to_hba(int fd, const char *hba_path);
char *devt_to_devpath(dev_t dev); char *devt_to_devpath(dev_t dev);
int path_attached_to_hba(const char *disk_path, const char *hba_path); int path_attached_to_hba(const char *disk_path, const char *hba_path);
const char *get_sys_dev_type(enum sys_dev_type); const char *get_sys_dev_type(enum sys_dev_type);

View File

@ -401,7 +401,6 @@ void pol_add(struct dev_policy **pol,
pol_dedup(*pol); pol_dedup(*pol);
} }
/* /*
* disk_policy() gathers policy information for the * disk_policy() gathers policy information for the
* disk described in the given mdinfo (disk.{major,minor}). * disk described in the given mdinfo (disk.{major,minor}).
@ -592,7 +591,6 @@ int disk_action_allows(struct mdinfo *disk, const char *metadata, enum policy_ac
return rv; return rv;
} }
/* Domain policy: /* Domain policy:
* Any device can have a list of domains asserted by different policy * Any device can have a list of domains asserted by different policy
* statements. * statements.
@ -703,7 +701,6 @@ void domain_add(struct domainlist **domp, char *domain)
domain_merge_one(domp, domain); domain_merge_one(domp, domain);
} }
void domain_free(struct domainlist *dl) void domain_free(struct domainlist *dl)
{ {
while (dl) { while (dl) {

View File

@ -43,7 +43,6 @@ void raid6_2data_recov(int disks, size_t bytes, int faila, int failb,
uint8_t **ptrs); uint8_t **ptrs);
void xor_blocks(char *target, char **sources, int disks, int size); void xor_blocks(char *target, char **sources, int disks, int size);
/* Collect per stripe consistency information */ /* Collect per stripe consistency information */
void raid6_collect(int chunk_size, uint8_t *p, uint8_t *q, void raid6_collect(int chunk_size, uint8_t *p, uint8_t *q,
char *chunkP, char *chunkQ, int *results) char *chunkP, char *chunkQ, int *results)
@ -144,7 +143,6 @@ int unlock_all_stripes(struct mdinfo *info, sighandler_t *sig) {
return rv * 256; return rv * 256;
} }
int check_stripes(struct mdinfo *info, int *source, unsigned long long *offsets, int check_stripes(struct mdinfo *info, int *source, unsigned long long *offsets,
int raid_disks, int chunk_size, int level, int layout, int raid_disks, int chunk_size, int level, int layout,
unsigned long long start, unsigned long long length, char *name[], unsigned long long start, unsigned long long length, char *name[],
@ -308,7 +306,6 @@ int check_stripes(struct mdinfo *info, int *source, unsigned long long *offsets,
} }
write_res1 = write(source[failed_disk1], stripes[failed_disk1], chunk_size); write_res1 = write(source[failed_disk1], stripes[failed_disk1], chunk_size);
seek_res = lseek64(source[failed_disk2], seek_res = lseek64(source[failed_disk2],
offsets[failed_disk2] + start * chunk_size, SEEK_SET); offsets[failed_disk2] + start * chunk_size, SEEK_SET);
if (seek_res < 0) { if (seek_res < 0) {
@ -364,7 +361,6 @@ int check_stripes(struct mdinfo *info, int *source, unsigned long long *offsets,
} }
} }
length--; length--;
start++; start++;
} }

View File

@ -83,7 +83,6 @@ int geo_map(int block, unsigned long long stripe, int raid_disks,
case 500 + ALGORITHM_PARITY_0: case 500 + ALGORITHM_PARITY_0:
return block + 1; return block + 1;
case 600 + ALGORITHM_PARITY_N_6: case 600 + ALGORITHM_PARITY_N_6:
if (block == -2) if (block == -2)
return raid_disks - 1; return raid_disks - 1;
@ -131,7 +130,6 @@ int geo_map(int block, unsigned long long stripe, int raid_disks,
return raid_disks - 1; return raid_disks - 1;
return block + 1; return block + 1;
case 600 + ALGORITHM_PARITY_0: case 600 + ALGORITHM_PARITY_0:
if (block == -1) if (block == -1)
return 0; return 0;
@ -173,7 +171,6 @@ int geo_map(int block, unsigned long long stripe, int raid_disks,
if (block == -2) return (pd+1) % raid_disks; if (block == -2) return (pd+1) % raid_disks;
return (pd + 2 + block) % raid_disks; return (pd + 2 + block) % raid_disks;
case 600 + ALGORITHM_ROTATING_N_RESTART: case 600 + ALGORITHM_ROTATING_N_RESTART:
/* Same a left_asymmetric, by first stripe is /* Same a left_asymmetric, by first stripe is
* D D D P Q rather than * D D D P Q rather than
@ -210,7 +207,6 @@ static int is_ddf(int layout)
} }
} }
void xor_blocks(char *target, char **sources, int disks, int size) void xor_blocks(char *target, char **sources, int disks, int size)
{ {
int i, j; int i, j;
@ -243,7 +239,6 @@ void qsyndrome(uint8_t *p, uint8_t *q, uint8_t **sources, int disks, int size)
} }
} }
/* /*
* The following was taken from linux/drivers/md/mktables.c, and modified * The following was taken from linux/drivers/md/mktables.c, and modified
* to create in-memory tables rather than C code * to create in-memory tables rather than C code
@ -436,11 +431,9 @@ int raid6_check_disks(int data_disks, int start, int chunk_size,
if((Px != 0) && (Qx == 0)) if((Px != 0) && (Qx == 0))
curr_broken_disk = diskP; curr_broken_disk = diskP;
if((Px == 0) && (Qx != 0)) if((Px == 0) && (Qx != 0))
curr_broken_disk = diskQ; curr_broken_disk = diskQ;
if((Px != 0) && (Qx != 0)) { if((Px != 0) && (Qx != 0)) {
data_id = (raid6_gflog[Qx] - raid6_gflog[Px]); data_id = (raid6_gflog[Qx] - raid6_gflog[Px]);
if(data_id < 0) data_id += 255; if(data_id < 0) data_id += 255;

1
sha1.c
View File

@ -50,7 +50,6 @@
64-byte boundary. (RFC 1321, 3.1: Step 1) */ 64-byte boundary. (RFC 1321, 3.1: Step 1) */
static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ }; static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ };
/* Take a pointer to a 160 bit block of data (five 32 bit ints) and /* Take a pointer to a 160 bit block of data (five 32 bit ints) and
initialize it to the start constants of the SHA1 algorithm. This initialize it to the start constants of the SHA1 algorithm. This
must be called before using hash in the call to sha1_hash. */ must be called before using hash in the call to sha1_hash. */

3
sha1.h
View File

@ -84,7 +84,6 @@ struct sha1_ctx
sha1_uint32 buffer[32]; sha1_uint32 buffer[32];
}; };
/* Initialize structure containing state of computation. */ /* Initialize structure containing state of computation. */
extern void sha1_init_ctx (struct sha1_ctx *ctx); extern void sha1_init_ctx (struct sha1_ctx *ctx);
@ -111,7 +110,6 @@ extern void sha1_process_bytes (const void *buffer, size_t len,
aligned for a 32 bits value. */ aligned for a 32 bits value. */
extern void *sha1_finish_ctx (struct sha1_ctx *ctx, void *resbuf); extern void *sha1_finish_ctx (struct sha1_ctx *ctx, void *resbuf);
/* Put result from CTX in first 20 bytes following RESBUF. The result is /* Put result from CTX in first 20 bytes following RESBUF. The result is
always in little endian byte order, so that a byte-wise output yields always in little endian byte order, so that a byte-wise output yields
to the wanted ASCII representation of the message digest. to the wanted ASCII representation of the message digest.
@ -120,7 +118,6 @@ extern void *sha1_finish_ctx (struct sha1_ctx *ctx, void *resbuf);
aligned for a 32 bits value. */ aligned for a 32 bits value. */
extern void *sha1_read_ctx (const struct sha1_ctx *ctx, void *resbuf); extern void *sha1_read_ctx (const struct sha1_ctx *ctx, void *resbuf);
/* Compute SHA1 message digest for bytes read from STREAM. The /* Compute SHA1 message digest for bytes read from STREAM. The
resulting message digest number will be written into the 20 bytes resulting message digest number will be written into the 20 bytes
beginning at RESBLOCK. */ beginning at RESBLOCK. */

View File

@ -235,7 +235,6 @@ struct bbm_log {
struct bbm_log_entry mapped_block_entries[BBM_LOG_MAX_ENTRIES]; struct bbm_log_entry mapped_block_entries[BBM_LOG_MAX_ENTRIES];
} __attribute__ ((__packed__)); } __attribute__ ((__packed__));
#ifndef MDASSEMBLE #ifndef MDASSEMBLE
static char *map_state_str[] = { "normal", "uninitialized", "degraded", "failed" }; static char *map_state_str[] = { "normal", "uninitialized", "degraded", "failed" };
#endif #endif
@ -249,7 +248,6 @@ static char *map_state_str[] = { "normal", "uninitialized", "degraded", "failed"
* MIGR_REC_BUF_SIZE <= MIGR_REC_POSITION * MIGR_REC_BUF_SIZE <= MIGR_REC_POSITION
*/ */
#define UNIT_SRC_NORMAL 0 /* Source data for curr_migr_unit must #define UNIT_SRC_NORMAL 0 /* Source data for curr_migr_unit must
* be recovered using srcMap */ * be recovered using srcMap */
#define UNIT_SRC_IN_CP_AREA 1 /* Source data for curr_migr_unit has #define UNIT_SRC_IN_CP_AREA 1 /* Source data for curr_migr_unit has
@ -508,7 +506,6 @@ struct imsm_update_add_remove_disk {
enum imsm_update_type type; enum imsm_update_type type;
}; };
static const char *_sys_dev_type[] = { static const char *_sys_dev_type[] = {
[SYS_DEV_UNKNOWN] = "Unknown", [SYS_DEV_UNKNOWN] = "Unknown",
[SYS_DEV_SAS] = "SAS", [SYS_DEV_SAS] = "SAS",
@ -591,7 +588,6 @@ static struct sys_dev* find_disk_attached_hba(int fd, const char *devname)
return NULL; return NULL;
} }
static int find_intel_hba_capability(int fd, struct intel_super *super, static int find_intel_hba_capability(int fd, struct intel_super *super,
char *devname); char *devname);
@ -2427,7 +2423,6 @@ static int imsm_create_metadata_checkpoint_update(
return update_memory_size; return update_memory_size;
} }
static void imsm_update_metadata_locally(struct supertype *st, static void imsm_update_metadata_locally(struct supertype *st,
void *buf, int len); void *buf, int len);
@ -2770,7 +2765,6 @@ static __u8 imsm_check_degraded(struct intel_super *super, struct imsm_dev *dev,
static int imsm_count_failed(struct intel_super *super, struct imsm_dev *dev, static int imsm_count_failed(struct intel_super *super, struct imsm_dev *dev,
int look_in_map); int look_in_map);
#ifndef MDASSEMBLE #ifndef MDASSEMBLE
static void manage_second_map(struct intel_super *super, struct imsm_dev *dev) static void manage_second_map(struct intel_super *super, struct imsm_dev *dev)
{ {
@ -3130,7 +3124,6 @@ static int compare_super_imsm(struct supertype *st, struct supertype *tst)
} }
/* if 'first' is a spare promote it to a populated mpb with sec's /* if 'first' is a spare promote it to a populated mpb with sec's
* family number * family number
*/ */
@ -4202,7 +4195,6 @@ imsm_thunderdome(struct intel_super **super_list, int len)
return champion; return champion;
} }
static int static int
get_sra_super_block(int fd, struct intel_super **super_list, char *devname, int *max, int keep_fd); get_sra_super_block(int fd, struct intel_super **super_list, char *devname, int *max, int keep_fd);
static int get_super_block(struct intel_super **super_list, char *devnm, char *devname, static int get_super_block(struct intel_super **super_list, char *devnm, char *devname,
@ -4211,7 +4203,6 @@ static int
get_devlist_super_block(struct md_list *devlist, struct intel_super **super_list, get_devlist_super_block(struct md_list *devlist, struct intel_super **super_list,
int *max, int keep_fd); int *max, int keep_fd);
static int load_super_imsm_all(struct supertype *st, int fd, void **sbp, static int load_super_imsm_all(struct supertype *st, int fd, void **sbp,
char *devname, struct md_list *devlist, char *devname, struct md_list *devlist,
int keep_fd) int keep_fd)
@ -4274,7 +4265,6 @@ static int load_super_imsm_all(struct supertype *st, int fd, void **sbp,
free_imsm(s); free_imsm(s);
} }
if (err) if (err)
return err; return err;
@ -4291,7 +4281,6 @@ static int load_super_imsm_all(struct supertype *st, int fd, void **sbp,
return 0; return 0;
} }
static int static int
get_devlist_super_block(struct md_list *devlist, struct intel_super **super_list, get_devlist_super_block(struct md_list *devlist, struct intel_super **super_list,
int *max, int keep_fd) int *max, int keep_fd)
@ -5019,7 +5008,6 @@ static int add_to_super_imsm(struct supertype *st, mdu_disk_info_t *dk,
return 0; return 0;
} }
static int remove_from_super_imsm(struct supertype *st, mdu_disk_info_t *dk) static int remove_from_super_imsm(struct supertype *st, mdu_disk_info_t *dk)
{ {
struct intel_super *super = st->sb; struct intel_super *super = st->sb;
@ -5044,7 +5032,6 @@ static int remove_from_super_imsm(struct supertype *st, mdu_disk_info_t *dk)
dd->next = super->disk_mgmt_list; dd->next = super->disk_mgmt_list;
super->disk_mgmt_list = dd; super->disk_mgmt_list = dd;
return 0; return 0;
} }
@ -5201,7 +5188,6 @@ static int write_super_imsm(struct supertype *st, int doclose)
return 0; return 0;
} }
static int create_array(struct supertype *st, int dev_idx) static int create_array(struct supertype *st, int dev_idx)
{ {
size_t len; size_t len;
@ -5500,7 +5486,6 @@ static int is_raid_level_supported(const struct imsm_orom *orom, int level, int
return 0; return 0;
} }
static int static int
active_arrays_by_format(char *name, char* hba, struct md_list **devlist, active_arrays_by_format(char *name, char* hba, struct md_list **devlist,
int dpa, int verbose) int dpa, int verbose)
@ -5624,7 +5609,6 @@ get_devices(const char *hba_path)
continue; continue;
} }
dv = xcalloc(1, sizeof(*dv)); dv = xcalloc(1, sizeof(*dv));
dv->devname = xstrdup(buf); dv->devname = xstrdup(buf);
dv->next = devlist; dv->next = devlist;
@ -5806,7 +5790,6 @@ count_volumes_list(struct md_list *devlist, char *homehost,
return count; return count;
} }
static int static int
count_volumes(char *hba, int dpa, int verbose) count_volumes(char *hba, int dpa, int verbose)
{ {
@ -6563,7 +6546,6 @@ static struct mdinfo *container_content_imsm(struct supertype *st, char *subarra
sb_errors = 1; sb_errors = 1;
} }
/* count spare devices, not used in maps /* count spare devices, not used in maps
*/ */
for (d = super->disks; d; d = d->next) for (d = super->disks; d; d = d->next)
@ -6709,7 +6691,6 @@ static struct mdinfo *container_content_imsm(struct supertype *st, char *subarra
return rest; return rest;
} }
static __u8 imsm_check_degraded(struct intel_super *super, struct imsm_dev *dev, static __u8 imsm_check_degraded(struct intel_super *super, struct imsm_dev *dev,
int failed, int look_in_map) int failed, int look_in_map)
{ {
@ -7525,7 +7506,6 @@ static struct dl *imsm_add_spare(struct intel_super *super, int slot,
return dl; return dl;
} }
static int imsm_rebuild_allowed(struct supertype *cont, int dev_idx, int failed) static int imsm_rebuild_allowed(struct supertype *cont, int dev_idx, int failed)
{ {
struct imsm_dev *dev2; struct imsm_dev *dev2;
@ -7753,7 +7733,6 @@ static int disks_overlap(struct intel_super *super, int idx, struct imsm_update_
return 0; return 0;
} }
static struct dl *get_disk_super(struct intel_super *super, int major, int minor) static struct dl *get_disk_super(struct intel_super *super, int major, int minor)
{ {
struct dl *dl = NULL; struct dl *dl = NULL;
@ -7831,7 +7810,6 @@ static int add_remove_disk_update(struct intel_super *super)
return check_degraded; return check_degraded;
} }
static int apply_reshape_migration_update(struct imsm_update_reshape_migration *u, static int apply_reshape_migration_update(struct imsm_update_reshape_migration *u,
struct intel_super *super, struct intel_super *super,
void ***space_list) void ***space_list)
@ -7991,7 +7969,6 @@ static int apply_size_change_update(struct imsm_update_size_change *u,
return ret_val; return ret_val;
} }
static int apply_update_activate_spare(struct imsm_update_activate_spare *u, static int apply_update_activate_spare(struct imsm_update_activate_spare *u,
struct intel_super *super, struct intel_super *super,
struct active_array *active_array) struct active_array *active_array)
@ -8955,7 +8932,6 @@ static int imsm_get_allowed_degradation(int level, int raid_disks,
} }
} }
/******************************************************************************* /*******************************************************************************
* Function: open_backup_targets * Function: open_backup_targets
* Description: Function opens file descriptors for all devices given in * Description: Function opens file descriptors for all devices given in
@ -9067,7 +9043,6 @@ void init_migr_record_imsm(struct supertype *st, struct imsm_dev *dev,
migr_rec->post_migr_vol_cap = dev->size_low; migr_rec->post_migr_vol_cap = dev->size_low;
migr_rec->post_migr_vol_cap_hi = dev->size_high; migr_rec->post_migr_vol_cap_hi = dev->size_high;
/* Find the smallest dev */ /* Find the smallest dev */
for (sd = info->devs ; sd ; sd = sd->next) { for (sd = info->devs ; sd ; sd = sd->next) {
sprintf(nm, "%d:%d", sd->disk.major, sd->disk.minor); sprintf(nm, "%d:%d", sd->disk.major, sd->disk.minor);
@ -9611,7 +9586,6 @@ abort:
return 0; return 0;
} }
/****************************************************************************** /******************************************************************************
* function: imsm_create_metadata_update_for_size_change() * function: imsm_create_metadata_update_for_size_change()
* Creates update for IMSM array for array size change. * Creates update for IMSM array for array size change.
@ -10536,7 +10510,6 @@ struct superswitch super_imsm = {
.match_metadata_desc = match_metadata_desc_imsm, .match_metadata_desc = match_metadata_desc_imsm,
.container_content = container_content_imsm, .container_content = container_content_imsm,
.external = 1, .external = 1,
.name = "imsm", .name = "imsm",

View File

@ -36,7 +36,6 @@
* .. other stuff * .. other stuff
*/ */
static unsigned long calc_sb0_csum(mdp_super_t *super) static unsigned long calc_sb0_csum(mdp_super_t *super)
{ {
unsigned long csum = super->sb_csum; unsigned long csum = super->sb_csum;
@ -690,7 +689,6 @@ static int update_super0(struct supertype *st, struct mdinfo *info,
* host name * host name
*/ */
static int init_super0(struct supertype *st, mdu_array_info_t *info, static int init_super0(struct supertype *st, mdu_array_info_t *info,
unsigned long long size, char *ignored_name, char *homehost, unsigned long long size, char *ignored_name, char *homehost,
int *uuid, unsigned long long data_offset) int *uuid, unsigned long long data_offset)
@ -947,7 +945,6 @@ static int compare_super0(struct supertype *st, struct supertype *tst)
return 0; return 0;
} }
static void free_super0(struct supertype *st); static void free_super0(struct supertype *st);
static int load_super0(struct supertype *st, int fd, char *devname) static int load_super0(struct supertype *st, int fd, char *devname)
@ -1118,7 +1115,6 @@ static int add_internal_bitmap0(struct supertype *st, int *chunkp,
bitmap_super_t *bms = (bitmap_super_t*)(((char*)sb) + MD_SB_BYTES); bitmap_super_t *bms = (bitmap_super_t*)(((char*)sb) + MD_SB_BYTES);
int uuid[4]; int uuid[4];
min_chunk = 4096; /* sub-page chunks don't work yet.. */ min_chunk = 4096; /* sub-page chunks don't work yet.. */
bits = (size * 512) / min_chunk + 1; bits = (size * 512) / min_chunk + 1;
while (bits > max_bits) { while (bits > max_bits) {
@ -1150,7 +1146,6 @@ static int add_internal_bitmap0(struct supertype *st, int *chunkp,
return 1; return 1;
} }
static void locate_bitmap0(struct supertype *st, int fd) static void locate_bitmap0(struct supertype *st, int fd)
{ {
unsigned long long dsize; unsigned long long dsize;

View File

@ -411,7 +411,6 @@ static void examine_super1(struct supertype *st, char *homehost)
printf("\n"); printf("\n");
} }
if (calc_sb_1_csum(sb) == sb->sb_csum) if (calc_sb_1_csum(sb) == sb->sb_csum)
printf(" Checksum : %x - correct\n", __le32_to_cpu(sb->sb_csum)); printf(" Checksum : %x - correct\n", __le32_to_cpu(sb->sb_csum));
else else
@ -507,7 +506,6 @@ static void examine_super1(struct supertype *st, char *homehost)
printf("\n"); printf("\n");
} }
static void brief_examine_super1(struct supertype *st, int verbose) static void brief_examine_super1(struct supertype *st, int verbose)
{ {
struct mdp_superblock_1 *sb = st->sb; struct mdp_superblock_1 *sb = st->sb;
@ -998,7 +996,6 @@ static void getinfo_super1(struct supertype *st, struct mdinfo *info, char *map)
info->disk.state |= 1 << MD_DISK_REPLACEMENT; info->disk.state |= 1 << MD_DISK_REPLACEMENT;
} }
if (sb->feature_map & __le32_to_cpu(MD_FEATURE_RECOVERY_OFFSET)) if (sb->feature_map & __le32_to_cpu(MD_FEATURE_RECOVERY_OFFSET))
info->recovery_start = __le32_to_cpu(sb->recovery_offset); info->recovery_start = __le32_to_cpu(sb->recovery_offset);
else else
@ -1470,8 +1467,6 @@ static int store_super1(struct supertype *st, int fd)
return -EINVAL; return -EINVAL;
} }
if (sb_offset != __le64_to_cpu(sb->super_offset) && if (sb_offset != __le64_to_cpu(sb->super_offset) &&
0 != __le64_to_cpu(sb->super_offset) 0 != __le64_to_cpu(sb->super_offset)
) { ) {
@ -1589,7 +1584,6 @@ static int write_init_super1(struct supertype *st)
goto error_out; goto error_out;
} }
/* /*
* Calculate the position of the superblock. * Calculate the position of the superblock.
* It is always aligned to a 4K boundary and * It is always aligned to a 4K boundary and
@ -1923,7 +1917,6 @@ static int load_super1(struct supertype *st, int fd, char *devname)
return 0; return 0;
} }
static struct supertype *match_metadata_desc1(char *arg) static struct supertype *match_metadata_desc1(char *arg)
{ {
struct supertype *st = xcalloc(1, sizeof(*st)); struct supertype *st = xcalloc(1, sizeof(*st));
@ -1993,7 +1986,6 @@ static __u64 _avail_size1(struct supertype *st, __u64 devsize,
else else
devsize -= 8; devsize -= 8;
if (st->minor_version < 0) if (st->minor_version < 0)
/* not specified, so time to set default */ /* not specified, so time to set default */
st->minor_version = 2; st->minor_version = 2;
@ -2069,7 +2061,6 @@ add_internal_bitmap1(struct supertype *st,
bitmap_super_t *bms = (bitmap_super_t*)(((char*)sb) + MAX_SB_SIZE); bitmap_super_t *bms = (bitmap_super_t*)(((char*)sb) + MAX_SB_SIZE);
int uuid[4]; int uuid[4];
if (__le64_to_cpu(sb->data_size) == 0) if (__le64_to_cpu(sb->data_size) == 0)
/* Must be creating the array, else data_size would be non-zero */ /* Must be creating the array, else data_size would be non-zero */
creating = 1; creating = 1;

View File

@ -47,7 +47,6 @@ int main(int argc, char *argv[])
exit(1); exit(1);
} }
for (i=0; i < 4096 ; i+=4) { for (i=0; i < 4096 ; i+=4) {
char t = super[i]; char t = super[i];
super[i] = super[i+3]; super[i] = super[i+3];
@ -69,7 +68,6 @@ int main(int argc, char *argv[])
super[32*4+10*4 +i] = t; super[32*4+10*4 +i] = t;
} }
if (lseek64(fd, offset, 0) < 0LL) { if (lseek64(fd, offset, 0) < 0LL) {
perror("lseek64"); perror("lseek64");
exit(1); exit(1);
@ -81,5 +79,3 @@ int main(int argc, char *argv[])
exit(0); exit(0);
} }

View File

@ -88,7 +88,6 @@ void sysfs_init(struct mdinfo *mdi, int fd, char *devnm)
strcpy(mdi->sys_name, devnm); strcpy(mdi->sys_name, devnm);
} }
struct mdinfo *sysfs_read(int fd, char *devnm, unsigned long options) struct mdinfo *sysfs_read(int fd, char *devnm, unsigned long options)
{ {
char fname[PATH_MAX]; char fname[PATH_MAX];
@ -771,7 +770,6 @@ int sysfs_disk_to_scsi_id(int fd, __u32 *id)
return 0; return 0;
} }
int sysfs_unique_holder(char *devnm, long rdev) int sysfs_unique_holder(char *devnm, long rdev)
{ {
/* Check that devnm is a holder of rdev, /* Check that devnm is a holder of rdev,

View File

@ -23,4 +23,3 @@ mdadm -B $md0 -l linear -n5 $dev0 $dev1 $dev2 $dev3 $dev4
check linear check linear
testdev $md0 5 $size 64 testdev $md0 5 $size 64
mdadm -S $md0 mdadm -S $md0

View File

@ -31,4 +31,3 @@ do
done done
mdadm -S $md0 mdadm -S $md0
done done

View File

@ -55,4 +55,3 @@ do
done done
mdadm -S $md0 mdadm -S $md0
done done

View File

@ -10,4 +10,3 @@ mdadm -S $md0
mdadm -A $md0 --name="Fred" $devlist mdadm -A $md0 --name="Fred" $devlist
#mdadm -Db $md0 #mdadm -Db $md0
mdadm -S $md0 mdadm -S $md0

View File

@ -11,4 +11,3 @@ mdadm -S $md0
mdadm -CR $md0 -l1 -n3 --write-behind --bitmap=internal --bitmap-chunk=4 $dev0 $dev1 --write-mostly $dev2 mdadm -CR $md0 -l1 -n3 --write-behind --bitmap=internal --bitmap-chunk=4 $dev0 $dev1 --write-mostly $dev2
testdev $md0 1 $mdsize1a 64 testdev $md0 1 $mdsize1a 64
mdadm -S $md0 mdadm -S $md0

View File

@ -43,4 +43,3 @@ do
done done
done done
exit 0 exit 0

View File

@ -76,4 +76,3 @@ imsm_check_removal $container $dev0
mdadm --add $container $dev4 mdadm --add $container $dev4
check wait check wait
imsm_check_hold $container $dev4 imsm_check_hold $container $dev4

View File

@ -28,4 +28,3 @@ vol0_new_num_comps=$((num_disks - 1))
vol0_new_chunk=64 vol0_new_chunk=64
. tests/imsm-grow-template 1 1 . tests/imsm-grow-template 1 1

View File

@ -18,7 +18,4 @@ vol0_new_level=0
vol0_new_num_comps=$vol0_num_comps vol0_new_num_comps=$vol0_num_comps
vol0_new_chunk=256 vol0_new_chunk=256
. tests/imsm-grow-template 0 1 . tests/imsm-grow-template 0 1

View File

@ -11,4 +11,3 @@ then
echo "ERROR: size is wrong for $dev: $cnt * $size (chunk=$chunk) = $rasize, not `/sbin/blockdev --getsize $dev`" echo "ERROR: size is wrong for $dev: $cnt * $size (chunk=$chunk) = $rasize, not `/sbin/blockdev --getsize $dev`"
exit 1; exit 1;
fi fi

1
util.c
View File

@ -778,7 +778,6 @@ int get_data_disks(int level, int layout, int raid_disks)
return data_disks; return data_disks;
} }
int devnm2devid(char *devnm) int devnm2devid(char *devnm)
{ {
/* First look in /sys/block/$DEVNM/dev for %d:%d /* First look in /sys/block/$DEVNM/dev for %d:%d