| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0 |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2007 Jeff Dike (jdike@{linux.intel,addtoit}.com) |
|---|
| 3 | | - * Licensed under the GPL |
|---|
| 4 | 4 | */ |
|---|
| 5 | 5 | |
|---|
| 6 | 6 | /* |
|---|
| .. | .. |
|---|
| 17 | 17 | |
|---|
| 18 | 18 | #define PATH_LEN_V1 256 |
|---|
| 19 | 19 | |
|---|
| 20 | +/* unsigned time_t works until year 2106 */ |
|---|
| 20 | 21 | typedef __u32 time32_t; |
|---|
| 21 | 22 | |
|---|
| 22 | 23 | struct cow_header_v1 { |
|---|
| .. | .. |
|---|
| 197 | 198 | int sectorsize, int alignment, unsigned long long *size) |
|---|
| 198 | 199 | { |
|---|
| 199 | 200 | struct cow_header_v3 *header; |
|---|
| 200 | | - unsigned long modtime; |
|---|
| 201 | + long long modtime; |
|---|
| 201 | 202 | int err; |
|---|
| 202 | 203 | |
|---|
| 203 | 204 | err = cow_seek_file(fd, 0); |
|---|
| .. | .. |
|---|
| 276 | 277 | |
|---|
| 277 | 278 | int read_cow_header(int (*reader)(__u64, char *, int, void *), void *arg, |
|---|
| 278 | 279 | __u32 *version_out, char **backing_file_out, |
|---|
| 279 | | - time_t *mtime_out, unsigned long long *size_out, |
|---|
| 280 | + long long *mtime_out, unsigned long long *size_out, |
|---|
| 280 | 281 | int *sectorsize_out, __u32 *align_out, |
|---|
| 281 | 282 | int *bitmap_offset_out) |
|---|
| 282 | 283 | { |
|---|
| .. | .. |
|---|
| 363 | 364 | |
|---|
| 364 | 365 | /* |
|---|
| 365 | 366 | * this was used until Dec2005 - 64bits are needed to represent |
|---|
| 366 | | - * 2038+. I.e. we can safely do this truncating cast. |
|---|
| 367 | + * 2106+. I.e. we can safely do this truncating cast. |
|---|
| 367 | 368 | * |
|---|
| 368 | 369 | * Additionally, we must use be32toh() instead of be64toh(), since |
|---|
| 369 | 370 | * the program used to use the former (tested - I got mtime |
|---|