futimens and utimensat vs birthtime
Julian Elischer
julian at freebsd.org
Fri Aug 14 14:46:27 UTC 2015
So, currently the method of setting birthtime on a file is an awkward
combination of tricks.
These break down in a number of situations, but the one I'm
specifically interested in is as follows:
windows robocopy running through samba, onto a ZFS filesystem. (may
happen for UFS2 as well.)
In order to mark a file as 'incomplete' during transfer, windows sets
the modification time to Jan 1, 1980.
This triggers code in our system to set the birthtime to Jan 1 1980.
it then, on completion of the file sets the modification and birth
times to the correct values.
This fails becasue you can not make a birthtime later than what it is
already set to.
As the Man page for utimensat() says:
"Ideally a new system call will be added that allows the setting of
all three times at once."
I would like to implement this call. but would like input as to it's
nature.
The code inside the system would already appear to support handling
three elements, though it needs some scrutiny,
so all that is needed is a system call with the ability to set the
birthtime directly.
Whether it should take the form of the existing calls but expecting
three items is up for discussion.
Maybe teh addition of a flags argument to specify which items are
present and which to set.
ideas?
Julian
More information about the freebsd-current
mailing list