"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "fsremap/src/tmp_zero.cc" between
fstransform-0.9.3-src.tar.gz and fstransform-0.9.4.tar.gz

About: fstransform is a tool to change a file-system from one format to another, for example from jfs, xfs, or reiser to ext2, ext3, or ext4, in-place and without the need for backup.

tmp_zero.cc  (fstransform-0.9.3-src):tmp_zero.cc  (fstransform-0.9.4)
skipping to change at line 126 skipping to change at line 126
enum { ZERO_BUF_LEN = 1024*1024 }; enum { ZERO_BUF_LEN = 1024*1024 };
char zero_buf[ZERO_BUF_LEN]; char zero_buf[ZERO_BUF_LEN];
memset(zero_buf, '\0', ZERO_BUF_LEN); memset(zero_buf, '\0', ZERO_BUF_LEN);
ft_uoff offset, left, chunk; ft_uoff offset, left, chunk;
for (; iter != end; ++iter) { for (; iter != end; ++iter) {
const fr_map<ft_uoff>::value_type & extent = *iter; const fr_map<ft_uoff>::value_type & extent = *iter;
offset = extent.first.physical << eff_block_size_log2; offset = extent.first.physical << eff_block_size_log2;
left = extent.second.length << eff_block_size_log2; left = extent.second.length << eff_block_size_log2;
if ((err = ff_posix_lseek(dev_fd, offset)) != 0) { if ((err = ff_posix_lseek(dev_fd, offset)) != 0) {
err = ff_log(FC_ERROR, err, "error in device lseek('%s', offset = %"FT_ULL")", args[0], (ft_ull) offset); err = ff_log(FC_ERROR, err, "error in device lseek('%s', offset = %" FT_ULL ")", args[0], (ft_ull) offset);
break; break;
} }
while (left != 0) { while (left != 0) {
chunk = ff_min2<ft_uoff>(left, ZERO_BUF_LEN); chunk = ff_min2<ft_uoff>(left, ZERO_BUF_LEN);
if ((err = ff_posix_write(dev_fd, zero_buf, chunk)) != 0) { if ((err = ff_posix_write(dev_fd, zero_buf, chunk)) != 0) {
err = ff_log(FC_ERROR, err, "error in device write({'%s', of fset = %"FT_ULL"}, zero_buffer, length = %"FT_ULL")", err = ff_log(FC_ERROR, err, "error in device write({'%s', of fset = %" FT_ULL "}, zero_buffer, length = %" FT_ULL ")",
args[0], (ft_ull) offset, (ft_ull) chunk); args[0], (ft_ull) offset, (ft_ull) chunk);
break; break;
} }
left -= chunk; left -= chunk;
} }
} }
} while (0); } while (0);
if (f != NULL) if (f != NULL)
fclose(f); fclose(f);
if (dev_fd >= 0) if (dev_fd >= 0)
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)