-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File_system: support for file modification timestamps #1784
Comments
The plan for implementing the functionality is as follows:
Setting the modification time of a node should be a deliberate decision of the client rather than an implicit side-effect of the file system provider, which may or may not has access to a time source. Afterwards we'll deal with the VFS and libc side of things. |
Thank you for capturing the outcome of our offline discussion, @cnuke. |
My file_system_modtime__wip branch contains the first sketch (be warned I haven't even tried to compile it yet). |
The commits already very nice. Please see my inline comments. |
I updated my wip branch. It now contains a semi-functioning implementation, open issue to consider:
So far I will ignore the last two points and focus on the first two. |
The eager sync has already been identified as a unnecessary and don't see any problems with skipping it for unmodified files. |
Yes and the tracking of unmodified files is the thing missing so far. |
I've force pushed the branch again and it now contains commits that address the first two points of my previous post. Together with some small adjustments in the *genodians.org` appliance, lighttpd serves resources with the proper modification time now. I'll work on cleaning it up for staging next week. |
The current WIP state is now live on genodians.org. |
Running it on genodians.org revealed a bug in the current implementation (I didn't catch the Insufficient_buffer exception of the |
I put the commits on top of the current master branch and they are live again on genodians.org. @m-stein you may give thunderbird's RSS tool a try. |
@cnuke Ah thanks! |
@cnuke Seems to work - thanks a lot! |
And the mtime commits are off again, there are apparently still some problems left (genodians.org sometimes still gets stuck, setting verbose="yes" in noux seems to make it more reliable while interactive usage works fine). |
... and set initial time by using RTC session. Up to now Noux used a monotic clock whose initial start value always was '0' (which correlates to the start of the UNIX epoch) to provide a notion of time. In addition it is now possible to use the RTC session to set the initial value for use-case where having a proper real world time matters. It does not do any time-zone conversion - the returned time depends on the component provide the RTC service. To use the RTC session the 'rtc' attribute of the '<config>' node must be set to 'yes'. Thereby the session becomes a mandatory dependency as Noux will not start without it. Issue genodelabs#1784.
... and set initial time by using RTC session. Up to now Noux used a monotic clock whose initial start value always was '0' (which correlates to the start of the UNIX epoch) to provide a notion of time. In addition it is now possible to use the RTC session to set the initial value for use-case where having a proper real world time matters. It does not do any time-zone conversion - the returned time depends on the component provide the RTC service. To use the RTC session the 'rtc' attribute of the '<config>' node must be set to 'yes'. Thereby the session becomes a mandatory dependency as Noux will not start without it. Issue genodelabs#1784.
By specifying <libc update_mtime="no"...>, the modification-time update on VFS-sync operations (as issued whenever a written file is closed) can explicitly be disabled. Issue #1784
With the added modification-time support in the libc, the extract tool requires a timer session, which is not plausible for the purpose of the program. This behavior stems from the fact that the libc implicitly writes the mtime when closing a written file. For this update, it implicitly calls 'clock_gettime', which in turn initializes the timer subsystem within the libc (creating a timer session). For the extract tool, the implicitly updated mtime is useless because the extract tool overwrites this modification time with the mtime stored in the archive anyway. However, the dependency from a timer service remains. This patch explicitly disables the libc's implicit updating of the file-modification when closing a written file. Issue #1784
... and set initial time by using RTC session. Up to now Noux used a monotic clock whose initial start value always was '0' (which correlates to the start of the UNIX epoch) to provide a notion of time. In addition it is now possible to use the RTC session to set the initial value for use-case where having a proper real world time matters. It does not do any time-zone conversion - the returned time depends on the component provide the RTC service. To use the RTC session the 'rtc' attribute of the '<config>' node must be set to 'yes'. Thereby the session becomes a mandatory dependency as Noux will not start without it. Issue genodelabs#1784.
... and set initial time by using RTC session. Up to now Noux used a monotic clock whose initial start value always was '0' (which correlates to the start of the UNIX epoch) to provide a notion of time. In addition it is now possible to use the RTC session to set the initial value for use cases where having a proper real-world time matters. To use the RTC session the 'rtc' attribute of the '<config>' node must be set to 'yes'. Thereby the session becomes a mandatory dependency as Noux will not start without it. Issue #1784
By specifying <libc update_mtime="no"...>, the modification-time update on VFS-sync operations (as issued whenever a written file is closed) can explicitly be disabled. Issue #1784
With the added modification-time support in the libc, the extract tool requires a timer session, which is not plausible for the purpose of the program. This behavior stems from the fact that the libc implicitly writes the mtime when closing a written file. For this update, it implicitly calls 'clock_gettime', which in turn initializes the timer subsystem within the libc (creating a timer session). For the extract tool, the implicitly updated mtime is useless because the extract tool overwrites this modification time with the mtime stored in the archive anyway. However, the dependency from a timer service remains. This patch explicitly disables the libc's implicit updating of the file-modification when closing a written file. Issue #1784
Fixed in master. |
This is a follow-up patch for issue #1784 that solves two inconsistencies. - The Vfs::Timestamp::INVALID matches File_system::Timestamp::INVALID - The Noux libc plugin tests for Timestamp::INVALID instead of a positive value. The patch fixes the mtime info as shown in directory listings in Sculpt's inspect window.
Although support was added some time ago (genodelabs#1784) the commit missed executing the code from the 'Vfs::File_system' interface.
Although support was added some time ago (genodelabs#1784) the commit missed executing the code from the 'Vfs::File_system' interface. Fixes genodelabs#4371.
By now having support for something like
st_ctim
andst_mtim
sounds reasonable. Adding this feature would first of all involve extendingFile_system::Status
as well as adding the required functionality to each file system or rather enabling the usage by tapping into the existing API (e.g.rump_fs
) and probably the layers above (VFS). I am not sure if it is actually necessary to support it in all pseudo file system (or evenram_fs
for that matter) but at least supporting in the ones used for persistent storage would be nice.The text was updated successfully, but these errors were encountered: