Skip to contentSkip to conversation

fnic: use 64-bit timestamps

PATCH Superseded Arnd Bergmann 2 participants 2 messages Nov 7, 2017 – Nov 21, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fnic: use 64-bit timestamps

struct timespec is deprecated since it overflows in 2038 on 32-bit architectures, so we should use timespec64 consistently.

I'm slightly adapting the format strings here, to make sure we print the nanoseconds with the correct number of leading zeroes.

---
 drivers/scsi/fnic/fnic_debugfs.c |  2 +-
 drivers/scsi/fnic/fnic_stats.h   |  4 +--
 drivers/scsi/fnic/fnic_trace.c   | 58 ++++++++++++++++++++--------------------
 3 files changed, 32 insertions(+), 32 deletions(-)
drivers/scsi/fnic/fnic_debugfs.c +1 -1
index 5e3d909cfc53..db44e1bf1ecd 100644
@@ -632,7 +632,7 @@ static ssize_t fnic_reset_stats_write(struct file *file,
 			sizeof(struct io_path_stats) - sizeof(u64));
 		memset(fw_stats_p+1, 0,
 			sizeof(struct fw_stats) - sizeof(u64));
-		getnstimeofday(&stats->stats_timestamps.last_reset_time);
+		ktime_get_real_ts64(&stats->stats_timestamps.last_reset_time);
 	}
 
 	(*ppos)++;
drivers/scsi/fnic/fnic_stats.h +2 -2
index e007feedbf72..9daa6ada6fa0 100644
@@ -18,8 +18,8 @@
 #define _FNIC_STATS_H_
 
 struct stats_timestamps {
-	struct timespec last_reset_time;
-	struct timespec last_read_time;
+	struct timespec64 last_reset_time;
+	struct timespec64 last_read_time;
 };
 
 struct io_path_stats {
drivers/scsi/fnic/fnic_trace.c +29 -29

122 lines not on this page · raw message

Signature · 1 line
2.9.0
#1 lore raw
Quoted 6 lines

struct timespec is deprecated since it overflows in 2038 on 32-bit architectures, so we should use timespec64 consistently.

I'm slightly adapting the format strings here, to make sure we print the nanoseconds with the correct number of leading zeroes.

Satish: Please review/test. Thank you!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering