Commit 27e25ab5 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 5ba6d8c3
......@@ -514,7 +514,7 @@ func (bfdata *BigFileData) Read(_ nodefs.File, dest []byte, off int64, fctx *fus
end := off + int64(len(dest)) // XXX overflow?
aoff := off - (off % zbf.blksize)
aend := end + (zbf.blksize - (end % zbf.blksize))
dest = make([]byte, aend - aoff)
dest = make([]byte, aend - aoff) // ~> [off:aend] in file
// read/load all block(s) in parallel
wg, ctx := errgroup.WithContext(ctx)
......@@ -532,8 +532,7 @@ func (bfdata *BigFileData) Read(_ nodefs.File, dest []byte, off int64, fctx *fus
return nil, fuse.EIO
}
return fuse.ReadResultData(dest[off-aoff:end - (off-aoff)]), fuse.OK
return fuse.ReadResultData(dest[off-aoff:end-aoff]), fuse.OK
}
// readBlk serves Read to read 1 ZBlk #blk into destination buffer.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment