log: return ranges for write / fold; optimize fold when reading at or beyond the head