diff --git a/gui/default/syncthing/core/syncthingController.js b/gui/default/syncthing/core/syncthingController.js
index 9aef028a..8682627b 100755
--- a/gui/default/syncthing/core/syncthingController.js
+++ b/gui/default/syncthing/core/syncthingController.js
@@ -78,7 +78,6 @@ angular.module('syncthing.core')
externalCommand: "",
autoNormalize: true,
path: "",
- useLargeBlocks: true,
};
$scope.localStateTotal = {
diff --git a/gui/default/syncthing/folder/editFolderModalView.html b/gui/default/syncthing/folder/editFolderModalView.html
index 6d7074b3..7de8d766 100644
--- a/gui/default/syncthing/folder/editFolderModalView.html
+++ b/gui/default/syncthing/folder/editFolderModalView.html
@@ -155,8 +155,6 @@
diff --git a/lib/config/folderconfiguration.go b/lib/config/folderconfiguration.go
index 5b08bd81..4a6ee780 100644
--- a/lib/config/folderconfiguration.go
+++ b/lib/config/folderconfiguration.go
@@ -52,7 +52,6 @@ type FolderConfiguration struct {
Paused bool `xml:"paused" json:"paused"`
WeakHashThresholdPct int `xml:"weakHashThresholdPct" json:"weakHashThresholdPct"` // Use weak hash if more than X percent of the file has changed. Set to -1 to always use weak hash.
MarkerName string `xml:"markerName" json:"markerName"`
- UseLargeBlocks bool `xml:"useLargeBlocks" json:"useLargeBlocks" default:"true"`
CopyOwnershipFromParent bool `xml:"copyOwnershipFromParent" json:"copyOwnershipFromParent"`
cachedFilesystem fs.Filesystem
diff --git a/lib/model/folder.go b/lib/model/folder.go
index 517cf981..a9f5ff66 100644
--- a/lib/model/folder.go
+++ b/lib/model/folder.go
@@ -349,7 +349,6 @@ func (f *folder) scanSubdirs(subDirs []string) error {
Hashers: f.model.numHashers(f.ID),
ShortID: f.shortID,
ProgressTickIntervalS: f.ScanProgressIntervalS,
- UseLargeBlocks: f.UseLargeBlocks,
LocalFlags: f.localFlags,
})
diff --git a/lib/scanner/walk.go b/lib/scanner/walk.go
index 3852a9ae..c89bbcd0 100644
--- a/lib/scanner/walk.go
+++ b/lib/scanner/walk.go
@@ -52,8 +52,6 @@ type Config struct {
// Optional progress tick interval which defines how often FolderScanProgress
// events are emitted. Negative number means disabled.
ProgressTickIntervalS int
- // Whether to use large blocks for large files or the old standard of 128KiB for everything.
- UseLargeBlocks bool
// Local flags to set on scanned files
LocalFlags uint32
}
@@ -326,23 +324,19 @@ func (w *walker) handleItem(ctx context.Context, path string, toHashChan chan<-
func (w *walker) walkRegular(ctx context.Context, relPath string, info fs.FileInfo, toHashChan chan<- protocol.FileInfo) error {
curFile, hasCurFile := w.CurrentFiler.CurrentFile(relPath)
- blockSize := protocol.MinBlockSize
+ blockSize := protocol.BlockSize(info.Size())
- if w.UseLargeBlocks {
- blockSize = protocol.BlockSize(info.Size())
-
- if hasCurFile {
- // Check if we should retain current block size.
- curBlockSize := curFile.BlockSize()
- if blockSize > curBlockSize && blockSize/curBlockSize <= 2 {
- // New block size is larger, but not more than twice larger.
- // Retain.
- blockSize = curBlockSize
- } else if curBlockSize > blockSize && curBlockSize/blockSize <= 2 {
- // Old block size is larger, but not more than twice larger.
- // Retain.
- blockSize = curBlockSize
- }
+ if hasCurFile {
+ // Check if we should retain current block size.
+ curBlockSize := curFile.BlockSize()
+ if blockSize > curBlockSize && blockSize/curBlockSize <= 2 {
+ // New block size is larger, but not more than twice larger.
+ // Retain.
+ blockSize = curBlockSize
+ } else if curBlockSize > blockSize && curBlockSize/blockSize <= 2 {
+ // Old block size is larger, but not more than twice larger.
+ // Retain.
+ blockSize = curBlockSize
}
}
diff --git a/lib/scanner/walk_test.go b/lib/scanner/walk_test.go
index 74725a51..928e8ede 100644
--- a/lib/scanner/walk_test.go
+++ b/lib/scanner/walk_test.go
@@ -467,14 +467,13 @@ func TestWalkReceiveOnly(t *testing.T) {
func walkDir(fs fs.Filesystem, dir string, cfiler CurrentFiler, matcher *ignore.Matcher, localFlags uint32) []protocol.FileInfo {
fchan := Walk(context.TODO(), Config{
- Filesystem: fs,
- Subs: []string{dir},
- AutoNormalize: true,
- Hashers: 2,
- UseLargeBlocks: true,
- CurrentFiler: cfiler,
- Matcher: matcher,
- LocalFlags: localFlags,
+ Filesystem: fs,
+ Subs: []string{dir},
+ AutoNormalize: true,
+ Hashers: 2,
+ CurrentFiler: cfiler,
+ Matcher: matcher,
+ LocalFlags: localFlags,
})
var tmp []protocol.FileInfo