diff --git a/weed/filesys/page_writer.go b/weed/filesys/page_writer.go index 02b5f1f35..1547bce26 100644 --- a/weed/filesys/page_writer.go +++ b/weed/filesys/page_writer.go @@ -84,7 +84,7 @@ func (pw *PageWriter) ReadDirtyDataAt(data []byte, offset int64) (maxStop int64) data = data[readSize:] } - checkByteZero("page writer read", p, 0, maxStop-offset) + page_writer.CheckByteZero("page writer read", data, 0, maxStop-offset) return } diff --git a/weed/filesys/page_writer/chunked_file_writer.go b/weed/filesys/page_writer/chunked_file_writer.go index 948547878..73792a00e 100644 --- a/weed/filesys/page_writer/chunked_file_writer.go +++ b/weed/filesys/page_writer/chunked_file_writer.go @@ -73,7 +73,7 @@ func (cw *ChunkedFileWriter) ReadDataAt(p []byte, off int64) (maxStop int64) { glog.Errorf("reading temp file: %v", err) break } - checkByteZero("temp file writer read", p, logicStart-off, logicStop-off) + CheckByteZero("temp file writer read", p, logicStart-off, logicStop-off) maxStop = max(maxStop, logicStop) } } diff --git a/weed/filesys/page_writer/chunked_stream_writer.go b/weed/filesys/page_writer/chunked_stream_writer.go index a38193131..bd3dd4a45 100644 --- a/weed/filesys/page_writer/chunked_stream_writer.go +++ b/weed/filesys/page_writer/chunked_stream_writer.go @@ -81,7 +81,7 @@ func (cw *ChunkedStreamWriter) ReadDataAt(p []byte, off int64) (maxStop int64) { copy(p[logicStart-off:logicStop-off], memChunk.buf[logicStart-memChunkBaseOffset:logicStop-memChunkBaseOffset]) maxStop = max(maxStop, logicStop) - checkByteZero("stream writer read", p, logicStart-off, logicStop-off) + CheckByteZero("stream writer read", p, logicStart-off, logicStop-off) } } diff --git a/weed/filesys/page_writer/debug_content.go b/weed/filesys/page_writer/debug_content.go index 2e5734ced..f6913ed26 100644 --- a/weed/filesys/page_writer/debug_content.go +++ b/weed/filesys/page_writer/debug_content.go @@ -2,7 +2,7 @@ package page_writer import "github.com/chrislusf/seaweedfs/weed/glog" -func checkByteZero(message string, p []byte, start, stop int64) { +func CheckByteZero(message string, p []byte, start, stop int64) { isAllZero := true for i := start; i < stop; i++ { if p[i] != 0 {