From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steve French Subject: Re: ext4 - getting at birth time (file create time) and getting/setting nanosecond time stamps and utime Date: Mon, 19 Oct 2009 17:24:04 -0500 Message-ID: <524f69650910191524k5c9d766fu430c4f7b17d86952@mail.gmail.com> References: <524f69650910191017j7883ed7bvdb0329d1a73f34e4@mail.gmail.com> <524f69650910191245t2eb7ffb2r770a7373ec2ba1e3@mail.gmail.com> <5715838A-4568-4273-B1C1-983B348580B6@sun.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-fsdevel , samba-technical To: Andreas Dilger Return-path: Received: from mail-px0-f171.google.com ([209.85.216.171]:34309 "EHLO mail-px0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755454AbZJSWYA convert rfc822-to-8bit (ORCPT ); Mon, 19 Oct 2009 18:24:00 -0400 Received: by pxi1 with SMTP id 1so741186pxi.33 for ; Mon, 19 Oct 2009 15:24:04 -0700 (PDT) In-Reply-To: <5715838A-4568-4273-B1C1-983B348580B6@sun.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, Oct 19, 2009 at 3:11 PM, Andreas Dilger wrote= : > On 19-Oct-09, at 13:45, Steve French wrote: >> >> On Mon, Oct 19, 2009 at 1:55 PM, Andreas Dilger wr= ote: >>> >>> 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 what= ever >>> format is most efficient for it. =A0We only strictly need user.crti= me >>> for this, but I wouldn't object to exporting other inode attributes= in >>> this way (e.g. user.mtime, user.atime, etc). >> >> Yes - the fake xattr approach was the approach that I preferred >> (since I could do this trivially to cifs, and for ext4 it seems equa= lly >> easy), >> but I wonder if this "path based" approach is slightly harder for Sa= mba, >> since for most cases Samba maps to "handle based" equivalents >> (when the same operation can come in eitherpath based or >> handle based - Samba mostly maps to handle based). > > Could you please elaborate what you mean by "path based" for xattrs? > They can be gotten with sys_fgetxattr() from a file handle just as > easily as from the filename. Although handle based interfaces are there for xattrs in userspace, internally the xattr calls are path based, so handle based calls get converted to path based in kernel and you could lose some of the performance benefit - path based could be slightly slower (due to path revalidation, and access checks) than handle based calls. int (*setxattr) (struct dentry *, const char *,const void *,siz= e_t,int); ssize_t (*getxattr) (struct dentry *, const char *, void *, siz= e_t); ssize_t (*listxattr) (struct dentry *, char *, size_t); int (*removexattr) (struct dentry *, const char *); > > I definitely agree with having a common attribute name for these. > > As for being able to write to the "create time" attribute, I would pr= efer > that this be a filesystem mount option. =A0For some users (myself inc= luded) > I don't care whether Windows is unhappy that it can't update this cre= ation > time - I'd prefer to know when a file is actually created. I agree - if create time could be overwritten - that behavior hould be configurable (another post mentioned the alternative to mount option - a flag for this perhaps along the lines of the a "backup inten= t" flag - although somewhat different than what Windows uses that for). --=20 Thanks, Steve -- 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