summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/pstore/inode.c3
-rw-r--r--fs/pstore/platform.c2
-rw-r--r--fs/pstore/ram.c21
3 files changed, 17 insertions, 9 deletions
diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c
index 5fcb845b9fec..75afe5eb0574 100644
--- a/fs/pstore/inode.c
+++ b/fs/pstore/inode.c
@@ -392,7 +392,8 @@ int pstore_mkfile(struct dentry *root, struct pstore_record *record)
392 inode->i_private = private; 392 inode->i_private = private;
393 393
394 if (record->time.tv_sec) 394 if (record->time.tv_sec)
395 inode->i_mtime = inode->i_ctime = record->time; 395 inode->i_mtime = inode->i_ctime =
396 timespec64_to_timespec(record->time);
396 397
397 d_add(dentry, inode); 398 d_add(dentry, inode);
398 399
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index dc720573fd53..c238ab8ba31d 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -328,7 +328,7 @@ void pstore_record_init(struct pstore_record *record,
328 record->psi = psinfo; 328 record->psi = psinfo;
329 329
330 /* Report zeroed timestamp if called before timekeeping has resumed. */ 330 /* Report zeroed timestamp if called before timekeeping has resumed. */
331 record->time = ns_to_timespec(ktime_get_real_fast_ns()); 331 record->time = ns_to_timespec64(ktime_get_real_fast_ns());
332} 332}
333 333
334/* 334/*
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index 49b2bc114868..69e893076ab7 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -38,6 +38,11 @@
38 38
39#define RAMOOPS_KERNMSG_HDR "====" 39#define RAMOOPS_KERNMSG_HDR "===="
40#define MIN_MEM_SIZE 4096UL 40#define MIN_MEM_SIZE 4096UL
41#if __BITS_PER_LONG == 64
42# define TVSEC_FMT "%ld"
43#else
44# define TVSEC_FMT "%lld"
45#endif
41 46
42static ulong record_size = MIN_MEM_SIZE; 47static ulong record_size = MIN_MEM_SIZE;
43module_param(record_size, ulong, 0400); 48module_param(record_size, ulong, 0400);
@@ -153,21 +158,23 @@ ramoops_get_next_prz(struct persistent_ram_zone *przs[], uint *c, uint max,
153 return prz; 158 return prz;
154} 159}
155 160
156static int ramoops_read_kmsg_hdr(char *buffer, struct timespec *time, 161static int ramoops_read_kmsg_hdr(char *buffer, struct timespec64 *time,
157 bool *compressed) 162 bool *compressed)
158{ 163{
159 char data_type; 164 char data_type;
160 int header_length = 0; 165 int header_length = 0;
161 166
162 if (sscanf(buffer, RAMOOPS_KERNMSG_HDR "%lu.%lu-%c\n%n", &time->tv_sec, 167 if (sscanf(buffer, RAMOOPS_KERNMSG_HDR TVSEC_FMT ".%lu-%c\n%n",
163 &time->tv_nsec, &data_type, &header_length) == 3) { 168 &time->tv_sec, &time->tv_nsec, &data_type,
169 &header_length) == 3) {
164 if (data_type == 'C') 170 if (data_type == 'C')
165 *compressed = true; 171 *compressed = true;
166 else 172 else
167 *compressed = false; 173 *compressed = false;
168 } else if (sscanf(buffer, RAMOOPS_KERNMSG_HDR "%lu.%lu\n%n", 174 } else if (sscanf(buffer, RAMOOPS_KERNMSG_HDR TVSEC_FMT ".%lu\n%n",
169 &time->tv_sec, &time->tv_nsec, &header_length) == 2) { 175 &time->tv_sec, &time->tv_nsec,
170 *compressed = false; 176 &header_length) == 2) {
177 *compressed = false;
171 } else { 178 } else {
172 time->tv_sec = 0; 179 time->tv_sec = 0;
173 time->tv_nsec = 0; 180 time->tv_nsec = 0;
@@ -360,7 +367,7 @@ static size_t ramoops_write_kmsg_hdr(struct persistent_ram_zone *prz,
360 char *hdr; 367 char *hdr;
361 size_t len; 368 size_t len;
362 369
363 hdr = kasprintf(GFP_ATOMIC, RAMOOPS_KERNMSG_HDR "%lu.%lu-%c\n", 370 hdr = kasprintf(GFP_ATOMIC, RAMOOPS_KERNMSG_HDR TVSEC_FMT ".%lu-%c\n",
364 record->time.tv_sec, 371 record->time.tv_sec,
365 record->time.tv_nsec / 1000, 372 record->time.tv_nsec / 1000,
366 record->compressed ? 'C' : 'D'); 373 record->compressed ? 'C' : 'D');