diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2020-05-28 20:53:59 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2020-05-29 03:39:57 +0200 |
commit | 179e4848f2e107c288829b699b7f0a2e7af69c41 (patch) | |
tree | 2e0c02e2be5f4cc3e6bad9eb62cb6692d9d35566 /lib/sqfs | |
parent | 87dd817c4e17b478b08cd6cf9c63c45e695e64f1 (diff) |
cleanup: libsqfs: remove hooks from sqfs_block_writer_t
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs')
-rw-r--r-- | lib/sqfs/block_writer.c | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/lib/sqfs/block_writer.c b/lib/sqfs/block_writer.c index c9d1fc1..b819b58 100644 --- a/lib/sqfs/block_writer.c +++ b/lib/sqfs/block_writer.c @@ -36,9 +36,6 @@ struct sqfs_block_writer_t { sqfs_block_writer_stats_t stats; - const sqfs_block_hooks_t *hooks; - void *user_ptr; - sqfs_u64 data_area_start; sqfs_u64 start; @@ -105,9 +102,6 @@ static int align_file(sqfs_block_writer_t *wr) if (padding == 0) return SQFS_ERROR_ALLOC; - if (wr->hooks != NULL && wr->hooks->prepare_padding != NULL) - wr->hooks->prepare_padding(wr->user_ptr, padding, diff); - ret = wr->file->write_at(wr->file, size, padding, diff); free(padding); if (ret) @@ -150,17 +144,6 @@ sqfs_block_writer_t *sqfs_block_writer_create(sqfs_file_t *file, return wr; } -int sqfs_block_writer_set_hooks(sqfs_block_writer_t *wr, void *user_ptr, - const sqfs_block_hooks_t *hooks) -{ - if (hooks->size != sizeof(*hooks)) - return SQFS_ERROR_UNSUPPORTED; - - wr->hooks = hooks; - wr->user_ptr = user_ptr; - return 0; -} - int sqfs_block_writer_write(sqfs_block_writer_t *wr, sqfs_u32 size, sqfs_u32 checksum, sqfs_u32 flags, const sqfs_u8 *data, sqfs_u64 *location) @@ -170,16 +153,6 @@ int sqfs_block_writer_write(sqfs_block_writer_t *wr, sqfs_u32 size, sqfs_u32 out; int err; - if (wr->hooks != NULL && wr->hooks->pre_block_write != NULL) { - out = flags; - flags &= ~SQFS_BLK_USER_SETTABLE_FLAGS; - - wr->hooks->pre_block_write(wr->user_ptr, &out, size, - data, wr->file); - - flags |= out & SQFS_BLK_USER_SETTABLE_FLAGS; - } - if (flags & SQFS_BLK_FIRST_BLOCK) { wr->start = wr->file->get_size(wr->file); wr->file_start = wr->num_blocks; @@ -213,11 +186,6 @@ int sqfs_block_writer_write(sqfs_block_writer_t *wr, sqfs_u32 size, wr->stats.bytes_written = offset + size - wr->data_area_start; } - if (wr->hooks != NULL && wr->hooks->post_block_write != NULL) { - wr->hooks->post_block_write(wr->user_ptr, flags, size, data, - wr->file); - } - if (flags & SQFS_BLK_LAST_BLOCK) { if (flags & SQFS_BLK_ALIGN) { err = align_file(wr); |