summaryrefslogtreecommitdiffstats
path: root/mdadm.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-12-12 17:22:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-12-12 17:22:10 +0000
commit55526d6577f82349bf6bb59816680d7483b61dff (patch)
tree456f8e2360e6bbd83e4f9a571f97cda281e4d9d9 /mdadm.h
parentReleasing debian version 4.3+20241108-1. (diff)
downloadmdadm-55526d6577f82349bf6bb59816680d7483b61dff.tar.xz
mdadm-55526d6577f82349bf6bb59816680d7483b61dff.zip
Merging upstream version 4.3+20241202.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mdadm.h')
-rw-r--r--mdadm.h32
1 files changed, 23 insertions, 9 deletions
diff --git a/mdadm.h b/mdadm.h
index 5aa5085..ebb2ca1 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -598,9 +598,16 @@ enum prefix_standard {
};
enum bitmap_update {
- NoUpdate,
- NameUpdate,
- NodeNumUpdate,
+ NoUpdate,
+ NameUpdate,
+ NodeNumUpdate,
+};
+
+enum bitmap_type {
+ BitmapNone,
+ BitmapInternal,
+ BitmapCluster,
+ BitmapUnknown,
};
enum flag_mode {
@@ -640,8 +647,7 @@ struct mddev_ident {
int spare_disks;
struct supertype *st;
char *spare_group;
- char *bitmap_file;
- int bitmap_fd;
+ enum bitmap_type btype;
char *container; /* /dev/whatever name of container, or
* uuid of container. You would expect
@@ -693,7 +699,7 @@ struct shape {
char *layout_str;
int chunk;
int bitmap_chunk;
- char *bitmap_file;
+ enum bitmap_type btype;
int assume_clean;
bool write_zeroes;
int write_behind;
@@ -1899,15 +1905,23 @@ static inline sighandler_t signal_s(int sig, sighandler_t handler)
}
#ifdef DEBUG
+#include <time.h>
+
#define dprintf(fmt, arg...) \
- fprintf(stderr, "%s: %s: "fmt, Name, __func__, ##arg)
+ do { \
+ struct timespec ts; \
+ clock_gettime(CLOCK_MONOTONIC, &ts); \
+ double timestamp = ts.tv_sec + ts.tv_nsec / 1e9; \
+ fprintf(stderr, "[%10.5f] %s: %s: " fmt, timestamp, Name, __func__, ##arg); \
+ } while (0)
+
#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; })
+ do { } while (0)
#define dprintf_cont(fmt, arg...) \
- ({ if (0) fprintf(stderr, fmt, ##arg); 0; })
+ do { } while (0)
#endif
static inline int xasprintf(char **strp, const char *fmt, ...) {