Repository navigation
Remove platform-specific files from tiered_storage and file_cache - #1123
Merged
foodprocessor merged 6 commits intoNov 10, 2026
Merged
Conversation
foodprocessor
had a problem deploying
to
testing
November 10, 2026 10:10 — with
GitHub Actions
Error
foodprocessor
had a problem deploying
to
testing
November 10, 2026 10:10 — with
GitHub Actions
Error
foodprocessor
had a problem deploying
to
testing
November 10, 2026 10:10 — with
GitHub Actions
Error
foodprocessor
temporarily deployed
to
testing
November 10, 2026 10:10 — with
GitHub Actions
Inactive
foodprocessor
temporarily deployed
to
testing
November 10, 2026 10:10 — with
GitHub Actions
Inactive
foodprocessor
temporarily deployed
to
testing
November 10, 2026 10:10 — with
GitHub Actions
Inactive
foodprocessor
temporarily deployed
to
testing
November 10, 2026 10:10 — with
GitHub Actions
Inactive
foodprocessor
had a problem deploying
to
testing
November 10, 2026 10:10 — with
GitHub Actions
Failure
foodprocessor
temporarily deployed
to
testing
November 10, 2026 10:10 — with
GitHub Actions
Inactive
3 of 9 tasks
Make tiered_storage platform-independent by moving the code that inspects
fs.FileInfo.Sys() and queries free disk space into common/util_{linux,windows}.go:
GetFileTimes, GetFileOwner and IsProtectedSystemFile.
GetAvailFree now returns bytes on both platforms instead of 4096-byte
"blocks", resolving its TODO:
- Linux multiplies by Frsize, the unit statfs block counts are in.
- Windows no longer swaps avail and free; the GetDiskFreeSpaceEx out-params
were misnamed, so avail was total free bytes and free was the caller's
quota-limited bytes.
- Callers drop their * 4096 conversions, and block_cache StatFs now reports
Bfree in units of its own block size.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
file_cache and tiered_storage built identical ObjAttrs from local file info, so move the builder to internal.NewLocalObjAttr. file_cache now also uses common.GetAvailFree in place of its own platform-specific getAvailableSize. On Windows, file_cache now sizes the cache from the caller's quota-limited free space instead of the volume's total free space; on Linux it uses Frsize instead of Bsize. These are equal on common configurations. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The upload reads the cache file back through the OS page cache, so it sees all written data without first syncing it to the local disk. - Linux: syncFile duplicated and closed the fd, which writes nothing to a local disk, so removing it only saves two syscalls per flush. - Windows: syncFile called FlushFileBuffers, forcing a full disk flush on every dirty flush before the upload. Dropping it removes that cost; the cloud object, not the cache file, is the durable copy. FlushFile keeps returning EBADF for a dirty handle with no file object. This removes the last platform-specific code from file_cache. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
foodprocessor
force-pushed
the
refactor/common-file-helpers
branch
from
November 10, 2026 10:19
d1662d0 to
bd8f68a
Compare
foodprocessor
had a problem deploying
to
testing
November 10, 2026 10:19 — with
GitHub Actions
Failure
foodprocessor
temporarily deployed
to
testing
November 10, 2026 10:19 — with
GitHub Actions
Inactive
foodprocessor
temporarily deployed
to
testing
November 10, 2026 10:19 — with
GitHub Actions
Inactive
foodprocessor
temporarily deployed
to
testing
November 10, 2026 10:19 — with
GitHub Actions
Inactive
foodprocessor
temporarily deployed
to
testing
November 10, 2026 10:19 — with
GitHub Actions
Inactive
foodprocessor
temporarily deployed
to
testing
November 10, 2026 10:19 — with
GitHub Actions
Inactive
foodprocessor
temporarily deployed
to
testing
November 10, 2026 10:20 — with
GitHub Actions
Inactive
foodprocessor
temporarily deployed
to
testing
November 10, 2026 10:20 — with
GitHub Actions
Inactive
foodprocessor
temporarily deployed
to
testing
November 10, 2026 10:20 — with
GitHub Actions
Inactive
foodprocessor
temporarily deployed
to
testing
November 10, 2026 10:33 — with
GitHub Actions
Inactive
foodprocessor
marked this pull request as ready for review
November 10, 2026 16:49
foodprocessor
requested review from
Dabnsky and
Ferelith-maker
as code owners
November 10, 2026 16:49
foodprocessor
requested review from
brayan-trejo and
jfantinhardesty
as code owners
November 10, 2026 16:49
foodprocessor
temporarily deployed
to
testing
November 10, 2026 16:56 — with
GitHub Actions
Inactive
foodprocessor
temporarily deployed
to
testing
November 10, 2026 16:56 — with
GitHub Actions
Inactive
foodprocessor
temporarily deployed
to
testing
November 10, 2026 16:56 — with
GitHub Actions
Inactive
foodprocessor
temporarily deployed
to
testing
November 10, 2026 16:56 — with
GitHub Actions
Inactive
foodprocessor
temporarily deployed
to
testing
November 10, 2026 16:56 — with
GitHub Actions
Inactive
foodprocessor
temporarily deployed
to
testing
November 10, 2026 16:56 — with
GitHub Actions
Inactive
foodprocessor
temporarily deployed
to
testing
November 10, 2026 16:56 — with
GitHub Actions
Inactive
foodprocessor
temporarily deployed
to
testing
November 10, 2026 16:56 — with
GitHub Actions
Inactive
foodprocessor
temporarily deployed
to
testing
November 10, 2026 16:56 — with
GitHub Actions
Inactive
foodprocessor
temporarily deployed
to
testing
November 10, 2026 17:10 — with
GitHub Actions
Inactive
This branch was previously deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of Pull Request is this? (check all applicable)
Describe your changes in brief
Removes all platform-specific source files from
tiered_storageandfile_cacheby moving the OS-specific primitives intocommon/util_{linux,windows}.go. Stacked on #1049; merge that first (GitHub will retarget this PR tomainwhen the base branch is deleted).Commits are meant to be reviewed one at a time:
common.GetFileTimes,GetFileOwnerandIsProtectedSystemFile.GetAvailFreenow returns bytes on both OSes, resolving its TODO:Frsize, the unit statfs block counts are in.GetDiskFreeSpaceExout-params were misnamed, soGetAvailFreereturned (total free, caller-available), the reverse of Linux. It now returns (caller-available, total free).cmd/config.go, block_cache) drop their* 4096conversions. Block cacheStatFsnow reportsBfreein its own block-size units instead of a raw block count from/.newObjAttr/newTieredStorageObjAttrbuilders becomeinternal.NewLocalObjAttr, and file_cache usescommon.GetAvailFree.syncFileduplicated and closed the fd, which writes nothing to a local disk.FlushFileBufferson every dirty flush, a full disk flush before each upload.EBADFcheck for a handle with no file object is kept.Behavior changes to watch for:
Frsizeinstead ofBsize. These are equal on ext4, xfs and btrfs.Checklist
Validation (Linux; Windows checked by cross-compiling):
go build -tags fuse3 ./...andGOOS=windows go build ./...: passedgo veton changed packages, Linux andGOOS=windows: passed. The Windows run shows an existingunsafe.Pointerwarning incomponent/block_cache/block_windows.go, which this PR doesn't touch.go test ./component/file_cache/ ./component/tiered_storage/ ./component/block_cache/ ./internal/ --tags=unittest,fuse3: passed.block_cacheTestEmptyfailed once in three runs and also fails occasionally without these changes.go test ./common/ ./cmd/ --tags=unittest,fuse3:TestIsMountActiveNoMountandTestSyncNoS3Credentialsfail the same way on the base branch (environment-dependent).golangci-lint run --tests=false --build-tags fuse3 --max-issues-per-linter=0 --new-from-rev=origin/feature/tiered_storage: 0 issues (Linux andGOOS=windows).TestEvictionUploadsLocalModeAndOwnernow runs on both OSes. On Windows it asserts that no chmod or chown is sent.Related Issues