"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "fsremap/src/io/io_self_test.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.

io_self_test.cc  (fstransform-0.9.3-src):io_self_test.cc  (fstransform-0.9.4)
skipping to change at line 68 skipping to change at line 68
} }
if (is_replaying()) { if (is_replaying()) {
ff_log(FC_ERROR, 0, "resuming job is meaningless for self-test I/O"); ff_log(FC_ERROR, 0, "resuming job is meaningless for self-test I/O");
return -EINVAL; return -EINVAL;
} }
int err = fr_io::open(args); int err = fr_io::open(args);
if (err != 0) if (err != 0)
return err; return err;
/* /*
* block_size_log_2 is a random number in the range [4,16] * block_size_log_2 is a random number in the range [8,16]
* thus block_size is one of 2^4, 2^5 ... 2^15, 2^16 * thus block_size is one of 256, 512, 1024, 2048, 4096, 8192, 16384, 32768,
65536
*/ */
this_block_size_log2 = (ft_uoff) ff_random(12) + 4; this_block_size_log2 = (ft_uoff) ff_random(8) + 8;
/* dev_len is a random number in the range [block_size, 8GB * block_size] */ /* dev_len is a random number in the range [block_size, 1TB * block_size] */
ft_uoff dev_len = (1 + ff_random(1 + 2 * (ft_ull)0xfffffffful)) << this_bloc ft_uoff dev_len_shift = (ft_uoff) ff_random(20);
k_size_log2;
ft_uoff dev_len = (1 + ff_random((ft_ull)1047576)) << (this_block_size_log2
+ dev_len_shift);
dev_length(dev_len); dev_length(dev_len);
loop_file_length(dev_len);
dev_path("<self-test-device>"); dev_path("<self-test-device>");
double pretty_len; double pretty_len;
const char * pretty_label = ff_pretty_size(dev_len, & pretty_len); const char * pretty_label = ff_pretty_size(dev_len, & pretty_len);
ff_log(FC_INFO, 0, "%s%s length is %.2f %sbytes", sim_msg, label[FC_DEVICE], pretty_len, pretty_label); ff_log(FC_INFO, 0, "%s%s length is %.2f %sbytes", sim_msg, label[FC_DEVICE], pretty_len, pretty_label);
return err; return err;
} }
/** close this I/O, including file descriptors to DEVICE, LOOP-FILE and ZERO-FIL E */ /** close this I/O, including file descriptors to DEVICE, LOOP-FILE and ZERO-FIL E */
skipping to change at line 108 skipping to change at line 111
* retrieve LOOP-FILE extents and FREE-SPACE extents and append them into * retrieve LOOP-FILE extents and FREE-SPACE extents and append them into
* the vectors loop_file_extents and free_space_extents. * the vectors loop_file_extents and free_space_extents.
* the vectors will be ordered by extent ->logical. * the vectors will be ordered by extent ->logical.
* *
* return 0 for success, else error (and vectors contents will be UNDEFINED). * return 0 for success, else error (and vectors contents will be UNDEFINED).
* *
* implementation: load extents list from files * implementation: load extents list from files
* (for example they could be the job persistence files) * (for example they could be the job persistence files)
*/ */
int fr_io_self_test::read_extents(fr_vector<ft_uoff> & loop_file_extents, int fr_io_self_test::read_extents(fr_vector<ft_uoff> & loop_file_extents,
fr_vector<ft_uoff> & free_space_extents, fr_vector<ft_uoff> & free_space_extents,
ft_uoff & ret_block_size_bitmask) fr_vector<ft_uoff> & FT_ARG_UNUSED(to_zero_ext
ents),
ft_uoff & ret_block_size_bitmask)
{ {
if (!is_open()) if (!is_open())
return ENOTCONN; // not open! return ENOTCONN; // not open!
ft_uoff dev_len = dev_length(), free_len = ff_random(dev_len >> this_block_s ize_log2) << this_block_size_log2; ft_uoff dev_len = dev_length(), free_len = ff_random(dev_len >> this_block_s ize_log2) << this_block_size_log2;
fr_map<ft_uoff> loop_file_map, free_space_map; fr_map<ft_uoff> loop_file_map, free_space_map;
invent_extents(loop_file_map, dev_len, ret_block_size_bitmask); invent_extents(loop_file_map, dev_len, ret_block_size_bitmask);
invent_extents(free_space_map, free_len, ret_block_size_bitmask); invent_extents(free_space_map, free_len, ret_block_size_bitmask);
 End of changes. 5 change blocks. 
8 lines changed or deleted 14 lines changed or added

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