diff options
Diffstat (limited to 'lib/ext2fs/io_manager.c')
-rw-r--r-- | lib/ext2fs/io_manager.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/ext2fs/io_manager.c b/lib/ext2fs/io_manager.c index 25df59ec..34e48592 100644 --- a/lib/ext2fs/io_manager.c +++ b/lib/ext2fs/io_manager.c @@ -111,3 +111,20 @@ errcode_t io_channel_discard(io_channel channel, unsigned long long block, return EXT2_ET_UNIMPLEMENTED; } + +errcode_t io_channel_alloc_buf(io_channel io, int count, void *ptr) +{ + size_t size; + + if (count == 0) + size = io->block_size; + else if (count > 0) + size = io->block_size * count; + else + size = -count; + + if (io->align) + return ext2fs_get_memalign(size, io->align, ptr); + else + return ext2fs_get_mem(size, ptr); +} |