summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-05 17:10:33 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-05 17:12:04 +0200
commitdd5d7adaa914982e8947bfe76fa3f195ed11cdb1 (patch)
tree541325774fa90814fbef1e9f9c5677c8330ef8c1 /lib
parentd5f89c52d219332c48a46aa297bb4896e8c159aa (diff)
Cleanup: add sqfs_* prefix to meta writer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib')
-rw-r--r--lib/sqfs/dir_writer.c26
-rw-r--r--lib/sqfs/meta_writer.c27
-rw-r--r--lib/sqfs/write_inode.c41
-rw-r--r--lib/sqfs/write_table.c14
-rw-r--r--lib/sqfshelper/serialize_fstree.c24
-rw-r--r--lib/sqfshelper/write_xattr.c50
6 files changed, 96 insertions, 86 deletions
diff --git a/lib/sqfs/dir_writer.c b/lib/sqfs/dir_writer.c
index 3ef3bc7..2fb655a 100644
--- a/lib/sqfs/dir_writer.c
+++ b/lib/sqfs/dir_writer.c
@@ -43,7 +43,7 @@ struct sqfs_dir_writer_t {
uint64_t dir_ref;
size_t dir_size;
size_t idx_size;
- meta_writer_t *dm;
+ sqfs_meta_writer_t *dm;
};
static int get_type(mode_t mode)
@@ -85,7 +85,7 @@ static void writer_reset(sqfs_dir_writer_t *writer)
writer->idx_size = 0;
}
-sqfs_dir_writer_t *sqfs_dir_writer_create(meta_writer_t *dm)
+sqfs_dir_writer_t *sqfs_dir_writer_create(sqfs_meta_writer_t *dm)
{
sqfs_dir_writer_t *writer = calloc(1, sizeof(*writer));
@@ -111,7 +111,7 @@ int sqfs_dir_writer_begin(sqfs_dir_writer_t *writer)
writer_reset(writer);
- meta_writer_get_position(writer->dm, &block, &offset);
+ sqfs_meta_writer_get_position(writer->dm, &block, &offset);
writer->dir_ref = (block << 16) | offset;
return 0;
}
@@ -185,7 +185,7 @@ static int add_header(sqfs_dir_writer_t *writer, size_t count,
hdr.start_block = htole32(ref->inode_ref >> 16);
hdr.inode_number = htole32(ref->inode_num);
- if (meta_writer_append(writer->dm, &hdr, sizeof(hdr)))
+ if (sqfs_meta_writer_append(writer->dm, &hdr, sizeof(hdr)))
return -1;
idx = calloc(1, sizeof(*idx));
@@ -220,7 +220,7 @@ int sqfs_dir_writer_end(sqfs_dir_writer_t *writer)
uint64_t block;
for (it = writer->list; it != NULL; ) {
- meta_writer_get_position(writer->dm, &block, &offset);
+ sqfs_meta_writer_get_position(writer->dm, &block, &offset);
count = get_conseq_entry_count(offset, it);
if (add_header(writer, count, it, block))
@@ -237,11 +237,15 @@ int sqfs_dir_writer_end(sqfs_dir_writer_t *writer)
diff_u16 = (uint16_t *)&ent.inode_diff;
*diff_u16 = htole16(*diff_u16);
- if (meta_writer_append(writer->dm, &ent, sizeof(ent)))
+ if (sqfs_meta_writer_append(writer->dm, &ent,
+ sizeof(ent))) {
return -1;
+ }
- if (meta_writer_append(writer->dm, it->name, it->name_len))
+ if (sqfs_meta_writer_append(writer->dm, it->name,
+ it->name_len)) {
return -1;
+ }
it = it->next;
}
@@ -266,7 +270,7 @@ size_t sqfs_dir_writer_get_index_size(sqfs_dir_writer_t *writer)
}
int sqfs_dir_writer_write_index(sqfs_dir_writer_t *writer,
- meta_writer_t *im)
+ sqfs_meta_writer_t *im)
{
sqfs_dir_index_t ent;
index_ent_t *idx;
@@ -276,11 +280,13 @@ int sqfs_dir_writer_write_index(sqfs_dir_writer_t *writer,
ent.index = htole32(idx->index);
ent.size = htole32(idx->ent->name_len - 1);
- if (meta_writer_append(im, &ent, sizeof(ent)))
+ if (sqfs_meta_writer_append(im, &ent, sizeof(ent)))
return -1;
- if (meta_writer_append(im, idx->ent->name, idx->ent->name_len))
+ if (sqfs_meta_writer_append(im, idx->ent->name,
+ idx->ent->name_len)) {
return -1;
+ }
}
return 0;
diff --git a/lib/sqfs/meta_writer.c b/lib/sqfs/meta_writer.c
index 1f7825a..c85a12e 100644
--- a/lib/sqfs/meta_writer.c
+++ b/lib/sqfs/meta_writer.c
@@ -22,7 +22,7 @@ typedef struct meta_block_t {
uint8_t data[SQFS_META_BLOCK_SIZE + 2];
} meta_block_t;
-struct meta_writer_t {
+struct sqfs_meta_writer_t {
/* A byte offset into the uncompressed data of the current block */
size_t offset;
@@ -51,9 +51,10 @@ static int write_block(int fd, meta_block_t *outblk)
outblk->data, count + 2);
}
-meta_writer_t *meta_writer_create(int fd, compressor_t *cmp, bool keep_in_mem)
+sqfs_meta_writer_t *sqfs_meta_writer_create(int fd, compressor_t *cmp,
+ bool keep_in_mem)
{
- meta_writer_t *m = calloc(1, sizeof(*m));
+ sqfs_meta_writer_t *m = calloc(1, sizeof(*m));
if (m == NULL) {
perror("creating meta data writer");
@@ -66,7 +67,7 @@ meta_writer_t *meta_writer_create(int fd, compressor_t *cmp, bool keep_in_mem)
return m;
}
-void meta_writer_destroy(meta_writer_t *m)
+void sqfs_meta_writer_destroy(sqfs_meta_writer_t *m)
{
meta_block_t *blk;
@@ -79,7 +80,7 @@ void meta_writer_destroy(meta_writer_t *m)
free(m);
}
-int meta_writer_flush(meta_writer_t *m)
+int sqfs_meta_writer_flush(sqfs_meta_writer_t *m)
{
meta_block_t *outblk;
size_t count;
@@ -129,7 +130,8 @@ int meta_writer_flush(meta_writer_t *m)
return ret;
}
-int meta_writer_append(meta_writer_t *m, const void *data, size_t size)
+int sqfs_meta_writer_append(sqfs_meta_writer_t *m, const void *data,
+ size_t size)
{
size_t diff;
@@ -137,7 +139,7 @@ int meta_writer_append(meta_writer_t *m, const void *data, size_t size)
diff = sizeof(m->data) - m->offset;
if (diff == 0) {
- if (meta_writer_flush(m))
+ if (sqfs_meta_writer_flush(m))
return -1;
diff = sizeof(m->data);
}
@@ -152,25 +154,26 @@ int meta_writer_append(meta_writer_t *m, const void *data, size_t size)
}
if (m->offset == sizeof(m->data))
- return meta_writer_flush(m);
+ return sqfs_meta_writer_flush(m);
return 0;
}
-void meta_writer_get_position(const meta_writer_t *m, uint64_t *block_start,
- uint32_t *offset)
+void sqfs_meta_writer_get_position(const sqfs_meta_writer_t *m,
+ uint64_t *block_start,
+ uint32_t *offset)
{
*block_start = m->block_offset;
*offset = m->offset;
}
-void meta_writer_reset(meta_writer_t *m)
+void sqfs_meta_writer_reset(sqfs_meta_writer_t *m)
{
m->block_offset = 0;
m->offset = 0;
}
-int meta_write_write_to_file(meta_writer_t *m)
+int sqfs_meta_write_write_to_file(sqfs_meta_writer_t *m)
{
meta_block_t *blk;
diff --git a/lib/sqfs/write_inode.c b/lib/sqfs/write_inode.c
index 258f516..408e428 100644
--- a/lib/sqfs/write_inode.c
+++ b/lib/sqfs/write_inode.c
@@ -8,7 +8,7 @@
#include "sqfs/inode.h"
-static int write_block_sizes(meta_writer_t *ir, sqfs_inode_generic_t *n)
+static int write_block_sizes(sqfs_meta_writer_t *ir, sqfs_inode_generic_t *n)
{
uint32_t sizes[n->num_file_blocks];
size_t i;
@@ -16,11 +16,12 @@ static int write_block_sizes(meta_writer_t *ir, sqfs_inode_generic_t *n)
for (i = 0; i < n->num_file_blocks; ++i)
sizes[i] = htole32(n->block_sizes[i]);
- return meta_writer_append(ir, sizes,
- sizeof(uint32_t) * n->num_file_blocks);
+ return sqfs_meta_writer_append(ir, sizes,
+ sizeof(uint32_t) * n->num_file_blocks);
}
-int meta_writer_write_inode(meta_writer_t *ir, sqfs_inode_generic_t *n)
+int sqfs_meta_writer_write_inode(sqfs_meta_writer_t *ir,
+ sqfs_inode_generic_t *n)
{
sqfs_inode_t base;
@@ -31,7 +32,7 @@ int meta_writer_write_inode(meta_writer_t *ir, sqfs_inode_generic_t *n)
base.mod_time = htole32(n->base.mod_time);
base.inode_number = htole32(n->base.inode_number);
- if (meta_writer_append(ir, &base, sizeof(base)))
+ if (sqfs_meta_writer_append(ir, &base, sizeof(base)))
return -1;
switch (n->base.type) {
@@ -43,7 +44,7 @@ int meta_writer_write_inode(meta_writer_t *ir, sqfs_inode_generic_t *n)
.offset = htole16(n->data.dir.offset),
.parent_inode = htole32(n->data.dir.parent_inode),
};
- return meta_writer_append(ir, &dir, sizeof(dir));
+ return sqfs_meta_writer_append(ir, &dir, sizeof(dir));
}
case SQFS_INODE_FILE: {
sqfs_inode_file_t file = {
@@ -53,7 +54,7 @@ int meta_writer_write_inode(meta_writer_t *ir, sqfs_inode_generic_t *n)
htole32(n->data.file.fragment_offset),
.file_size = htole32(n->data.file.file_size),
};
- if (meta_writer_append(ir, &file, sizeof(file)))
+ if (sqfs_meta_writer_append(ir, &file, sizeof(file)))
return -1;
return write_block_sizes(ir, n);
}
@@ -62,10 +63,10 @@ int meta_writer_write_inode(meta_writer_t *ir, sqfs_inode_generic_t *n)
.nlink = htole32(n->data.slink.nlink),
.target_size = htole32(n->data.slink.target_size),
};
- if (meta_writer_append(ir, &slink, sizeof(slink)))
+ if (sqfs_meta_writer_append(ir, &slink, sizeof(slink)))
return -1;
- return meta_writer_append(ir, n->slink_target,
- n->data.slink.target_size);
+ return sqfs_meta_writer_append(ir, n->slink_target,
+ n->data.slink.target_size);
}
case SQFS_INODE_BDEV:
case SQFS_INODE_CDEV: {
@@ -73,14 +74,14 @@ int meta_writer_write_inode(meta_writer_t *ir, sqfs_inode_generic_t *n)
.nlink = htole32(n->data.dev.nlink),
.devno = htole32(n->data.dev.devno),
};
- return meta_writer_append(ir, &dev, sizeof(dev));
+ return sqfs_meta_writer_append(ir, &dev, sizeof(dev));
}
case SQFS_INODE_FIFO:
case SQFS_INODE_SOCKET: {
sqfs_inode_ipc_t ipc = {
.nlink = htole32(n->data.ipc.nlink),
};
- return meta_writer_append(ir, &ipc, sizeof(ipc));
+ return sqfs_meta_writer_append(ir, &ipc, sizeof(ipc));
}
case SQFS_INODE_EXT_DIR: {
sqfs_inode_dir_ext_t dir = {
@@ -92,7 +93,7 @@ int meta_writer_write_inode(meta_writer_t *ir, sqfs_inode_generic_t *n)
.offset = htole16(n->data.dir_ext.offset),
.xattr_idx = htole32(n->data.dir_ext.xattr_idx),
};
- return meta_writer_append(ir, &dir, sizeof(dir));
+ return sqfs_meta_writer_append(ir, &dir, sizeof(dir));
}
case SQFS_INODE_EXT_FILE: {
sqfs_inode_file_ext_t file = {
@@ -105,7 +106,7 @@ int meta_writer_write_inode(meta_writer_t *ir, sqfs_inode_generic_t *n)
htole32(n->data.file_ext.fragment_offset),
.xattr_idx = htole32(n->data.file_ext.xattr_idx),
};
- if (meta_writer_append(ir, &file, sizeof(file)))
+ if (sqfs_meta_writer_append(ir, &file, sizeof(file)))
return -1;
return write_block_sizes(ir, n);
}
@@ -116,13 +117,13 @@ int meta_writer_write_inode(meta_writer_t *ir, sqfs_inode_generic_t *n)
};
uint32_t xattr = htole32(n->data.slink_ext.xattr_idx);
- if (meta_writer_append(ir, &slink, sizeof(slink)))
+ if (sqfs_meta_writer_append(ir, &slink, sizeof(slink)))
return -1;
- if (meta_writer_append(ir, n->slink_target,
- n->data.slink_ext.target_size)) {
+ if (sqfs_meta_writer_append(ir, n->slink_target,
+ n->data.slink_ext.target_size)) {
return -1;
}
- return meta_writer_append(ir, &xattr, sizeof(xattr));
+ return sqfs_meta_writer_append(ir, &xattr, sizeof(xattr));
}
case SQFS_INODE_EXT_BDEV:
case SQFS_INODE_EXT_CDEV: {
@@ -131,7 +132,7 @@ int meta_writer_write_inode(meta_writer_t *ir, sqfs_inode_generic_t *n)
.devno = htole32(n->data.dev_ext.devno),
.xattr_idx = htole32(n->data.dev_ext.xattr_idx),
};
- return meta_writer_append(ir, &dev, sizeof(dev));
+ return sqfs_meta_writer_append(ir, &dev, sizeof(dev));
}
case SQFS_INODE_EXT_FIFO:
case SQFS_INODE_EXT_SOCKET: {
@@ -139,7 +140,7 @@ int meta_writer_write_inode(meta_writer_t *ir, sqfs_inode_generic_t *n)
.nlink = htole32(n->data.ipc_ext.nlink),
.xattr_idx = htole32(n->data.ipc_ext.xattr_idx),
};
- return meta_writer_append(ir, &ipc, sizeof(ipc));
+ return sqfs_meta_writer_append(ir, &ipc, sizeof(ipc));
}
}
diff --git a/lib/sqfs/write_table.c b/lib/sqfs/write_table.c
index a2814a4..7c24087 100644
--- a/lib/sqfs/write_table.c
+++ b/lib/sqfs/write_table.c
@@ -19,7 +19,7 @@ int sqfs_write_table(int outfd, sqfs_super_t *super, compressor_t *cmp,
{
size_t block_count, list_size, diff, blkidx = 0;
uint64_t block, *locations;
- meta_writer_t *m;
+ sqfs_meta_writer_t *m;
uint32_t offset;
int ret = -1;
@@ -35,29 +35,29 @@ int sqfs_write_table(int outfd, sqfs_super_t *super, compressor_t *cmp,
}
/* Write actual data */
- m = meta_writer_create(outfd, cmp, false);
+ m = sqfs_meta_writer_create(outfd, cmp, false);
if (m == NULL)
goto out_idx;
while (table_size > 0) {
- meta_writer_get_position(m, &block, &offset);
+ sqfs_meta_writer_get_position(m, &block, &offset);
locations[blkidx++] = htole64(super->bytes_used + block);
diff = SQFS_META_BLOCK_SIZE;
if (diff > table_size)
diff = table_size;
- if (meta_writer_append(m, data, diff))
+ if (sqfs_meta_writer_append(m, data, diff))
goto out;
data = (const char *)data + diff;
table_size -= diff;
}
- if (meta_writer_flush(m))
+ if (sqfs_meta_writer_flush(m))
goto out;
- meta_writer_get_position(m, &block, &offset);
+ sqfs_meta_writer_get_position(m, &block, &offset);
super->bytes_used += block;
/* write location list */
@@ -72,7 +72,7 @@ int sqfs_write_table(int outfd, sqfs_super_t *super, compressor_t *cmp,
/* cleanup */
ret = 0;
out:
- meta_writer_destroy(m);
+ sqfs_meta_writer_destroy(m);
out_idx:
free(locations);
return ret;
diff --git a/lib/sqfshelper/serialize_fstree.c b/lib/sqfshelper/serialize_fstree.c
index 8e87354..0a574a0 100644
--- a/lib/sqfshelper/serialize_fstree.c
+++ b/lib/sqfshelper/serialize_fstree.c
@@ -45,18 +45,18 @@ int sqfs_serialize_fstree(int outfd, sqfs_super_t *super, fstree_t *fs,
compressor_t *cmp, id_table_t *idtbl)
{
sqfs_inode_generic_t *inode;
+ sqfs_meta_writer_t *im, *dm;
sqfs_dir_writer_t *dirwr;
- meta_writer_t *im, *dm;
uint32_t offset;
uint64_t block;
int ret = -1;
size_t i;
- im = meta_writer_create(outfd, cmp, false);
+ im = sqfs_meta_writer_create(outfd, cmp, false);
if (im == NULL)
return -1;
- dm = meta_writer_create(outfd, cmp, true);
+ dm = sqfs_meta_writer_create(outfd, cmp, true);
if (dm == NULL)
goto out_im;
@@ -79,10 +79,10 @@ int sqfs_serialize_fstree(int outfd, sqfs_super_t *super, fstree_t *fs,
sqfs_dir_writer_get_index_size(dirwr);
}
- meta_writer_get_position(im, &block, &offset);
+ sqfs_meta_writer_get_position(im, &block, &offset);
fs->inode_table[i]->inode_ref = (block << 16) | offset;
- if (meta_writer_write_inode(im, inode)) {
+ if (sqfs_meta_writer_write_inode(im, inode)) {
free(inode);
goto out;
}
@@ -97,31 +97,31 @@ int sqfs_serialize_fstree(int outfd, sqfs_super_t *super, fstree_t *fs,
free(inode);
}
- if (meta_writer_flush(im))
+ if (sqfs_meta_writer_flush(im))
goto out;
- if (meta_writer_flush(dm))
+ if (sqfs_meta_writer_flush(dm))
goto out;
super->root_inode_ref = fs->root->inode_ref;
- meta_writer_get_position(im, &block, &offset);
+ sqfs_meta_writer_get_position(im, &block, &offset);
super->inode_table_start = super->bytes_used;
super->bytes_used += block;
- meta_writer_get_position(dm, &block, &offset);
+ sqfs_meta_writer_get_position(dm, &block, &offset);
super->directory_table_start = super->bytes_used;
super->bytes_used += block;
- if (meta_write_write_to_file(dm))
+ if (sqfs_meta_write_write_to_file(dm))
goto out;
ret = 0;
out:
sqfs_dir_writer_destroy(dirwr);
out_dm:
- meta_writer_destroy(dm);
+ sqfs_meta_writer_destroy(dm);
out_im:
- meta_writer_destroy(im);
+ sqfs_meta_writer_destroy(im);
return ret;
}
diff --git a/lib/sqfshelper/write_xattr.c b/lib/sqfshelper/write_xattr.c
index a84822f..349b41d 100644
--- a/lib/sqfshelper/write_xattr.c
+++ b/lib/sqfshelper/write_xattr.c
@@ -16,8 +16,8 @@
#include <string.h>
#include <stdio.h>
-static int write_key(meta_writer_t *mw, const char *key, tree_xattr_t *xattr,
- bool value_is_ool)
+static int write_key(sqfs_meta_writer_t *mw, const char *key,
+ tree_xattr_t *xattr, bool value_is_ool)
{
sqfs_xattr_entry_t kent;
int type;
@@ -38,49 +38,49 @@ static int write_key(meta_writer_t *mw, const char *key, tree_xattr_t *xattr,
kent.type = htole16(type);
kent.size = htole16(strlen(key));
- if (meta_writer_append(mw, &kent, sizeof(kent)))
+ if (sqfs_meta_writer_append(mw, &kent, sizeof(kent)))
return -1;
- if (meta_writer_append(mw, key, strlen(key)))
+ if (sqfs_meta_writer_append(mw, key, strlen(key)))
return -1;
xattr->size += sizeof(sqfs_xattr_entry_t) + strlen(key);
return 0;
}
-static int write_value(meta_writer_t *mw, const char *value,
+static int write_value(sqfs_meta_writer_t *mw, const char *value,
tree_xattr_t *xattr, uint64_t *value_ref_out)
{
sqfs_xattr_value_t vent;
uint32_t offset;
uint64_t block;
- meta_writer_get_position(mw, &block, &offset);
+ sqfs_meta_writer_get_position(mw, &block, &offset);
*value_ref_out = (block << 16) | (offset & 0xFFFF);
vent.size = htole32(strlen(value));
- if (meta_writer_append(mw, &vent, sizeof(vent)))
+ if (sqfs_meta_writer_append(mw, &vent, sizeof(vent)))
return -1;
- if (meta_writer_append(mw, value, strlen(value)))
+ if (sqfs_meta_writer_append(mw, value, strlen(value)))
return -1;
xattr->size += sizeof(vent) + strlen(value);
return 0;
}
-static int write_value_ool(meta_writer_t *mw, uint64_t location,
+static int write_value_ool(sqfs_meta_writer_t *mw, uint64_t location,
tree_xattr_t *xattr)
{
sqfs_xattr_value_t vent;
uint64_t ref;
vent.size = htole32(sizeof(location));
- if (meta_writer_append(mw, &vent, sizeof(vent)))
+ if (sqfs_meta_writer_append(mw, &vent, sizeof(vent)))
return -1;
ref = htole64(location);
- if (meta_writer_append(mw, &ref, sizeof(ref)))
+ if (sqfs_meta_writer_append(mw, &ref, sizeof(ref)))
return -1;
xattr->size += sizeof(vent) + sizeof(ref);
@@ -112,8 +112,8 @@ static bool should_store_ool(fstree_t *fs, const char *value, size_t index)
return strlen(value) > sizeof(uint64_t);
}
-static int write_kv_pairs(fstree_t *fs, meta_writer_t *mw, tree_xattr_t *xattr,
- uint64_t *ool_locations)
+static int write_kv_pairs(fstree_t *fs, sqfs_meta_writer_t *mw,
+ tree_xattr_t *xattr, uint64_t *ool_locations)
{
uint32_t key_idx, val_idx;
const char *key, *value;
@@ -174,7 +174,7 @@ int write_xattr(int outfd, fstree_t *fs, sqfs_super_t *super,
size_t i = 0, count = 0, blocks;
sqfs_xattr_id_table_t idtbl;
sqfs_xattr_id_t id_ent;
- meta_writer_t *mw;
+ sqfs_meta_writer_t *mw;
tree_xattr_t *it;
uint32_t offset;
@@ -185,7 +185,7 @@ int write_xattr(int outfd, fstree_t *fs, sqfs_super_t *super,
if (ool_locations == NULL)
return -1;
- mw = meta_writer_create(outfd, cmp, false);
+ mw = sqfs_meta_writer_create(outfd, cmp, false);
if (mw == NULL)
goto fail_ool;
@@ -193,7 +193,7 @@ int write_xattr(int outfd, fstree_t *fs, sqfs_super_t *super,
kv_start = super->bytes_used;
for (it = fs->xattr; it != NULL; it = it->next) {
- meta_writer_get_position(mw, &it->block, &it->offset);
+ sqfs_meta_writer_get_position(mw, &it->block, &it->offset);
it->size = 0;
if (write_kv_pairs(fs, mw, it, ool_locations))
@@ -202,11 +202,11 @@ int write_xattr(int outfd, fstree_t *fs, sqfs_super_t *super,
++count;
}
- if (meta_writer_flush(mw))
+ if (sqfs_meta_writer_flush(mw))
goto fail_mw;
- meta_writer_get_position(mw, &block, &offset);
- meta_writer_reset(mw);
+ sqfs_meta_writer_get_position(mw, &block, &offset);
+ sqfs_meta_writer_reset(mw);
super->bytes_used += block;
@@ -232,10 +232,10 @@ int write_xattr(int outfd, fstree_t *fs, sqfs_super_t *super,
id_ent.count = htole32(it->num_attr);
id_ent.size = htole32(it->size);
- if (meta_writer_append(mw, &id_ent, sizeof(id_ent)))
+ if (sqfs_meta_writer_append(mw, &id_ent, sizeof(id_ent)))
goto fail_tbl;
- meta_writer_get_position(mw, &block, &offset);
+ sqfs_meta_writer_get_position(mw, &block, &offset);
if (block != id_start) {
id_start = block;
@@ -243,10 +243,10 @@ int write_xattr(int outfd, fstree_t *fs, sqfs_super_t *super,
}
}
- if (meta_writer_flush(mw))
+ if (sqfs_meta_writer_flush(mw))
goto fail_tbl;
- meta_writer_get_position(mw, &block, &offset);
+ sqfs_meta_writer_get_position(mw, &block, &offset);
super->bytes_used += block;
/* write offset table */
@@ -267,13 +267,13 @@ int write_xattr(int outfd, fstree_t *fs, sqfs_super_t *super,
super->flags &= ~SQFS_FLAG_NO_XATTRS;
free(tbl);
- meta_writer_destroy(mw);
+ sqfs_meta_writer_destroy(mw);
free(ool_locations);
return 0;
fail_tbl:
free(tbl);
fail_mw:
- meta_writer_destroy(mw);
+ sqfs_meta_writer_destroy(mw);
fail_ool:
free(ool_locations);
return -1;