Timestamps in BFS are stored with a 16 bit subsecond precision. However, a lot of files have this field set to 0 as they are created with APIs that do not set a subsecond precsion value. The previous format (introduced in hrev31057) did not track wether the stored data was a 12 bit sequential number or a 12 bit subsecond timestamp + 4 bit sequential number. As a result, setting a timestamp with nsec=0 would read back a different value (exposing the sequential counter to userspace). Older versions of Haiku, and BeOS according to the Practical Filesystem Design book, did not store a timestamp there. Haiku used to store the volume UID (I don't understand why), and BeOS stored a sequence number because the POSIX APIs at the time didn't allow to get and set the time with nanosecond precision. The Practical Filesystem Design already mentions that storing a subsecond precision value here would have been better than their workaround. The new format relies on the fact that nanoseconds can only be in the range from 0 to 999999999. After the conversion to a 16 bit value using simple shifts, this result in a maximum possible value of 0xEE60. The new format exploits that, and uses the range 0xF000 to 0xFFFF to represent 0 timestamps with a 12 bit sequence number. This allows the sequence number to be hidden from userspace entirely. Fixes #19213. Change-Id: Id80289a4331ecfbf2f1a35520b58a99227d1f1d6 Reviewed-on: https://review.haiku-os.org/c/haiku/+/10146 Tested-by: Commit checker robot <[email protected]> Reviewed-by: waddlesplash <[email protected]>
Haiku
Homepage | Mailing Lists | IRC Channels | Issue Tracker | API docs
Haiku is an open-source operating system that specifically targets personal computing. Inspired by the BeOS, Haiku is fast, simple to use, easy to learn and yet very powerful.
Goals
- Sensible defaults with minimal configuration required.
- Clean, clear, concise code.
- Unified desktop environment.
Trying Haiku
Haiku provides pre-built nightly images and release images. Haiku is compatible with a large variety of hardware, but in case you don't want to "take the plunge" and install Haiku on bare metal, you can install it on a virtual machine (VM) instead. If you've never used a VM before, you can follow one of the "Emulating Haiku" guides.
Compiling Haiku
See ReadMe.Compiling.
Contributing
Haiku is a meritocratic open source project with a large variety of tasks. Even if you can't write code, you can still help! Haiku needs designers, (technical) writers, translators, testers... Get involved and help out!
Contributing code
If you're submitting a patch to us, please make sure you're following the patch submitting guidelines.
If you're having trouble finding something in the source tree, you can use one of our web-based source code browsers:
- https://grok.nikisoft.one/opengrok/ (OpenGrok, provided by Niklas Poslovski)
- https://git.haiku-os.org/ (git, provided by Haiku, Inc.)
Contributing documentation
The main piece of documentation that still needs work are the API docs (found
in the tree at docs/user). Just find an undocumented class, write
documentation for it, and submit a patch.
Contributing translations
See wiki:i18n.
Contributing software ports
See HaikuPorts.
Contributing to our infrastructure
See Infrastructure.