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_blk(io_channel channel, unsigned long block,
78 static errcode_t undo_write_blk(io_channel channel, unsigned long block,
80 static errcode_t undo_flush(io_channel channel);
81 static errcode_t undo_write_byte(io_channel channel, unsigned long offset,
83 static errcode_t undo_set_option(io_channel channel, const char *option,
135 io_channel channel; in write_file_system_identity() local
139 channel = data->real; in write_file_system_identity()
140 block_size = channel->block_size; in write_file_system_identity()
142 io_channel_set_blksize(channel, SUPERBLOCK_OFFSET); in write_file_system_identity()
143 retval = io_channel_read_blk(channel, 1, -SUPERBLOCK_SIZE, &super); in write_file_system_identity()
170 io_channel_set_blksize(channel, block_size); in write_file_system_identity()
192 static errcode_t undo_write_tdb(io_channel channel, in undo_write_tdb() argument
205 data = (struct undo_private_data *) channel->private_data; in undo_write_tdb()
215 size = channel->block_size; in undo_write_tdb()
220 size = count * channel->block_size; in undo_write_tdb()
228 offset = (block * channel->block_size) + data->offset ; in undo_write_tdb()
253 backing_blk_num = (offset - data->offset) / channel->block_size; in undo_write_tdb()
256 ((offset - data->offset) % channel->block_size); in undo_write_tdb()
265 if ((count % channel->block_size) == 0) in undo_write_tdb()
266 sz = count / channel->block_size; in undo_write_tdb()
286 ((offset - data->offset) % channel->block_size); in undo_write_tdb()
325 static errcode_t undo_io_read_error(io_channel channel ATTR((unused)), in undo_io_read_error()
337 static void undo_err_handler_init(io_channel channel) in undo_err_handler_init() argument
339 channel->read_error = undo_io_read_error; in undo_err_handler_init()
342 static errcode_t undo_open(const char *name, int flags, io_channel *channel) in undo_open() argument
397 *channel = io; in undo_open()
410 static errcode_t undo_close(io_channel channel) in undo_close() argument
415 EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL); in undo_close()
416 data = (struct undo_private_data *) channel->private_data; in undo_close()
419 if (--channel->refcount > 0) in undo_close()
422 retval = write_file_system_identity(channel, data->tdb); in undo_close()
429 ext2fs_free_mem(&channel->private_data); in undo_close()
430 if (channel->name) in undo_close()
431 ext2fs_free_mem(&channel->name); in undo_close()
432 ext2fs_free_mem(&channel); in undo_close()
437 static errcode_t undo_set_blksize(io_channel channel, int blksize) in undo_set_blksize() argument
442 EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL); in undo_set_blksize()
443 data = (struct undo_private_data *) channel->private_data; in undo_set_blksize()
454 channel->block_size = blksize; in undo_set_blksize()
458 static errcode_t undo_read_blk(io_channel channel, unsigned long block, in undo_read_blk() argument
464 EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL); in undo_read_blk()
465 data = (struct undo_private_data *) channel->private_data; in undo_read_blk()
474 static errcode_t undo_write_blk(io_channel channel, unsigned long block, in undo_write_blk() argument
480 EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL); in undo_write_blk()
481 data = (struct undo_private_data *) channel->private_data; in undo_write_blk()
486 retval = undo_write_tdb(channel, block, count); in undo_write_blk()
495 static errcode_t undo_write_byte(io_channel channel, unsigned long offset, in undo_write_byte() argument
503 EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL); in undo_write_byte()
504 data = (struct undo_private_data *) channel->private_data; in undo_write_byte()
508 blk_num = location/channel->block_size; in undo_write_byte()
515 count = (size + (location % channel->block_size) + in undo_write_byte()
516 channel->block_size -1)/channel->block_size; in undo_write_byte()
517 retval = undo_write_tdb(channel, blk_num, count); in undo_write_byte()
529 static errcode_t undo_flush(io_channel channel) in undo_flush() argument
534 EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL); in undo_flush()
535 data = (struct undo_private_data *) channel->private_data; in undo_flush()
544 static errcode_t undo_set_option(io_channel channel, const char *option, in undo_set_option() argument
552 EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL); in undo_set_option()
553 data = (struct undo_private_data *) channel->private_data; in undo_set_option()