diff options
author | Jakob Unterwurzacher | 2015-11-01 12:11:36 +0100 |
---|---|---|
committer | Jakob Unterwurzacher | 2015-11-01 12:11:36 +0100 |
commit | 902babdf22199d73171716e643f1ffbb65e6fb48 (patch) | |
tree | c3194bce9fd9b4db0a569fca3b5041abd278be70 /pathfs_frontend/file_holes.go | |
parent | 14276c96328a1a1ad2b354c65d8db7fa720559e1 (diff) |
Refactor ciphertext <-> plaintext offset translation functions
Move all the intelligence into the new file address_translation.go.
That the calculations were spread out too much became apparent when adding
the file header. This should make the code much easier to modify in the
future.
Diffstat (limited to 'pathfs_frontend/file_holes.go')
-rw-r--r-- | pathfs_frontend/file_holes.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pathfs_frontend/file_holes.go b/pathfs_frontend/file_holes.go index f906aa6..3db4828 100644 --- a/pathfs_frontend/file_holes.go +++ b/pathfs_frontend/file_holes.go @@ -7,8 +7,8 @@ import ( // Will a write to offset "off" create a file hole? func (f *file) createsHole(plainSize uint64, off int64) bool { - nextBlock := f.cfs.BlockNoPlainOff(plainSize) - targetBlock := f.cfs.BlockNoPlainOff(uint64(off)) + nextBlock := f.cfs.PlainOffToBlockNo(plainSize) + targetBlock := f.cfs.PlainOffToBlockNo(uint64(off)) if targetBlock > nextBlock { return true } |