]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Assorted fixed for a "make everything" build
authorNeilBrown <neilb@suse.com>
Thu, 28 Jan 2016 02:28:58 +0000 (13:28 +1100)
committerNeilBrown <neilb@suse.com>
Thu, 28 Jan 2016 02:28:58 +0000 (13:28 +1100)
Signed-off-by: NeilBrown <neilb@suse.com>
Makefile
platform-intel.c
super1.c
util.c

index ce2abfa052be4279e5debe170dc1bde74290cdc3..fd79cfbc04baa3760ed16e80d07f17097017b576 100644 (file)
--- 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
index 2370602596d7d4d4e1cd0e4891b3426d1348ac45..88818f340b1311b038a433f4dbbe4a29b0f96a21 100644 (file)
@@ -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;
index 0f6797a8f1cdb3d5e351be20bd7ff3f4f095d558..8bcaa2fe02c81575c696f8bdacf2a54a3fd6ccf0 100644 (file)
--- a/super1.c
+++ b/super1.c
@@ -1,7 +1,7 @@
 /*
  * mdadm - manage Linux "md" devices aka RAID arrays.
  *
- * Copyright (C) 2001-2009 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2001-2016 Neil Brown <neilb@suse.com>
  *
  *
  *    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 cf9572bedb628dcf112696fa9f1a1f5b96bb9882..970d48476e86044843fe8769b4993af2423cc6d8 100644 (file)
--- 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));