copyrangemethod.go 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright (C) 2020 The Syncthing Authors.
  2. //
  3. // This Source Code Form is subject to the terms of the Mozilla Public
  4. // License, v. 2.0. If a copy of the MPL was not distributed with this file,
  5. // You can obtain one at https://mozilla.org/MPL/2.0/.
  6. package fs
  7. type CopyRangeMethod int32
  8. const (
  9. CopyRangeMethodStandard CopyRangeMethod = 0
  10. CopyRangeMethodIoctl CopyRangeMethod = 1
  11. CopyRangeMethodCopyFileRange CopyRangeMethod = 2
  12. CopyRangeMethodSendFile CopyRangeMethod = 3
  13. CopyRangeMethodDuplicateExtents CopyRangeMethod = 4
  14. CopyRangeMethodAllWithFallback CopyRangeMethod = 5
  15. )
  16. func (o CopyRangeMethod) String() string {
  17. switch o {
  18. case CopyRangeMethodStandard:
  19. return "standard"
  20. case CopyRangeMethodIoctl:
  21. return "ioctl"
  22. case CopyRangeMethodCopyFileRange:
  23. return "copy_file_range"
  24. case CopyRangeMethodSendFile:
  25. return "sendfile"
  26. case CopyRangeMethodDuplicateExtents:
  27. return "duplicate_extents"
  28. case CopyRangeMethodAllWithFallback:
  29. return "all"
  30. default:
  31. return "unknown"
  32. }
  33. }