From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mingming Subject: Re: ext4 - getting at birth time (file create time) and getting/setting nanosecond time stamps and utime Date: Mon, 19 Oct 2009 17:41:03 -0700 Message-ID: <1255999263.4257.84.camel@mingming-laptop> References: <524f69650910191017j7883ed7bvdb0329d1a73f34e4@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: Steve French , linux-fsdevel , samba-technical To: Andreas Dilger Return-path: Received: from e34.co.us.ibm.com ([32.97.110.152]:51524 "EHLO e34.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755820AbZJUWsG (ORCPT ); Wed, 21 Oct 2009 18:48:06 -0400 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by e34.co.us.ibm.com (8.14.3/8.13.1) with ESMTP id n9LMhMt7017379 for ; Wed, 21 Oct 2009 16:43:22 -0600 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id n9LMm6lr118882 for ; Wed, 21 Oct 2009 16:48:06 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id n9LMm3R1009917 for ; Wed, 21 Oct 2009 16:48:04 -0600 In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, 2009-10-19 at 12:55 -0600, Andreas Dilger wrote: > On 19-Oct-09, at 11:17, Steve French wrote: > > A new version of the format for Samba server related file system > > extended attributes is expected in the next version of Samba so the > > topic of create time and nanosecond timestamps for Linux has come up > > again. Since some file systems don't support storing create time > > (birth time), and none support updating create time, or for that > > matter for storing any nanosecond timestamps at all (a millisecond > > seems like a much longer time today than when the stat structure was > > defined), and dos attributes, Samba server stores these in extended > > attributes, which is awkward on those file systems which store > > (different) versions of these on disk. > > I had proposed in the past that these file attributes be exposed to > userspace as virtual xattrs, e.g. user.cr_time returning a struct > timespec, but the data is stored internal to the filesystem in whatever > format is most efficient for it. We only strictly need user.crtime > for this, but I wouldn't object to exporting other inode attributes in > this way (e.g. user.mtime, user.atime, etc). > > I believe that nanosecond timestamps ARE supported with newer > filesystems > using stat(). There is the utimensat() system call, which takes a > timespec > parameter, so it looks to be suitable for setting nanosecond timestamps > from userspace. I don't know if glibc() supports this, but I do see it > in the kernel. > How we are going to set the nanotimestamps today? utimes(2) man page seems indicating it only support setting time at microseond level. > As for _updating_ create time, isn't that sort of defeating the purpose > of create time? > Perphas the backup/restore wants to preserve the original creation timestamp after the file being backuped? > Cheers, Andreas > -- > Andreas Dilger > Sr. Staff Engineer, Lustre Group > Sun Microsystems of Canada, Inc. > > -- > To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html