diff options
author | Dan Williams <dan.j.williams@intel.com> | 2008-09-16 05:58:42 +0200 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2008-09-16 05:58:42 +0200 |
commit | 8ed3e5e1bf5b08884b68c3ef5c3e393adaa3c9ba (patch) | |
tree | 8ec55bc8276d23d412b4f7ff4925f55f2d9ddda2 /sysfs.c | |
parent | imsm: use ->getinfo_super() in ->container_content() (diff) | |
download | mdadm-8ed3e5e1bf5b08884b68c3ef5c3e393adaa3c9ba.tar.xz mdadm-8ed3e5e1bf5b08884b68c3ef5c3e393adaa3c9ba.zip |
Honor safemode_delay at Create() and Incremental() time
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'sysfs.c')
-rw-r--r-- | sysfs.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -346,6 +346,19 @@ int sysfs_get_ll(struct mdinfo *sra, struct mdinfo *dev, return 0; } +int sysfs_set_safemode(struct mdinfo *sra, unsigned long ms) +{ + unsigned long sec; + unsigned long msec; + char delay[30]; + + sec = ms / 1000; + msec = ms - (sec * 1000); + + sprintf(delay, "%ld.%ld", sec, msec); + return sysfs_set_str(sra, NULL, "safe_mode_delay", delay); +} + int sysfs_set_array(struct mdinfo *sra, struct mdinfo *info) { |