diff options
author | Jakob Unterwurzacher | 2015-10-04 14:24:43 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2015-10-04 14:24:43 +0200 |
commit | c859f0b2dc8825763c3b63163a014435a8cdb3cf (patch) | |
tree | 3dc6f686e00322bfca25a70cb256524d27df81f4 /cryptfs/intrablock.go | |
parent | 775676ecb82f415874f3c6b83da1436b629166f4 (diff) |
intraBlock: Rename Offset to Skip
"Offset" is unclear whether it is an offset from the start of file
or start of block. "Skip" seems much better.
Diffstat (limited to 'cryptfs/intrablock.go')
-rw-r--r-- | cryptfs/intrablock.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cryptfs/intrablock.go b/cryptfs/intrablock.go index 78fd140..552cb3c 100644 --- a/cryptfs/intrablock.go +++ b/cryptfs/intrablock.go @@ -3,14 +3,14 @@ package cryptfs // intraBlock identifies a part of a file block type intraBlock struct { BlockNo uint64 // Block number in file - Offset uint64 // Offset into block plaintext + Skip uint64 // Offset into block plaintext Length uint64 // Length of data from this block fs *CryptFS } // isPartial - is the block partial? This means we have to do read-modify-write. func (ib *intraBlock) IsPartial() bool { - if ib.Offset > 0 || ib.Length < ib.fs.plainBS { + if ib.Skip > 0 || ib.Length < ib.fs.plainBS { return true } return false @@ -31,9 +31,9 @@ func (ib *intraBlock) PlaintextRange() (offset uint64, length uint64) { // CropBlock - crop a potentially larger plaintext block down to the relevant part func (ib *intraBlock) CropBlock(d []byte) []byte{ lenHave := len(d) - lenWant := int(ib.Offset+ib.Length) + lenWant := int(ib.Skip+ib.Length) if lenHave < lenWant { - return d[ib.Offset:lenHave] + return d[ib.Skip:lenHave] } - return d[ib.Offset:lenWant] + return d[ib.Skip:lenWant] } |