Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: # Context At the source control team we are benchmarking various IO workflows on file systems like APFS, BTRFS, and NTFS, as well as using DBs for those workflows instead of native file system of the OS (e.g, RocksDB and LMDB). See the ``` buck run fbcode/mode/opt fbcode//eden/fs/facebook/prototypes/fsiomicrobench:main ``` tool for more details. # This diff The tool is written in Rust and we are adding the LMDB benchmark. We found that the LMDB Rust binding does not compile on MacOS. The issue is that the mode_t is 16 bit on MacOS and is 32 bit on Linux. The Rust bindings always assumed u32 for the `perms` argument. I have changed the type to u16 as 16 bits can fully represent permissions anyway and converting it to u32 is always safe. While the opposite approach of keeping u32 and and converting to u16 requires partial functions that may fail at run time. That is `.into()` is always safer than `try_into()`. Welcome alternative suggestions, if there is a better way of doing this. Reviewed By: nt591 Differential Revision: D68388014 fbshipit-source-id: d50035f398ae7186fef6b96a9858771c15e3d8f4
- Loading branch information