From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anton Altaparmakov Subject: Re: [RFC] Ext3 nanosecond timestamps in big inodes Date: Mon, 17 Jan 2005 09:49:12 +0000 Message-ID: <1105955352.22856.5.camel@imp.csi.cam.ac.uk> References: <200501142216.12726.agruen@suse.de> <20050116054604.GI22715@schnapps.adilger.int> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: Andreas Gruenbacher , linux-fsdevel@vger.kernel.org, lkml , Alex Tomas , Andrew Tridgell Return-path: Received: from ppsw-2.csi.cam.ac.uk ([131.111.8.132]:26588 "EHLO ppsw-2.csi.cam.ac.uk") by vger.kernel.org with ESMTP id S262750AbVAQJtX (ORCPT ); Mon, 17 Jan 2005 04:49:23 -0500 To: Andreas Dilger In-Reply-To: <20050116054604.GI22715@schnapps.adilger.int> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org 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 (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/