From 7071320a18428e9a11ea9f6dd806c6ff6fe9c547 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Thu, 28 Jan 2016 13:28:58 +1100 Subject: [PATCH] Assorted fixed for a "make everything" build Signed-off-by: NeilBrown --- Makefile | 8 ++++---- platform-intel.c | 3 +-- super1.c | 6 ++++-- util.c | 26 +++++++++++++++++++------- 4 files changed, 28 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index ce2abfa..fd79cfb 100644 --- a/Makefile +++ b/Makefile @@ -187,7 +187,7 @@ mdadm : $(OBJS) | check_rundir $(CC) $(CFLAGS) $(LDFLAGS) -o mdadm $(OBJS) $(LDLIBS) mdadm.static : $(OBJS) $(STATICOBJS) - $(CC) $(CFLAGS) $(LDFLAGS) -static -o mdadm.static $(OBJS) $(STATICOBJS) + $(CC) $(CFLAGS) $(LDFLAGS) -static -o mdadm.static $(OBJS) $(STATICOBJS) $(LDLIBS) mdadm.tcc : $(SRCS) $(INCL) $(TCC) -o mdadm.tcc $(SRCS) @@ -197,13 +197,13 @@ mdadm.klibc : $(SRCS) $(INCL) $(CC) -nostdinc -iwithprefix include -I$(KLIBC)/klibc/include -I$(KLIBC)/linux/include -I$(KLIBC)/klibc/arch/i386/include -I$(KLIBC)/klibc/include/bits32 $(CFLAGS) $(SRCS) mdadm.Os : $(SRCS) $(INCL) - $(CC) -o mdadm.Os $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -DHAVE_STDINT_H -Os $(SRCS) + $(CC) -o mdadm.Os $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -DHAVE_STDINT_H -Os $(SRCS) $(LDLIBS) mdadm.O2 : $(SRCS) $(INCL) mdmon.O2 - $(CC) -o mdadm.O2 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -DHAVE_STDINT_H -O2 -D_FORTIFY_SOURCE=2 $(SRCS) + $(CC) -o mdadm.O2 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -DHAVE_STDINT_H -O2 -D_FORTIFY_SOURCE=2 $(SRCS) $(LDLIBS) mdmon.O2 : $(MON_SRCS) $(INCL) mdmon.h - $(CC) -o mdmon.O2 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(MON_LDFLAGS) -DHAVE_STDINT_H -O2 -D_FORTIFY_SOURCE=2 $(MON_SRCS) + $(CC) -o mdmon.O2 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(MON_LDFLAGS) -DHAVE_STDINT_H -O2 -D_FORTIFY_SOURCE=2 $(MON_SRCS) $(LDLIBS) # use '-z now' to guarantee no dynamic linker interactions with the monitor thread mdmon : $(MON_OBJS) | check_rundir diff --git a/platform-intel.c b/platform-intel.c index 2370602..88818f3 100644 --- a/platform-intel.c +++ b/platform-intel.c @@ -734,8 +734,7 @@ char *vmd_domain_to_controller(struct sys_dev *hba, char *buf) if (strncmp(buf, hba->path, strlen(buf)) == 0) { sprintf(path, "/sys/bus/pci/drivers/vmd/%s", ent->d_name); - realpath(path, buf); - return buf; + return realpath(path, buf); } } return NULL; diff --git a/super1.c b/super1.c index 0f6797a..8bcaa2f 100644 --- a/super1.c +++ b/super1.c @@ -1,7 +1,7 @@ /* * mdadm - manage Linux "md" devices aka RAID arrays. * - * Copyright (C) 2001-2009 Neil Brown + * Copyright (C) 2001-2016 Neil Brown * * * This program is free software; you can redistribute it and/or modify @@ -141,6 +141,7 @@ struct misc_dev_info { |MD_FEATURE_JOURNAL \ ) +#ifndef MDASSEMBLE static int role_from_sb(struct mdp_superblock_1 *sb) { unsigned int d; @@ -153,6 +154,7 @@ static int role_from_sb(struct mdp_superblock_1 *sb) role = MD_DISK_ROLE_SPARE; return role; } +#endif /* return how many bytes are needed for bitmap, for cluster-md each node * should have it's own bitmap */ @@ -1654,6 +1656,7 @@ static void free_super1(struct supertype *st); #define META_BLOCK_SIZE 4096 __u32 crc32c_le(__u32 crc, unsigned char const *p, size_t len); +#ifndef MDASSEMBLE static int write_empty_r5l_meta_block(struct supertype *st, int fd) { struct r5l_meta_block *mb; @@ -1699,7 +1702,6 @@ fail_to_write: return 1; } -#ifndef MDASSEMBLE static int write_init_super1(struct supertype *st) { struct mdp_superblock_1 *sb = st->sb; diff --git a/util.c b/util.c index cf9572b..970d484 100644 --- a/util.c +++ b/util.c @@ -82,8 +82,15 @@ struct blkpg_partition { aren't permitted). */ #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); })) -static struct dlm_hooks *dlm_hooks = NULL; static int is_dlm_hooks_ready = 0; + +int dlm_funs_ready(void) +{ + return is_dlm_hooks_ready ? 1 : 0; +} + +#ifndef MDASSEMBLE +static struct dlm_hooks *dlm_hooks = NULL; struct dlm_lock_resource *dlm_lock_res = NULL; static int ast_called = 0; @@ -92,11 +99,6 @@ struct dlm_lock_resource { struct dlm_lksb lksb; }; -int dlm_funs_ready(void) -{ - return is_dlm_hooks_ready ? 1 : 0; -} - /* Using poll(2) to wait for and dispatch ASTs */ static int poll_for_ast(dlm_lshandle_t ls) { @@ -206,6 +208,16 @@ int cluster_release_dlmlock(int lockid) out: return ret; } +#else +int cluster_get_dlmlock(int *lockid) +{ + return -1; +} +int cluster_release_dlmlock(int lockid) +{ + return -1; +} +#endif /* * Parse a 128 bit uuid in 4 integers @@ -2115,10 +2127,10 @@ void reopen_mddev(int mdfd) dup2(fd, mdfd); } +#ifndef MDASSEMBLE static struct cmap_hooks *cmap_hooks = NULL; static int is_cmap_hooks_ready = 0; -#ifndef MDASSEMBLE void set_cmap_hooks(void) { cmap_hooks = xmalloc(sizeof(struct cmap_hooks));