Lines Matching refs:data
69 int count, void *data);
71 int count, const void *data);
73 int count, void *data);
75 int count, const void *data);
134 struct test_private_data *data, in test_dump_block() argument
138 FILE *f = data->outfile; in test_dump_block()
155 struct test_private_data *data; in test_abort() local
158 data = (struct test_private_data *) channel->private_data; in test_abort()
159 f = data->outfile; in test_abort()
193 struct test_private_data *data = NULL; in test_open() local
204 retval = ext2fs_get_mem(sizeof(struct test_private_data), &data); in test_open()
213 io->private_data = data; in test_open()
219 memset(data, 0, sizeof(struct test_private_data)); in test_open()
220 data->magic = EXT2_ET_MAGIC_TEST_IO_CHANNEL; in test_open()
223 &data->real); in test_open()
227 data->real = 0; in test_open()
228 data->read_blk = test_io_cb_read_blk; in test_open()
229 data->write_blk = test_io_cb_write_blk; in test_open()
230 data->set_blksize = test_io_cb_set_blksize; in test_open()
231 data->write_byte = test_io_cb_write_byte; in test_open()
232 data->read_blk64 = test_io_cb_read_blk64; in test_open()
233 data->write_blk64 = test_io_cb_write_blk64; in test_open()
235 data->outfile = NULL; in test_open()
237 data->outfile = fopen(value, "w"); in test_open()
238 if (!data->outfile) in test_open()
239 data->outfile = stderr; in test_open()
241 data->flags = 0; in test_open()
243 data->flags = strtoul(value, NULL, 0); in test_open()
245 data->block = 0; in test_open()
247 data->block = strtoul(value, NULL, 0); in test_open()
249 data->read_abort_count = 0; in test_open()
251 data->read_abort_count = strtoul(value, NULL, 0); in test_open()
253 data->write_abort_count = 0; in test_open()
255 data->write_abort_count = strtoul(value, NULL, 0); in test_open()
257 if (data->real) in test_open()
258 io->align = data->real->align; in test_open()
266 if (data) in test_open()
267 ext2fs_free_mem(&data); in test_open()
273 struct test_private_data *data; in test_close() local
277 data = (struct test_private_data *) channel->private_data; in test_close()
278 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL); in test_close()
283 if (data->real) in test_close()
284 retval = io_channel_close(data->real); in test_close()
286 if (data->outfile && data->outfile != stderr) in test_close()
287 fclose(data->outfile); in test_close()
298 struct test_private_data *data; in test_set_blksize() local
302 data = (struct test_private_data *) channel->private_data; in test_set_blksize()
303 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL); in test_set_blksize()
305 if (data->real) { in test_set_blksize()
306 retval = io_channel_set_blksize(data->real, blksize); in test_set_blksize()
307 channel->align = data->real->align; in test_set_blksize()
309 if (data->set_blksize) in test_set_blksize()
310 data->set_blksize(blksize, retval); in test_set_blksize()
311 if (data->flags & TEST_FLAG_SET_BLKSIZE) in test_set_blksize()
312 fprintf(data->outfile, in test_set_blksize()
323 struct test_private_data *data; in test_read_blk() local
327 data = (struct test_private_data *) channel->private_data; in test_read_blk()
328 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL); in test_read_blk()
330 if (data->real) in test_read_blk()
331 retval = io_channel_read_blk(data->real, block, count, buf); in test_read_blk()
332 if (data->read_blk) in test_read_blk()
333 data->read_blk(block, count, retval); in test_read_blk()
334 if (data->flags & TEST_FLAG_READ) in test_read_blk()
335 fprintf(data->outfile, in test_read_blk()
338 if (data->block && data->block == block) { in test_read_blk()
339 if (data->flags & TEST_FLAG_DUMP) in test_read_blk()
340 test_dump_block(channel, data, block, buf); in test_read_blk()
341 if (--data->read_abort_count == 0) in test_read_blk()
350 struct test_private_data *data; in test_write_blk() local
354 data = (struct test_private_data *) channel->private_data; in test_write_blk()
355 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL); in test_write_blk()
357 if (data->real) in test_write_blk()
358 retval = io_channel_write_blk(data->real, block, count, buf); in test_write_blk()
359 if (data->write_blk) in test_write_blk()
360 data->write_blk(block, count, retval); in test_write_blk()
361 if (data->flags & TEST_FLAG_WRITE) in test_write_blk()
362 fprintf(data->outfile, in test_write_blk()
365 if (data->block && data->block == block) { in test_write_blk()
366 if (data->flags & TEST_FLAG_DUMP) in test_write_blk()
367 test_dump_block(channel, data, block, buf); in test_write_blk()
368 if (--data->write_abort_count == 0) in test_write_blk()
377 struct test_private_data *data; in test_read_blk64() local
381 data = (struct test_private_data *) channel->private_data; in test_read_blk64()
382 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL); in test_read_blk64()
384 if (data->real) in test_read_blk64()
385 retval = io_channel_read_blk64(data->real, block, count, buf); in test_read_blk64()
386 if (data->read_blk64) in test_read_blk64()
387 data->read_blk64(block, count, retval); in test_read_blk64()
388 if (data->flags & TEST_FLAG_READ) in test_read_blk64()
389 fprintf(data->outfile, in test_read_blk64()
392 if (data->block && data->block == block) { in test_read_blk64()
393 if (data->flags & TEST_FLAG_DUMP) in test_read_blk64()
394 test_dump_block(channel, data, block, buf); in test_read_blk64()
395 if (--data->read_abort_count == 0) in test_read_blk64()
404 struct test_private_data *data; in test_write_blk64() local
408 data = (struct test_private_data *) channel->private_data; in test_write_blk64()
409 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL); in test_write_blk64()
411 if (data->real) in test_write_blk64()
412 retval = io_channel_write_blk64(data->real, block, count, buf); in test_write_blk64()
413 if (data->write_blk64) in test_write_blk64()
414 data->write_blk64(block, count, retval); in test_write_blk64()
415 if (data->flags & TEST_FLAG_WRITE) in test_write_blk64()
416 fprintf(data->outfile, in test_write_blk64()
419 if (data->block && data->block == block) { in test_write_blk64()
420 if (data->flags & TEST_FLAG_DUMP) in test_write_blk64()
421 test_dump_block(channel, data, block, buf); in test_write_blk64()
422 if (--data->write_abort_count == 0) in test_write_blk64()
431 struct test_private_data *data; in test_write_byte() local
435 data = (struct test_private_data *) channel->private_data; in test_write_byte()
436 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL); in test_write_byte()
438 if (data->real && data->real->manager->write_byte) in test_write_byte()
439 retval = io_channel_write_byte(data->real, offset, count, buf); in test_write_byte()
440 if (data->write_byte) in test_write_byte()
441 data->write_byte(offset, count, retval); in test_write_byte()
442 if (data->flags & TEST_FLAG_WRITE) in test_write_byte()
443 fprintf(data->outfile, in test_write_byte()
454 struct test_private_data *data; in test_flush() local
458 data = (struct test_private_data *) channel->private_data; in test_flush()
459 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL); in test_flush()
461 if (data->real) in test_flush()
462 retval = io_channel_flush(data->real); in test_flush()
464 if (data->flags & TEST_FLAG_FLUSH) in test_flush()
465 fprintf(data->outfile, "Test_io: flush() returned %s\n", in test_flush()
474 struct test_private_data *data; in test_set_option() local
478 data = (struct test_private_data *) channel->private_data; in test_set_option()
479 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL); in test_set_option()
482 if (data->flags & TEST_FLAG_SET_OPTION) in test_set_option()
483 fprintf(data->outfile, "Test_io: set_option(%s, %s) ", in test_set_option()
485 if (data->real && data->real->manager->set_option) { in test_set_option()
486 retval = (data->real->manager->set_option)(data->real, in test_set_option()
488 if (data->flags & TEST_FLAG_SET_OPTION) in test_set_option()
489 fprintf(data->outfile, "returned %s\n", in test_set_option()
492 if (data->flags & TEST_FLAG_SET_OPTION) in test_set_option()
493 fprintf(data->outfile, "not implemented\n"); in test_set_option()
500 struct test_private_data *data; in test_get_stats() local
504 data = (struct test_private_data *) channel->private_data; in test_get_stats()
505 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL); in test_get_stats()
507 if (data->real && data->real->manager->get_stats) { in test_get_stats()
508 retval = (data->real->manager->get_stats)(data->real, stats); in test_get_stats()
516 struct test_private_data *data; in test_discard() local
520 data = (struct test_private_data *) channel->private_data; in test_discard()
521 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL); in test_discard()
523 if (data->real) in test_discard()
524 retval = io_channel_discard(data->real, block, count); in test_discard()
525 if (data->flags & TEST_FLAG_DISCARD) in test_discard()
526 fprintf(data->outfile, in test_discard()