aboutsummaryrefslogtreecommitdiff
path: root/libflash/ffs.h
diff options
context:
space:
mode:
authorCyril Bur <cyril.bur@au1.ibm.com>2017-07-28 16:46:24 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-08-01 13:57:19 +1000
commit7e89bd30e88e838f6602c2a392fa8b2738287541 (patch)
treef4f0f3495ee1969e0c278724f81ef0a3452d7bf0 /libflash/ffs.h
parent523c6ed0f8aaca23cc733e26ff8445ce9bd2b7a9 (diff)
downloadskiboot-7e89bd30e88e838f6602c2a392fa8b2738287541.zip
skiboot-7e89bd30e88e838f6602c2a392fa8b2738287541.tar.gz
skiboot-7e89bd30e88e838f6602c2a392fa8b2738287541.tar.bz2
libflash/libffs: Don't require 'part' size to be known by callers
Currently the FFS header/TOC generation code requires that consumers know the size of their TOC beforehand. While this may be advantageous in some circumstances if there are known limitations of other software. It should not be a requirement. Knowing the size of the FFS header/TOC partially breaks the abstraction since it would require consumers of the library to be aware of/have some idea of the on flash structure and size. Future work may introduce functions to force sizes but the default behaviour should be to calculate it behind the scenes. This patch also addresses an off by one issue in checking for TOC overflow. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Reviewed-by: Samuel Mendoza-Jonas <sam@mendozajonas.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'libflash/ffs.h')
-rw-r--r--libflash/ffs.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/libflash/ffs.h b/libflash/ffs.h
index 6ba7713..1872253 100644
--- a/libflash/ffs.h
+++ b/libflash/ffs.h
@@ -213,6 +213,7 @@ struct ffs_hdr {
uint32_t size;
uint32_t block_size;
uint32_t block_count;
+ struct ffs_entry *part;
struct ffs_entry *backup;
struct ffs_hdr *side;
struct list_head entries;