From a114f6b8c52bb97dcad093e5cb32b903ae9f602f Mon Sep 17 00:00:00 2001 From: James Simmons Date: Tue, 17 Mar 2020 07:31:08 -0400 Subject: [PATCH] LU-13344 servers: change request timeouts to s32 In the latest kernels time_t has been removed since time_t has been a 64 bit value just like time64_t so no need for it anymore. The field sf_run_time is stored on local media and its expected to be 32 bit in size so change it to s32 explictly. The fields the MDT coordinator that are currently time_t are a simple change to s32 since they represent a time period and not a time stamp. Lastly just update a comment in llog_swab.c since time_t will no longer exist but we want to point out time in the llog is 32 bits in size. Change-Id: I0849fc9798c191d1fed77f7bba1357a209924418 Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/37950 Tested-by: jenkins Reviewed-by: Shaun Tancheff Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/include/lustre_scrub.h | 2 +- lustre/mdt/mdt_coordinator.c | 6 +++--- lustre/mdt/mdt_internal.h | 6 +++--- lustre/obdclass/llog_swab.c | 2 +- lustre/obdclass/scrub.c | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lustre/include/lustre_scrub.h b/lustre/include/lustre_scrub.h index 38d4fb5..313af0f 100644 --- a/lustre/include/lustre_scrub.h +++ b/lustre/include/lustre_scrub.h @@ -240,7 +240,7 @@ struct scrub_file { * to time64_t since this breaks backwards compatibility. * It shouldn't take more than 136 years to complete :-) */ - time_t sf_run_time; + s32 sf_run_time; /* How many completed OI scrub ran on the device. */ __u32 sf_success_count; diff --git a/lustre/mdt/mdt_coordinator.c b/lustre/mdt/mdt_coordinator.c index 1740b4a..d666f2d 100644 --- a/lustre/mdt/mdt_coordinator.c +++ b/lustre/mdt/mdt_coordinator.c @@ -2068,7 +2068,7 @@ ssize_t loop_period_show(struct kobject *kobj, struct attribute *attr, struct coordinator *cdt = container_of(kobj, struct coordinator, cdt_hsm_kobj); - return scnprintf(buf, PAGE_SIZE, "%lu\n", cdt->cdt_loop_period); + return scnprintf(buf, PAGE_SIZE, "%u\n", cdt->cdt_loop_period); } ssize_t loop_period_store(struct kobject *kobj, struct attribute *attr, @@ -2096,7 +2096,7 @@ ssize_t grace_delay_show(struct kobject *kobj, struct attribute *attr, struct coordinator *cdt = container_of(kobj, struct coordinator, cdt_hsm_kobj); - return scnprintf(buf, PAGE_SIZE, "%lu\n", cdt->cdt_grace_delay); + return scnprintf(buf, PAGE_SIZE, "%u\n", cdt->cdt_grace_delay); } ssize_t grace_delay_store(struct kobject *kobj, struct attribute *attr, @@ -2125,7 +2125,7 @@ ssize_t active_request_timeout_show(struct kobject *kobj, struct coordinator *cdt = container_of(kobj, struct coordinator, cdt_hsm_kobj); - return scnprintf(buf, PAGE_SIZE, "%lu\n", cdt->cdt_active_req_timeout); + return scnprintf(buf, PAGE_SIZE, "%d\n", cdt->cdt_active_req_timeout); } ssize_t active_request_timeout_store(struct kobject *kobj, diff --git a/lustre/mdt/mdt_internal.h b/lustre/mdt/mdt_internal.h index 47f89bc..6e46e8f 100644 --- a/lustre/mdt/mdt_internal.h +++ b/lustre/mdt/mdt_internal.h @@ -149,10 +149,10 @@ struct coordinator { * list */ struct mutex cdt_restore_lock; /**< protect restore * list */ - time_t cdt_loop_period; /**< llog scan period */ - time_t cdt_grace_delay; /**< request grace + s32 cdt_loop_period; /**< llog scan period */ + s32 cdt_grace_delay; /**< request grace * delay */ - time_t cdt_active_req_timeout; /**< request timeout */ + s32 cdt_active_req_timeout; /**< request timeout */ __u32 cdt_default_archive_id; /**< archive id used * when none are * specified */ diff --git a/lustre/obdclass/llog_swab.c b/lustre/obdclass/llog_swab.c index 3b35f42..e030417 100644 --- a/lustre/obdclass/llog_swab.c +++ b/lustre/obdclass/llog_swab.c @@ -446,7 +446,7 @@ void lustre_swab_cfg_marker(struct cfg_marker *marker, int swab, int size) __u32 createtime, canceltime; /* * There was a problem with the original declaration of - * cfg_marker on 32-bit systems because it used time_t as + * cfg_marker on 32-bit systems because it used 32 time as * a wire protocol structure, and didn't verify this in * wirecheck. We now have to convert the offsets of the * later fields in order to work on 32- and 64-bit systems. diff --git a/lustre/obdclass/scrub.c b/lustre/obdclass/scrub.c index c4feee6..24cb640 100644 --- a/lustre/obdclass/scrub.c +++ b/lustre/obdclass/scrub.c @@ -487,7 +487,7 @@ void scrub_dump(struct seq_file *m, struct lustre_scrub *scrub) } else { if (sf->sf_run_time != 0) speed = div_s64(speed, sf->sf_run_time); - seq_printf(m, "run_time: %ld seconds\n" + seq_printf(m, "run_time: %d seconds\n" "average_speed: %lld objects/sec\n" "real_time_speed: N/A\n" "current_position: N/A\n", -- 1.8.3.1