Lines Matching full:data

92 			    struct test_private_data *data,  in test_dump_block()  argument
96 FILE *f = data->outfile; in test_dump_block()
112 * Flush data buffers to disk.
116 struct test_private_data *data; in test_flush() local
120 data = (struct test_private_data *)channel->private_data; in test_flush()
121 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL); in test_flush()
123 if (data->real) in test_flush()
124 retval = io_channel_flush(data->real); in test_flush()
126 if (data->flags & TEST_FLAG_FLUSH) in test_flush()
127 fprintf(data->outfile, "Test_io: flush() returned %s\n", in test_flush()
135 struct test_private_data *data; in test_abort() local
138 data = (struct test_private_data *) channel->private_data; in test_abort()
139 f = data->outfile; in test_abort()
175 struct test_private_data *data = NULL; in test_open() local
186 retval = ext2fs_get_mem(sizeof(struct test_private_data), &data); in test_open()
195 io->private_data = data; in test_open()
201 memset(data, 0, sizeof(struct test_private_data)); in test_open()
202 data->magic = EXT2_ET_MAGIC_TEST_IO_CHANNEL; in test_open()
205 &data->real); in test_open()
209 data->real = 0; in test_open()
211 data->read_blk = test_io_cb_read_blk; in test_open()
212 data->write_blk = test_io_cb_write_blk; in test_open()
213 data->set_blksize = test_io_cb_set_blksize; in test_open()
214 data->write_byte = test_io_cb_write_byte; in test_open()
215 data->read_blk64 = test_io_cb_read_blk64; in test_open()
216 data->write_blk64 = test_io_cb_write_blk64; in test_open()
218 data->outfile = NULL; in test_open()
220 data->outfile = fopen(value, "w"); in test_open()
221 if (!data->outfile) in test_open()
222 data->outfile = stderr; in test_open()
224 data->flags = 0; in test_open()
226 data->flags = strtoul(value, NULL, 0); in test_open()
228 data->block = 0; in test_open()
230 data->block = strtoul(value, NULL, 0); in test_open()
232 data->read_abort_count = 0; in test_open()
234 data->read_abort_count = strtoul(value, NULL, 0); in test_open()
236 data->write_abort_count = 0; in test_open()
238 data->write_abort_count = strtoul(value, NULL, 0); in test_open()
240 if (data->real) in test_open()
241 io->align = data->real->align; in test_open()
249 if (data) in test_open()
250 ext2fs_free_mem(&data); in test_open()
256 struct test_private_data *data; in test_close() local
260 data = (struct test_private_data *) channel->private_data; in test_close()
261 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL); in test_close()
266 if (data->real) in test_close()
267 retval = io_channel_close(data->real); in test_close()
269 if (data->outfile && data->outfile != stderr) in test_close()
270 fclose(data->outfile); in test_close()
281 struct test_private_data *data; in test_set_blksize() local
285 data = (struct test_private_data *) channel->private_data; in test_set_blksize()
286 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL); in test_set_blksize()
288 if (data->real) { in test_set_blksize()
289 retval = io_channel_set_blksize(data->real, blksize); in test_set_blksize()
290 channel->align = data->real->align; in test_set_blksize()
292 if (data->set_blksize) in test_set_blksize()
293 data->set_blksize(blksize, retval); in test_set_blksize()
294 if (data->flags & TEST_FLAG_SET_BLKSIZE) in test_set_blksize()
295 fprintf(data->outfile, in test_set_blksize()
306 struct test_private_data *data; in test_read_blk() local
310 data = (struct test_private_data *) channel->private_data; in test_read_blk()
311 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL); in test_read_blk()
313 if (data->real) in test_read_blk()
314 retval = io_channel_read_blk(data->real, block, count, buf); in test_read_blk()
315 if (data->read_blk) in test_read_blk()
316 data->read_blk(block, count, retval); in test_read_blk()
317 if (data->flags & TEST_FLAG_READ) in test_read_blk()
318 fprintf(data->outfile, in test_read_blk()
321 if (data->block && data->block == block) { in test_read_blk()
322 if (data->flags & TEST_FLAG_DUMP) in test_read_blk()
323 test_dump_block(channel, data, block, buf); in test_read_blk()
324 if (--data->read_abort_count == 0) in test_read_blk()
333 struct test_private_data *data; in test_write_blk() local
337 data = (struct test_private_data *) channel->private_data; in test_write_blk()
338 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL); in test_write_blk()
340 if (data->real) in test_write_blk()
341 retval = io_channel_write_blk(data->real, block, count, buf); in test_write_blk()
342 if (data->write_blk) in test_write_blk()
343 data->write_blk(block, count, retval); in test_write_blk()
344 if (data->flags & TEST_FLAG_WRITE) in test_write_blk()
345 fprintf(data->outfile, in test_write_blk()
348 if (data->block && data->block == block) { in test_write_blk()
349 if (data->flags & TEST_FLAG_DUMP) in test_write_blk()
350 test_dump_block(channel, data, block, buf); in test_write_blk()
351 if (--data->write_abort_count == 0) in test_write_blk()
360 struct test_private_data *data; in test_read_blk64() local
364 data = (struct test_private_data *) channel->private_data; in test_read_blk64()
365 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL); in test_read_blk64()
367 if (data->real) in test_read_blk64()
368 retval = io_channel_read_blk64(data->real, block, count, buf); in test_read_blk64()
369 if (data->read_blk64) in test_read_blk64()
370 data->read_blk64(block, count, retval); in test_read_blk64()
371 if (data->flags & TEST_FLAG_READ) in test_read_blk64()
372 fprintf(data->outfile, in test_read_blk64()
375 if (data->block && data->block == block) { in test_read_blk64()
376 if (data->flags & TEST_FLAG_DUMP) in test_read_blk64()
377 test_dump_block(channel, data, block, buf); in test_read_blk64()
378 if (--data->read_abort_count == 0) in test_read_blk64()
387 struct test_private_data *data; in test_write_blk64() local
391 data = (struct test_private_data *) channel->private_data; in test_write_blk64()
392 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL); in test_write_blk64()
394 if (data->real) in test_write_blk64()
395 retval = io_channel_write_blk64(data->real, block, count, buf); in test_write_blk64()
396 if (data->write_blk64) in test_write_blk64()
397 data->write_blk64(block, count, retval); in test_write_blk64()
398 if (data->flags & TEST_FLAG_WRITE) in test_write_blk64()
399 fprintf(data->outfile, in test_write_blk64()
402 if (data->block && data->block == block) { in test_write_blk64()
403 if (data->flags & TEST_FLAG_DUMP) in test_write_blk64()
404 test_dump_block(channel, data, block, buf); in test_write_blk64()
405 if (--data->write_abort_count == 0) in test_write_blk64()
414 struct test_private_data *data; in test_write_byte() local
418 data = (struct test_private_data *) channel->private_data; in test_write_byte()
419 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL); in test_write_byte()
421 if (data->real && data->real->manager->write_byte) in test_write_byte()
422 retval = io_channel_write_byte(data->real, offset, count, buf); in test_write_byte()
423 if (data->write_byte) in test_write_byte()
424 data->write_byte(offset, count, retval); in test_write_byte()
425 if (data->flags & TEST_FLAG_WRITE) in test_write_byte()
426 fprintf(data->outfile, in test_write_byte()
435 struct test_private_data *data; in test_set_option() local
439 data = (struct test_private_data *) channel->private_data; in test_set_option()
440 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL); in test_set_option()
443 if (data->flags & TEST_FLAG_SET_OPTION) in test_set_option()
444 fprintf(data->outfile, "Test_io: set_option(%s, %s) ", in test_set_option()
446 if (data->real && data->real->manager->set_option) { in test_set_option()
447 retval = (data->real->manager->set_option)(data->real, in test_set_option()
449 if (data->flags & TEST_FLAG_SET_OPTION) in test_set_option()
450 fprintf(data->outfile, "returned %s\n", in test_set_option()
453 if (data->flags & TEST_FLAG_SET_OPTION) in test_set_option()
454 fprintf(data->outfile, "not implemented\n"); in test_set_option()
461 struct test_private_data *data; in test_get_stats() local
465 data = (struct test_private_data *) channel->private_data; in test_get_stats()
466 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL); in test_get_stats()
468 if (data->real && data->real->manager->get_stats) { in test_get_stats()
469 retval = (data->real->manager->get_stats)(data->real, stats); in test_get_stats()
477 struct test_private_data *data; in test_discard() local
481 data = (struct test_private_data *) channel->private_data; in test_discard()
482 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL); in test_discard()
484 if (data->real) in test_discard()
485 retval = io_channel_discard(data->real, block, count); in test_discard()
486 if (data->flags & TEST_FLAG_DISCARD) in test_discard()
487 fprintf(data->outfile, in test_discard()
497 struct test_private_data *data; in test_cache_readahead() local
501 data = (struct test_private_data *) channel->private_data; in test_cache_readahead()
502 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL); in test_cache_readahead()
504 if (data->real) in test_cache_readahead()
505 retval = io_channel_cache_readahead(data->real, block, count); in test_cache_readahead()
506 if (data->flags & TEST_FLAG_READAHEAD) in test_cache_readahead()
507 fprintf(data->outfile, in test_cache_readahead()
516 struct test_private_data *data; in test_zeroout() local
520 data = (struct test_private_data *) channel->private_data; in test_zeroout()
521 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL); in test_zeroout()
523 if (data->real) in test_zeroout()
524 retval = io_channel_zeroout(data->real, block, count); in test_zeroout()
525 if (data->flags & TEST_FLAG_ZEROOUT) in test_zeroout()
526 fprintf(data->outfile, in test_zeroout()