syncthing/cmd
Jakob Borg b1b68ceedb
Add LocalFlags to FileInfo (#4952)
We have the invalid bit to indicate that a file isn't good. That's enough for remote devices. For ourselves, it would be good to know sometimes why the file isn't good - because it's an unsupported type, because it matches an ignore pattern, or because we detected the data is bad and we need to rescan it.

Or, and this is the main future reason for the PR, because it's a change detected on a receive only device. We will want something like the invalid flag for those changes, but marking them as invalid today means the scanner will rehash them. Hence something more fine grained is required.

This introduces a LocalFlags fields to the FileInfo where we can stash things that we care about locally. For example,

    FlagLocalUnsupported = 1 << 0 // The kind is unsupported, e.g. symlinks on Windows
    FlagLocalIgnored     = 1 << 1 // Matches local ignore patterns
    FlagLocalMustRescan  = 1 << 2 // Doesn't match content on disk, must be rechecked fully

The LocalFlags fields isn't sent over the wire; instead the Invalid attribute is calculated based on the flags at index sending time. It's on the FileInfo anyway because that's what we serialize to database etc.

The actual Invalid flag should after this just be considered when building the global state and figuring out availability for remote devices. It is not used for local file index entries.
2018-06-24 09:50:18 +02:00
..
stbench all: Fix comment typos 2017-11-04 07:20:11 +00:00
stcli cmd/syncthing-cli: Fix errors show command (#4849) 2018-04-18 21:08:10 +01:00
stcompdirs lib: Folder marker is now a folder 2017-09-02 05:52:38 +00:00
stdisco all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
stdiscosrv cmd/stdiscosrv: Delete records for abandoned devices (#4957) 2018-05-16 09:26:20 +02:00
stevents all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
stfileinfo all: Implement variable sized blocks (fixes #4807) 2018-04-16 19:08:50 +01:00
stfinddevice all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
stfindignored cmd/stfindignored: Default to current directory 2018-06-06 22:24:36 +02:00
stgenfiles all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
stindex all: Convert folders to use filesystem abstraction 2017-08-19 14:36:56 +00:00
strelaypoolsrv gui: Update to Font Awesome v5 (#4889) 2018-05-24 19:59:32 +01:00
strelaysrv cmd/strelaypoolsrv: Move metric scraping to the server itself (#4866) 2018-04-08 20:13:55 +01:00
stsigtool cmd/stsigtool: Silence spurious Go 1.10 test/vet complaint 2017-12-10 19:42:17 +01:00
stvanity all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
stwatchfile all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
syncthing Add LocalFlags to FileInfo (#4952) 2018-06-24 09:50:18 +02:00
todos all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
.gitignore Remove reprecated st* utils 2014-07-01 12:20:25 +02:00