Home | History | Annotate | Download | only in ext2fs

Lines Matching refs:data

63 			       int count, void *data);
65 int count, const void *data);
67 int count, void *data);
69 int count, const void *data);
125 struct test_private_data *data,
129 FILE *f = data->outfile;
146 struct test_private_data *data;
149 data = (struct test_private_data *) channel->private_data;
150 f = data->outfile;
182 struct test_private_data *data = NULL;
193 retval = ext2fs_get_mem(sizeof(struct test_private_data), &data);
204 io->private_data = data;
210 memset(data, 0, sizeof(struct test_private_data));
211 data->magic = EXT2_ET_MAGIC_TEST_IO_CHANNEL;
214 &data->real);
218 data->real = 0;
219 data->read_blk = test_io_cb_read_blk;
220 data->write_blk = test_io_cb_write_blk;
221 data->set_blksize = test_io_cb_set_blksize;
222 data->write_byte = test_io_cb_write_byte;
223 data->read_blk64 = test_io_cb_read_blk64;
224 data->write_blk64 = test_io_cb_write_blk64;
226 data->outfile = NULL;
228 data->outfile = fopen(value, "w");
229 if (!data->outfile)
230 data->outfile = stderr;
232 data->flags = 0;
234 data->flags = strtoul(value, NULL, 0);
236 data->block = 0;
238 data->block = strtoul(value, NULL, 0);
240 data->read_abort_count = 0;
242 data->read_abort_count = strtoul(value, NULL, 0);
244 data->write_abort_count = 0;
246 data->write_abort_count = strtoul(value, NULL, 0);
254 if (data)
255 ext2fs_free_mem(&data);
261 struct test_private_data *data;
265 data = (struct test_private_data *) channel->private_data;
266 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL);
271 if (data->real)
272 retval = io_channel_close(data->real);
274 if (data->outfile && data->outfile != stderr)
275 fclose(data->outfile);
286 struct test_private_data *data;
290 data = (struct test_private_data *) channel->private_data;
291 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL);
293 if (data->real)
294 retval = io_channel_set_blksize(data->real, blksize);
295 if (data->set_blksize)
296 data->set_blksize(blksize, retval);
297 if (data->flags & TEST_FLAG_SET_BLKSIZE)
298 fprintf(data->outfile,
309 struct test_private_data *data;
313 data = (struct test_private_data *) channel->private_data;
314 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL);
316 if (data->real)
317 retval = io_channel_read_blk(data->real, block, count, buf);
318 if (data->read_blk)
319 data->read_blk(block, count, retval);
320 if (data->flags & TEST_FLAG_READ)
321 fprintf(data->outfile,
324 if (data->block && data->block == block) {
325 if (data->flags & TEST_FLAG_DUMP)
326 test_dump_block(channel, data, block, buf);
327 if (--data->read_abort_count == 0)
336 struct test_private_data *data;
340 data = (struct test_private_data *) channel->private_data;
341 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL);
343 if (data->real)
344 retval = io_channel_write_blk(data->real, block, count, buf);
345 if (data->write_blk)
346 data->write_blk(block, count, retval);
347 if (data->flags & TEST_FLAG_WRITE)
348 fprintf(data->outfile,
351 if (data->block && data->block == block) {
352 if (data->flags & TEST_FLAG_DUMP)
353 test_dump_block(channel, data, block, buf);
354 if (--data->write_abort_count == 0)
363 struct test_private_data *data;
367 data = (struct test_private_data *) channel->private_data;
368 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL);
370 if (data->real)
371 retval = io_channel_read_blk64(data->real, block, count, buf);
372 if (data->read_blk64)
373 data->read_blk64(block, count, retval);
374 if (data->flags & TEST_FLAG_READ)
375 fprintf(data->outfile,
378 if (data->block && data->block == block) {
379 if (data->flags & TEST_FLAG_DUMP)
380 test_dump_block(channel, data, block, buf);
381 if (--data->read_abort_count == 0)
390 struct test_private_data *data;
394 data = (struct test_private_data *) channel->private_data;
395 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL);
397 if (data->real)
398 retval = io_channel_write_blk64(data->real, block, count, buf);
399 if (data->write_blk64)
400 data->write_blk64(block, count, retval);
401 if (data->flags & TEST_FLAG_WRITE)
402 fprintf(data->outfile,
405 if (data->block && data->block == block) {
406 if (data->flags & TEST_FLAG_DUMP)
407 test_dump_block(channel, data, block, buf);
408 if (--data->write_abort_count == 0)
417 struct test_private_data *data;
421 data = (struct test_private_data *) channel->private_data;
422 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL);
424 if (data->real && data->real->manager->write_byte)
425 retval = io_channel_write_byte(data->real, offset, count, buf);
426 if (data->write_byte)
427 data->write_byte(offset, count, retval);
428 if (data->flags & TEST_FLAG_WRITE)
429 fprintf(data->outfile,
436 * Flush data buffers to disk.
440 struct test_private_data *data;
444 data = (struct test_private_data *) channel->private_data;
445 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL);
447 if (data->real)
448 retval = io_channel_flush(data->real);
450 if (data->flags & TEST_FLAG_FLUSH)
451 fprintf(data->outfile, "Test_io: flush() returned %s\n",
460 struct test_private_data *data;
464 data = (struct test_private_data *) channel->private_data;
465 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL);
468 if (data->flags & TEST_FLAG_SET_OPTION)
469 fprintf(data->outfile, "Test_io: set_option(%s, %s) ",
471 if (data->real && data->real->manager->set_option) {
472 retval = (data->real->manager->set_option)(data->real,
474 if (data->flags & TEST_FLAG_SET_OPTION)
475 fprintf(data->outfile, "returned %s\n",
478 if (data->flags & TEST_FLAG_SET_OPTION)
479 fprintf(data->outfile, "not implemented\n");
486 struct test_private_data *data;
490 data = (struct test_private_data *) channel->private_data;
491 EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL);
493 if (data->real && data->real->manager->get_stats) {
494 retval = (data->real->manager->get_stats)(data->real, stats);