-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fusebox: implement Read2 for the server
Prior to this commit, every Read call created a new FileStreamReader (at a possibly non-zero offset). After this commit, an FSR from previous Read calls may be re-used for the next Read call if it's already at the correct offset. The FUSE read API permits random access but, still, in the common case, reads happen with sequential access. The FSR class is abstract and not all implementations support seeking. If seeking is not supported then re-using the FSR can, in that common case, avoid quadratic I/O performance (see https://wiki.c2.com/?ShlemielThePainter). Read2 / Close2 (and, later, Write2) also differ from Read / Close / Write in that, at the protocol level, they take a numeric handle instead of a string file name (or file_system_url). Just like how multiple numerical-identifier file descriptors (with independent read/write offsets) can refer to the same underlying file, multiple numerical-identifier handles (and their linked FileStreamReader offsets) can refer to the same virtual file (named by its FileSystemURL). Passing a stable numeric handle (instead of an unstable file 'name') also moves us closer to more POSIX-like behavior in the case where we're reading from a (virtual) file concurrently with its parent directory being re-named. It's not entirely fixed, e.g. if reading is random access not sequential access, but it's closer than it used to be. This is one half of a multi-repo change. The other half is at https://crrev.com/c/4023308 BUG=b:255520194 TEST=manual Change-Id: I8177b4873d1df3ab96e6d655da1a959872a502af Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4022851 Reviewed-by: Ben Reich <benreich@chromium.org> Reviewed-by: Austin Sullivan <asully@chromium.org> Reviewed-by: Ryo Hashimoto <hashimoto@chromium.org> Commit-Queue: Nigel Tao <nigeltao@chromium.org> Cr-Commit-Position: refs/heads/main@{#1073681}
- Loading branch information
Nigel Tao
authored and
Chromium LUCI CQ
committed
Nov 19, 2022
1 parent
318ebe0
commit 3da7911
Showing
5 changed files
with
517 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.