This adds a new field to the file information we keep, the "previous blocks hash". This is the hash of the file contents as it was in its previous incarnation. That is, every scan that updates the blocks hash will move the current hash to the "previous" field. This enables an addition to the conflict detection algorithm: if the file to be synced is in conflict with the current file on disk (version-counter wise), but it indicates that it was based on the precise contents we have (new.prevBlocksHash == current.blocksHash), then it's not really a conflict. Signed-off-by: Jakob Borg <jakob@kastelo.net>
This commit is contained in:
+2
-1
@@ -113,6 +113,7 @@ message FileInfo {
|
||||
repeated BlockInfo blocks = 16;
|
||||
bytes symlink_target = 17;
|
||||
bytes blocks_hash = 18;
|
||||
bytes previous_blocks_hash = 20;
|
||||
bytes encrypted = 19;
|
||||
FileInfoType type = 2;
|
||||
uint32 permissions = 4;
|
||||
@@ -127,7 +128,7 @@ message FileInfo {
|
||||
uint32 local_flags = 1000;
|
||||
|
||||
// The version_hash is an implementation detail and not part of the wire
|
||||
// format.
|
||||
// format. It is used in the old database format.
|
||||
bytes version_hash = 1001;
|
||||
|
||||
// The time when the inode was last changed (i.e., permissions, xattrs
|
||||
|
||||
@@ -17,6 +17,7 @@ message FileInfoTruncated {
|
||||
reserved 16; // blocks
|
||||
bytes symlink_target = 17;
|
||||
bytes blocks_hash = 18;
|
||||
bytes previous_blocks_hash = 20;
|
||||
bytes encrypted = 19;
|
||||
bep.FileInfoType type = 2;
|
||||
uint32 permissions = 4;
|
||||
|
||||
Reference in New Issue
Block a user