]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Allow metadata handlers to communicate desired safemode delay via mdinfo
authorDan Williams <dan.j.williams@intel.com>
Tue, 16 Sep 2008 03:58:42 +0000 (20:58 -0700)
committerDan Williams <dan.j.williams@intel.com>
Tue, 16 Sep 2008 03:58:42 +0000 (20:58 -0700)
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
mdadm.h
super-ddf.c
super-intel.c
super0.c
super1.c

diff --git a/mdadm.h b/mdadm.h
index 4fbde1cbbb32f2ad522931701f26f92a7f0bfe42..3d31576a8eb5147523283be2b0e400f5526f3d6c 100644 (file)
--- 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*/
index 3477adf6a8e3a4b40bffeda296f815daba48c7ae..d7efa9f820c445ec100b88a4610d6aa3467bb351 100644 (file)
@@ -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[] ?? ;
 }
index d49f9c64d589635eb7f10e358ab51a73a86b87a0..709923a74755a0bc39d79e039eac5f951eef9b69 100644 (file)
@@ -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;
 
index ab636605bc6ab66fbd1b8931df6a6e0eb2b97c14..ed44affe4391931b1dbda0a4caef9b323cf821ad 100644 (file)
--- 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);
 
index 06d0a1876cf1f678f27661c14dfc8649576d8c89..176579d4db5de8febf5f7fb2e9462d620cac4a51 100644 (file)
--- 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);