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 Tue, Sep 01, 2020 at 07:44:12PM +0800, Gao Xiang wrote:
> 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

They were open-coded in previous iterations, but one of the reviewers
asked for the bigtime de/encoding code to be split into separate
functions.

> > +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...

Yes, that was fixed...

--D

> 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