// SPDX-License-Identifier: GPL-2.0 /* * KUnit test of ext4 inode that verify the seconds part of [a/c/m] * timestamps in ext4 inode structs are decoded correctly.
*/
#define LOWER_BOUND_NEG_NO_EXTRA_BITS_CASE\ "1901-12-13 Lower bound of 32bit < 0 timestamp, no extra bits" #define UPPER_BOUND_NEG_NO_EXTRA_BITS_CASE\ "1969-12-31 Upper bound of 32bit < 0 timestamp, no extra bits" #define LOWER_BOUND_NONNEG_NO_EXTRA_BITS_CASE\ "1970-01-01 Lower bound of 32bit >=0 timestamp, no extra bits" #define UPPER_BOUND_NONNEG_NO_EXTRA_BITS_CASE\ "2038-01-19 Upper bound of 32bit >=0 timestamp, no extra bits" #define LOWER_BOUND_NEG_LO_1_CASE\ "2038-01-19 Lower bound of 32bit <0 timestamp, lo extra sec bit on" #define UPPER_BOUND_NEG_LO_1_CASE\ "2106-02-07 Upper bound of 32bit <0 timestamp, lo extra sec bit on" #define LOWER_BOUND_NONNEG_LO_1_CASE\ "2106-02-07 Lower bound of 32bit >=0 timestamp, lo extra sec bit on" #define UPPER_BOUND_NONNEG_LO_1_CASE\ "2174-02-25 Upper bound of 32bit >=0 timestamp, lo extra sec bit on" #define LOWER_BOUND_NEG_HI_1_CASE\ "2174-02-25 Lower bound of 32bit <0 timestamp, hi extra sec bit on" #define UPPER_BOUND_NEG_HI_1_CASE\ "2242-03-16 Upper bound of 32bit <0 timestamp, hi extra sec bit on" #define LOWER_BOUND_NONNEG_HI_1_CASE\ "2242-03-16 Lower bound of 32bit >=0 timestamp, hi extra sec bit on" #define UPPER_BOUND_NONNEG_HI_1_CASE\ "2310-04-04 Upper bound of 32bit >=0 timestamp, hi extra sec bit on" #define UPPER_BOUND_NONNEG_HI_1_NS_1_CASE\ "2310-04-04 Upper bound of 32bit>=0 timestamp, hi extra sec bit 1. 1 ns" #define LOWER_BOUND_NONNEG_HI_1_NS_MAX_CASE\ "2378-04-22 Lower bound of 32bit>= timestamp. Extra sec bits 1. Max ns" #define LOWER_BOUND_NONNEG_EXTRA_BITS_1_CASE\ "2378-04-22 Lower bound of 32bit >=0 timestamp. All extra sec bits on" #define UPPER_BOUND_NONNEG_EXTRA_BITS_1_CASE\ "2446-05-10 Upper bound of 32bit >=0 timestamp. All extra sec bits on"
static time64_t get_32bit_time(conststruct timestamp_expectation * const test)
{ if (test->msb_set) { if (test->lower_bound) return LOWER_MSB_1;
return UPPER_MSB_1;
}
if (test->lower_bound) return LOWER_MSB_0; return UPPER_MSB_0;
}
/* * Test data is derived from the table in the Inode Timestamps section of * Documentation/filesystems/ext4/inodes.rst.
*/ staticvoid inode_test_xtimestamp_decoding(struct kunit *test)
{ struct timespec64 timestamp;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.