Re: [RFC v2 03/83] Add super.h.

From: Arnd Bergmann
Date: Thu Mar 15 2018 - 16:38:36 EST


On Thu, Mar 15, 2018 at 6:51 PM, Andiry Xu <jix024@xxxxxxxxxxxx> wrote:
> On Thu, Mar 15, 2018 at 2:05 AM, Arnd Bergmann <arnd@xxxxxxxx> wrote:
>> On Thu, Mar 15, 2018 at 7:11 AM, Andiry Xu <jix024@xxxxxxxxxxxx> wrote:
>
> Superblock mtime is not a big problem as it is updated rarely. 64-bit
> seconds and 32-bit nanoseconds make the inode and log entry bigger,
> and updating file->atime cannot be done with a single 64bit update.
> That may be annoying and needs to use journaling.

If this is a big concern, you could use a format similar to what ext4 has:
30 bits of nanoseconds, and 34 bits of seconds, where the upper two
bits count the epoch. That gives you a time range from years 1902 to
2446.

You could also have a resolution of less than a nanosecond. Note
that today, the file time stamps generated by the kernel are in
jiffies resolution, so at best one millisecond. However, most modern
file systems go with the 64+32 bit timestamps because it's not all
that expensive.

Arnd