@@ -856,6 +856,19 @@ int ffs_entry_new(const char *name, uint32_t base, uint32_t size, struct ffs_ent
return 0;
}
+int ffs_entry_set_act_size(struct ffs_entry *ent, uint32_t actual_size)
+{
+ if (!ent)
+ return -1;
+
+ if (actual_size > ent->size)
+ return FFS_ERR_BAD_PART_SIZE;
+
+ ent->actual = actual_size;
+
+ return 0;
+}
+
int ffs_hdr_new(uint32_t block_size, uint32_t block_count, struct ffs_hdr **r)
{
struct ffs_hdr *ret;
@@ -149,6 +149,8 @@ int ffs_entry_new(const char *name, uint32_t base, uint32_t size, struct ffs_ent
int ffs_entry_user_set(struct ffs_entry *ent, struct ffs_entry_user *user);
+int ffs_entry_set_act_size(struct ffs_entry *ent, uint32_t actual_size);
+
int ffs_entry_add(struct ffs_hdr *hdr, struct ffs_entry *entry, unsigned int side);
struct ffs_entry_user ffs_entry_user_get(struct ffs_entry *ent);
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> --- libflash/libffs.c | 13 +++++++++++++ libflash/libffs.h | 2 ++ 2 files changed, 15 insertions(+)