Re: [PATCH 08/11] xfs: widen ondisk inode timestamps to deal with y2038+

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Aug 30, 2020 at 11:07:39PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
> 
> Redesign the ondisk inode timestamps to be a simple unsigned 64-bit
> counter of nanoseconds since 14 Dec 1901 (i.e. the minimum time in the
> 32-bit unix time epoch).  This enables us to handle dates up to 2486,
> which solves the y2038 problem.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>

Look good to me overall (although I'm little curious if
folding in xfs_inode_{encode,decode}_bigtime() would be
better (since it may have rare users in the future?)...
and may be

> +static inline uint64_t xfs_inode_encode_bigtime(struct timespec64 tv)
> +{
> +	return (xfs_unix_to_bigtime(tv.tv_sec) * NSEC_PER_SEC) + tv.tv_nsec;

parentheses isn't needed here since it's basic arithmetic
but all things above are quite minor...

Reviewed-by: Gao Xiang <hsiangkao@xxxxxxxxxx>

Thanks,
Gao Xiang




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux