ext4 - getting at birth time (file create time) and getting/setting nanosecond time stamps and utime
adilger at sun.com
Mon Oct 19 17:12:02 MDT 2009
On 19-Oct-09, at 16:24, Steve French wrote:
> On Mon, Oct 19, 2009 at 3:11 PM, Andreas Dilger <adilger at sun.com>
>> On 19-Oct-09, at 13:45, Steve French wrote:
>>> Yes - the fake xattr approach was the approach that I preferred
>>> (since I could do this trivially to cifs, and for ext4 it seems
>>> but I wonder if this "path based" approach is slightly harder for
>>> 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
> ssize_t (*getxattr) (struct dentry *, const char *, void *,
> ssize_t (*listxattr) (struct dentry *, char *, size_t);
> int (*removexattr) (struct dentry *, const char *);
I'm not sure I understand your point. sys_fgetxattr() maps directly to
vfs_getxattr(), and while it still does permission checks, that doesn't
have anything to do with pathname revalidation AFAICS.
There are an equal number of permission checks in sys_fstat-
as in sys_fgetxattr->vfs_getxattr().
>> As for being able to write to the "create time" attribute, I would
>> that this be a filesystem mount option. For some users (myself
>> I don't care whether Windows is unhappy that it can't update this
>> 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
> flag - although somewhat different than what Windows uses that for).
If this is a flag that a user can configure/select themselves, then it
is completely useless to me. If it is a mount option and/or possibly an
additional process capability that would be more useful.
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.
More information about the samba-technical