From 948fb73b04fa9b0f9a9e81e08040b79b65826a16 Mon Sep 17 00:00:00 2001 From: Dimitri John Ledkov Date: Sun, 8 Nov 2015 11:48:28 +0000 Subject: New upstream release. --- mdadm.h | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'mdadm.h') diff --git a/mdadm.h b/mdadm.h index fc1fd318..b5976582 100644 --- a/mdadm.h +++ b/mdadm.h @@ -180,6 +180,8 @@ extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence)); #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) +extern const char Name[]; + /* general information that might be extracted from a superblock */ struct mdinfo { mdu_array_info_t array; @@ -262,8 +264,6 @@ struct createinfo { struct supertype *supertype; }; -#define Name "mdadm" - enum mode { ASSEMBLE=1, BUILD, @@ -453,7 +453,6 @@ typedef struct mapping { } mapping_t; struct mdstat_ent { - char *dev; char devnm[32]; int active; char *level; @@ -491,18 +490,8 @@ extern int map_update(struct map_ent **mpp, char *devnm, char *metadata, int uuid[4], char *path); extern void map_remove(struct map_ent **map, char *devnm); extern struct map_ent *map_by_uuid(struct map_ent **map, int uuid[4]); -#ifdef MDASSEMBLE -static inline struct map_ent *map_by_devnm(struct map_ent **map, char *name) -{ - return NULL; -} -static inline void map_free(struct map_ent *map) -{ -} -#else extern struct map_ent *map_by_devnm(struct map_ent **map, char *devnm); extern void map_free(struct map_ent *map); -#endif extern struct map_ent *map_by_name(struct map_ent **map, char *name); extern void map_read(struct map_ent **melp); extern int map_write(struct map_ent *mel); @@ -1440,9 +1429,13 @@ static inline char *to_subarray(struct mdstat_ent *ent, char *container) #ifdef DEBUG #define dprintf(fmt, arg...) \ + fprintf(stderr, "%s: %s: "fmt, Name, __func__, ##arg) +#define dprintf_cont(fmt, arg...) \ fprintf(stderr, fmt, ##arg) #else #define dprintf(fmt, arg...) \ + ({ if (0) fprintf(stderr, "%s: %s: " fmt, Name, __func__, ##arg); 0; }) +#define dprintf_cont(fmt, arg...) \ ({ if (0) fprintf(stderr, fmt, ##arg); 0; }) #endif #include @@ -1457,7 +1450,11 @@ static inline int xasprintf(char **strp, const char *fmt, ...) { return ret; } -#define pr_err(fmt ...) fprintf(stderr, Name ": " fmt) +#ifdef DEBUG +#define pr_err(fmt, args...) fprintf(stderr, "%s: %s: "fmt, Name, __func__, ##args) +#else +#define pr_err(fmt, args...) fprintf(stderr, "%s: "fmt, Name, ##args) +#endif #define cont_err(fmt ...) fprintf(stderr, " " fmt) void *xmalloc(size_t len); -- cgit v1.2.3