summaryrefslogtreecommitdiffstats
path: root/mdadm.h
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2009-12-21 17:54:32 -0700
committerDan Williams <dan.j.williams@intel.com>2009-12-21 17:54:32 -0700
commit1e5c69836d4d0b6dcaef8fc187e6bf2841eb57f6 (patch)
tree8fbd3075e85acccba73a9845ef3cdae9bf6d8e89 /mdadm.h
parent2904b26f059c5d82d9d631c9987e92e3f9af498c (diff)
downloadmdadm-1e5c69836d4d0b6dcaef8fc187e6bf2841eb57f6.tar.gz
mdadm-1e5c69836d4d0b6dcaef8fc187e6bf2841eb57f6.tar.xz
mdadm-1e5c69836d4d0b6dcaef8fc187e6bf2841eb57f6.zip
imsm: add support for checkpointing via 'curr_migr_unit'
Unlike native md checkpointing some data about the geometry and type of the migration process is coded into curr_migr_unit. Provide logic to convert between md/{resync_start|recovery_start} and imsm/curr_migr_unit. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'mdadm.h')
-rw-r--r--mdadm.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/mdadm.h b/mdadm.h
index 27ef693..c1c36af 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -129,6 +129,22 @@ extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence));
#endif /* __KLIBC__ */
+/*
+ * min()/max()/clamp() macros that also do
+ * strict type-checking.. See the
+ * "unnecessary" pointer comparison.
+ */
+#define min(x, y) ({ \
+ typeof(x) _min1 = (x); \
+ typeof(y) _min2 = (y); \
+ (void) (&_min1 == &_min2); \
+ _min1 < _min2 ? _min1 : _min2; })
+
+#define max(x, y) ({ \
+ typeof(x) _max1 = (x); \
+ typeof(y) _max2 = (y); \
+ (void) (&_max1 == &_max2); \
+ _max1 > _max2 ? _max1 : _max2; })
/* general information that might be extracted from a superblock */
struct mdinfo {
@@ -842,6 +858,7 @@ extern int assemble_container_content(struct supertype *st, int mdfd,
extern int add_disk(int mdfd, struct supertype *st,
struct mdinfo *sra, struct mdinfo *info);
extern int set_array_info(int mdfd, struct supertype *st, struct mdinfo *info);
+unsigned long long min_recovery_start(struct mdinfo *array);
extern char *human_size(long long bytes);
extern char *human_size_brief(long long bytes);