diff options
author | Jakob Unterwurzacher | 2017-04-29 14:50:58 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2017-04-29 14:50:58 +0200 |
commit | edb3e19cb5543c580261052395d461fa47c7cf58 (patch) | |
tree | 293271bda453e8120fe271d2d146a73d852b90ca /internal/fusefrontend/file_allocate_truncate.go | |
parent | 7d38f80a78644c8ec4900cc990bfb894387112ed (diff) |
fix golint complaints
Diffstat (limited to 'internal/fusefrontend/file_allocate_truncate.go')
-rw-r--r-- | internal/fusefrontend/file_allocate_truncate.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/fusefrontend/file_allocate_truncate.go b/internal/fusefrontend/file_allocate_truncate.go index 0e12981..ae3dd41 100644 --- a/internal/fusefrontend/file_allocate_truncate.go +++ b/internal/fusefrontend/file_allocate_truncate.go @@ -187,13 +187,13 @@ func (f *file) truncateGrowFile(oldPlainSz uint64, newPlainSz uint64) fuse.Statu if oldPlainSz > 0 { n1 = f.contentEnc.PlainOffToBlockNo(oldPlainSz - 1) } - newEofOffset := newPlainSz - 1 - n2 := f.contentEnc.PlainOffToBlockNo(newEofOffset) + newEOFOffset := newPlainSz - 1 + n2 := f.contentEnc.PlainOffToBlockNo(newEOFOffset) // The file is grown within one block, no need to pad anything. // Write a single zero to the last byte and let doWrite figure out the RMW. if n1 == n2 { buf := make([]byte, 1) - _, status := f.doWrite(buf, int64(newEofOffset)) + _, status := f.doWrite(buf, int64(newEOFOffset)) return status } // The truncate creates at least one new block. @@ -224,6 +224,6 @@ func (f *file) truncateGrowFile(oldPlainSz uint64, newPlainSz uint64) fuse.Statu // The new size is NOT aligned, so we need to write a partial block. // Write a single zero to the last byte and let doWrite figure it out. buf := make([]byte, 1) - _, status := f.doWrite(buf, int64(newEofOffset)) + _, status := f.doWrite(buf, int64(newEOFOffset)) return status } |