Re: [RFC] Ext3 nanosecond timestamps in big inodes

From: Anton Altaparmakov
Date: Mon Jan 17 2005 - 04:52:04 EST


On Sat, 2005-01-15 at 22:46 -0700, Andreas Dilger wrote:
> On Jan 14, 2005 22:16 +0100, Andreas Gruenbacher wrote:
> > +static inline struct timespec ext3_current_time(struct inode *inode)
> > +{
> > + return (inode->i_sb->s_time_gran == 1) ?
> > + CURRENT_TIME : CURRENT_TIME_SEC;
> > +}
>
> If "s_time_gran" (I haven't seen this before but it doesn't appear to
> be a part of your patch) had some useful meaning we could use it to e.g.
> shift the nsec part of the timestamps as Andy requested so as not to make
> the timestamps change too often.

sb->s_time_gran is the granularity used for the time in each fs in
nanoseconds. So, for example in NTFS it is set to 100 as NTFS stores
time as 100ns intervals. This means the kernel time can be rounded
appropriately when the fs inode times are being updated. Without this
you can see inode time jumping backwards in time if the inode is thrown
out of memory and then read in again and in the process it had some of
the time bits truncated...

See the original post of the patch from Andi Kleen for details:

http://marc.theaimsgroup.com/?l=linux-kernel&m=110134111125012&w=2

Best regards,

Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/