Re: [PATCH 1/3] hfs: stop using timespec based interfaces

From: Arnd Bergmann
Date: Fri Jun 22 2018 - 10:19:44 EST


On Wed, Jun 20, 2018 at 9:55 PM, Arnd Bergmann <arnd@xxxxxxxx> wrote:
> On Wed, Jun 20, 2018 at 6:55 PM, Viacheslav Dubeyko <slava@xxxxxxxxxxx> wrote:
>> On Tue, 2018-06-19 at 21:42 +0200, Arnd Bergmann wrote:
>>> On Tue, Jun 19, 2018 at 7:03 PM, Viacheslav Dubeyko <slava@xxxxxxxxxxx> wrote:

>>> /* time macros: convert between 1904-2040 and 1970-2106 range,
>>> * pre-1970 timestamps are interpreted as post-2038 times after
>>> wrap-around */
>>> -#define __hfsp_mt2ut(t) (be32_to_cpu(t) -
>>> 2082844800U)
>>> +#define __hfsp_mt2ut(t) ((time64_t)be32_to_cpu(t) -
>>> 2082844800U)
>>> #define __hfsp_ut2mt(t) (cpu_to_be32(t +
>>> 2082844800U))
>>>
>>> /* compatibility */
>>>
>>> I can submit that separately so that it can get backported into
>>> stable kernels if you like, with the type changes as a follow-up
>>> on top.
>>>
>>
>> Sounds good.
>
> Ok, I'll send an updated version with that patch first then.

I've now sent that patch with additional information that I got from reading the
XNU sources. Interestingly, that also uses the 1970-2106 time range that
I had in my original series, not the 1904-2040 time range that is documented.

Arnd