Skip to content

Commit

Permalink
add support for ZERO type
Browse files Browse the repository at this point in the history
  • Loading branch information
vm03 committed Oct 16, 2019
1 parent 00aada1 commit 7097a07
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions payload_dumper.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ def data_for_op(op,out_file,old_file):
data = tmp_buff.read(ext.num_blocks*block_size)
out_file.seek(ext.start_block*block_size)
out_file.write(data)
elif op.type == op.ZERO:
for ext in op.dst_extents:
out_file.seek(ext.start_block*block_size)
out_file.write('\0' * ext.num_blocks*block_size)
else:
print ("Unsupported type = %d" % op.type)
sys.exit(-1)
Expand Down

0 comments on commit 7097a07

Please sign in to comment.