Lines Matching refs:channel
73 static errcode_t undo_open(const char *name, int flags, io_channel *channel);
74 static errcode_t undo_close(io_channel channel);
75 static errcode_t undo_set_blksize(io_channel channel, int blksize);
76 static errcode_t undo_read_blk64(io_channel channel, unsigned long long block,
78 static errcode_t undo_write_blk64(io_channel channel, unsigned long long block,
80 static errcode_t undo_read_blk(io_channel channel, unsigned long block,
82 static errcode_t undo_write_blk(io_channel channel, unsigned long block,
84 static errcode_t undo_flush(io_channel channel);
85 static errcode_t undo_write_byte(io_channel channel, unsigned long offset,
87 static errcode_t undo_set_option(io_channel channel, const char *option,
89 static errcode_t undo_get_stats(io_channel channel, io_stats *stats);
143 io_channel channel; in write_file_system_identity() local
147 channel = data->real; in write_file_system_identity()
148 block_size = channel->block_size; in write_file_system_identity()
150 io_channel_set_blksize(channel, SUPERBLOCK_OFFSET); in write_file_system_identity()
151 retval = io_channel_read_blk64(channel, 1, -SUPERBLOCK_SIZE, &super); in write_file_system_identity()
178 io_channel_set_blksize(channel, block_size); in write_file_system_identity()
200 static errcode_t undo_write_tdb(io_channel channel, in undo_write_tdb() argument
213 data = (struct undo_private_data *) channel->private_data; in undo_write_tdb()
223 size = channel->block_size; in undo_write_tdb()
228 size = count * channel->block_size; in undo_write_tdb()
236 offset = (block * channel->block_size) + data->offset ; in undo_write_tdb()
261 backing_blk_num = (offset - data->offset) / channel->block_size; in undo_write_tdb()
264 ((offset - data->offset) % channel->block_size); in undo_write_tdb()
273 if ((count % channel->block_size) == 0) in undo_write_tdb()
274 sz = count / channel->block_size; in undo_write_tdb()
294 ((offset - data->offset) % channel->block_size); in undo_write_tdb()
333 static errcode_t undo_io_read_error(io_channel channel ATTR((unused)), in undo_io_read_error()
345 static void undo_err_handler_init(io_channel channel) in undo_err_handler_init() argument
347 channel->read_error = undo_io_read_error; in undo_err_handler_init()
350 static errcode_t undo_open(const char *name, int flags, io_channel *channel) in undo_open() argument
406 *channel = io; in undo_open()
419 static errcode_t undo_close(io_channel channel) in undo_close() argument
424 EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL); in undo_close()
425 data = (struct undo_private_data *) channel->private_data; in undo_close()
428 if (--channel->refcount > 0) in undo_close()
431 retval = write_file_system_identity(channel, data->tdb); in undo_close()
438 ext2fs_free_mem(&channel->private_data); in undo_close()
439 if (channel->name) in undo_close()
440 ext2fs_free_mem(&channel->name); in undo_close()
441 ext2fs_free_mem(&channel); in undo_close()
446 static errcode_t undo_set_blksize(io_channel channel, int blksize) in undo_set_blksize() argument
451 EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL); in undo_set_blksize()
452 data = (struct undo_private_data *) channel->private_data; in undo_set_blksize()
463 channel->block_size = blksize; in undo_set_blksize()
467 static errcode_t undo_read_blk64(io_channel channel, unsigned long long block, in undo_read_blk64() argument
473 EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL); in undo_read_blk64()
474 data = (struct undo_private_data *) channel->private_data; in undo_read_blk64()
483 static errcode_t undo_read_blk(io_channel channel, unsigned long block, in undo_read_blk() argument
486 return undo_read_blk64(channel, block, count, buf); in undo_read_blk()
489 static errcode_t undo_write_blk64(io_channel channel, unsigned long long block, in undo_write_blk64() argument
495 EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL); in undo_write_blk64()
496 data = (struct undo_private_data *) channel->private_data; in undo_write_blk64()
501 retval = undo_write_tdb(channel, block, count); in undo_write_blk64()
510 static errcode_t undo_write_blk(io_channel channel, unsigned long block, in undo_write_blk() argument
513 return undo_write_blk64(channel, block, count, buf); in undo_write_blk()
516 static errcode_t undo_write_byte(io_channel channel, unsigned long offset, in undo_write_byte() argument
524 EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL); in undo_write_byte()
525 data = (struct undo_private_data *) channel->private_data; in undo_write_byte()
529 blk_num = location/channel->block_size; in undo_write_byte()
536 count = (size + (location % channel->block_size) + in undo_write_byte()
537 channel->block_size -1)/channel->block_size; in undo_write_byte()
538 retval = undo_write_tdb(channel, blk_num, count); in undo_write_byte()
550 static errcode_t undo_flush(io_channel channel) in undo_flush() argument
555 EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL); in undo_flush()
556 data = (struct undo_private_data *) channel->private_data; in undo_flush()
565 static errcode_t undo_set_option(io_channel channel, const char *option, in undo_set_option() argument
573 EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL); in undo_set_option()
574 data = (struct undo_private_data *) channel->private_data; in undo_set_option()
609 static errcode_t undo_get_stats(io_channel channel, io_stats *stats) in undo_get_stats() argument
614 EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL); in undo_get_stats()
615 data = (struct undo_private_data *) channel->private_data; in undo_get_stats()