Skip to content

feat(cli): add --cow / --no-cow flag#3740

Merged
oferchen merged 1 commit into
masterfrom
feat/cow-cli-flag
May 6, 2026
Merged

feat(cli): add --cow / --no-cow flag#3740
oferchen merged 1 commit into
masterfrom
feat/cow-cli-flag

Conversation

@oferchen
Copy link
Copy Markdown
Owner

@oferchen oferchen commented May 5, 2026

Summary

  • Introduce CowPolicy enum (Auto default, Disabled) and a NoCowPlatformCopy adapter on fast_io that forces every whole-file copy through std::fs::copy, reporting CopyMethod::StandardCopy so downstream fast paths (such as the macOS clonefile shortcut) skip the reflink branch.
  • Add the --cow / --no-cow clap flag pair (mirroring --io-uring / --no-io-uring) with overrides_with so the last flag wins, and surface them in the help text and SUPPORTED_OPTIONS_LIST.
  • Plumb the new policy through ParsedArgs, the drive config inputs, ClientConfigBuilder, and build_local_copy_options, swapping the platform-copy strategy on LocalCopyOptions when --no-cow is in effect.

--no-cow is useful for benchmarking, diagnostics, and downstream tooling that does not handle FICLONE / copy_file_range / clonefile / ReFS reflinks. CoW remains opt-out only - the default --cow matches existing behaviour.

Test plan

  • cargo nextest run -p fast_io --all-features -E 'test(no_cow)'
  • cargo nextest run -p fast_io --all-features -E 'test(cow_policy)'
  • cargo nextest run -p oc-rsync-cli --all-features -E 'test(cow)'
  • cargo nextest run -p core --all-features -E 'test(cow_policy)'
  • Full CI: fmt+clippy, nextest (stable), Windows, macOS, Linux musl

Introduce a CowPolicy enum on `fast_io` and a NoCowPlatformCopy adapter
that forces every whole-file copy through the portable std::fs::copy
fallback. Wire `--cow` (default Auto) and `--no-cow` (Disabled) through
the CLI parser, ClientConfig, and `build_local_copy_options`, swapping
the platform-copy strategy when reflinks are disabled.

Useful for benchmarking, diagnostics, and downstream tooling that does
not handle FICLONE/copy_file_range/clonefile/ReFS reflinks.
@github-actions github-actions Bot added the enhancement New feature or request label May 5, 2026
@oferchen oferchen merged commit c140d16 into master May 6, 2026
39 checks passed
@oferchen oferchen deleted the feat/cow-cli-flag branch May 6, 2026 18:56
oferchen added a commit that referenced this pull request May 18, 2026
Introduce a CowPolicy enum on `fast_io` and a NoCowPlatformCopy adapter
that forces every whole-file copy through the portable std::fs::copy
fallback. Wire `--cow` (default Auto) and `--no-cow` (Disabled) through
the CLI parser, ClientConfig, and `build_local_copy_options`, swapping
the platform-copy strategy when reflinks are disabled.

Useful for benchmarking, diagnostics, and downstream tooling that does
not handle FICLONE/copy_file_range/clonefile/ReFS reflinks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant