Repository navigation
lib/fs: use file clone ioctl wrappers and types from golang.org/x/sys/unix - #7000
Merged
Merged
Conversation
Updated by running `go get golang.org/x/sys@latest && go mod tidy`
tklauser
force-pushed
the
ioctl-clone-x-sys-unix
branch
2 times, most recently
from
September 23, 2020 08:42
8b374f8 to
2691c8f
Compare
calmh
previously approved these changes
Sep 23, 2020
Member
|
I'll have a look this evening |
tklauser
force-pushed
the
ioctl-clone-x-sys-unix
branch
from
September 23, 2020 14:50
2691c8f to
801db5e
Compare
…/unix Use the IoctlFileClone and IoctlFileCloneRange ioctl wrappers and the FileCloneRange type provided by golang.org/x/sys/unix instead of locally implementing them. This also allows to re-enable the code for ppc/ppc64/ppc64le again (see commit 758a1a6 ("lib/fs: Disable ioctl on ppc (fixes syncthing#6898) (syncthing#6901)")) since golang.org/x/sys/unix internally uses the correct FICLONE and FICLONERANGE values depending on $GOARCH.
tklauser
force-pushed
the
ioctl-clone-x-sys-unix
branch
from
September 23, 2020 15:28
801db5e to
41c3654
Compare
AudriusButkevicius
approved these changes
Sep 23, 2020
calmh
added a commit
to calmh/syncthing
that referenced
this pull request
Sep 29, 2020
* main: lib/fs: Add COM0 and LPT0 to invalid Windows file names (ref syncthing#7008) (syncthing#7013) lib/fs: Be even more strict about Windows names (ref syncthing#7008) (syncthing#7012) lib/fs: Be more clear about invalid file names (ref syncthing#7010) (syncthing#7011) lib/model: Disallow reserved names, and names ending with period on Windows (fixes syncthing#7008) (syncthing#7010) lib/model, lib/scanner: Prevent races aborting scans (fixes syncthing#6994) (syncthing#6997) lib/fs: Use file clone ioctl wrappers and types from golang.org/x/sys/unix (syncthing#7000) Update config.yml gui, man, authors: Update docs, translations, and contributors
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Purpose
Use the
IoctlFileCloneandIoctlFileCloneRangeioctl wrappers and theFileCloneRangetype provided bygolang.org/x/sys/unixinstead oflocally implementing them. This also allows to re-enable the code for
ppc/ppc64/ppc64le again (see commit 758a1a6 ("lib/fs: Disable ioctl
on ppc (fixes #6898) (#6901)")) since
golang.org/x/sys/unixinternallyuses the correct
FICLONEandFICLONERANGEvalues depending on$GOARCH.This PR also bumps the version of
golang.org/x/sysTesting
Ran unit tests in
lib/fsusinggo test -v ./lib/fs