From a67dd8cc58845b3375cba9bc45e20ed0d03d2034 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 15 Sep 2008 20:58:42 -0700 Subject: [PATCH] Allow metadata handlers to communicate desired safemode delay via mdinfo Signed-off-by: Dan Williams --- mdadm.h | 1 + super-ddf.c | 2 ++ super-intel.c | 2 ++ super0.c | 1 + super1.c | 1 + 5 files changed, 7 insertions(+) diff --git a/mdadm.h b/mdadm.h index 4fbde1cb..3d31576a 100644 --- a/mdadm.h +++ b/mdadm.h @@ -149,6 +149,7 @@ struct mdinfo { int reshape_active; unsigned long long reshape_progress; unsigned long long resync_start; + unsigned long safe_mode_delay; /* ms delay to mark clean */ int new_level, delta_disks, new_layout, new_chunk; int errors; int cache_size; /* size of raid456 stripe cache*/ diff --git a/super-ddf.c b/super-ddf.c index 3477adf6..d7efa9f8 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -1247,6 +1247,7 @@ static void getinfo_super_ddf(struct supertype *st, struct mdinfo *info) info->reshape_active = 0; strcpy(info->text_version, "ddf"); + info->safe_mode_delay = 0; // uuid_from_super_ddf(info->uuid, sbv); @@ -1303,6 +1304,7 @@ static void getinfo_super_ddf_bvd(struct supertype *st, struct mdinfo *info) sprintf(info->text_version, "/%s/%s", devnum2devname(st->container_dev), st->subarray); + info->safe_mode_delay = 200; // info->name[] ?? ; } diff --git a/super-intel.c b/super-intel.c index d49f9c64..709923a7 100644 --- a/super-intel.c +++ b/super-intel.c @@ -655,6 +655,7 @@ static void getinfo_super_imsm_volume(struct supertype *st, struct mdinfo *info) sprintf(info->text_version, "/%s/%d", devnum2devname(st->container_dev), info->container_member); + info->safe_mode_delay = 4000; /* 4 secs like the Matrix driver */ } @@ -685,6 +686,7 @@ static void getinfo_super_imsm(struct supertype *st, struct mdinfo *info) info->disk.raid_disk = -1; info->reshape_active = 0; strcpy(info->text_version, "imsm"); + info->safe_mode_delay = 0; info->disk.number = -1; info->disk.state = 0; diff --git a/super0.c b/super0.c index ab636605..ed44affe 100644 --- a/super0.c +++ b/super0.c @@ -370,6 +370,7 @@ static void getinfo_super0(struct supertype *st, struct mdinfo *info) info->data_offset = 0; sprintf(info->text_version, "0.%d", sb->minor_version); + info->safe_mode_delay = 200; uuid_from_super0(st, info->uuid); diff --git a/super1.c b/super1.c index 06d0a187..176579d4 100644 --- a/super1.c +++ b/super1.c @@ -532,6 +532,7 @@ static void getinfo_super1(struct supertype *st, struct mdinfo *info) } info->events = __le64_to_cpu(sb->events); sprintf(info->text_version, "1.%d", st->minor_version); + info->safe_mode_delay = 200; memcpy(info->uuid, sb->set_uuid, 16); -- 2.39.2