diff options
Diffstat (limited to 'src/commonlib/bsd/include')
-rw-r--r-- | src/commonlib/bsd/include/commonlib/bsd/cb_err.h | 3 | ||||
-rw-r--r-- | src/commonlib/bsd/include/commonlib/bsd/cbfs_private.h | 24 |
2 files changed, 12 insertions, 15 deletions
diff --git a/src/commonlib/bsd/include/commonlib/bsd/cb_err.h b/src/commonlib/bsd/include/commonlib/bsd/cb_err.h index b61b956524..eec44f2f1c 100644 --- a/src/commonlib/bsd/include/commonlib/bsd/cb_err.h +++ b/src/commonlib/bsd/include/commonlib/bsd/cb_err.h @@ -42,7 +42,4 @@ enum cb_err { CB_CBFS_CACHE_FULL = -403, /**< Metadata cache overflowed */ }; -/* Don't typedef the enum directly, so the size is unambiguous for serialization. */ -typedef int32_t cb_err_t; - #endif /* _COMMONLIB_BSD_CB_ERR_H_ */ diff --git a/src/commonlib/bsd/include/commonlib/bsd/cbfs_private.h b/src/commonlib/bsd/include/commonlib/bsd/cbfs_private.h index fc2d0d0457..410bfd62ba 100644 --- a/src/commonlib/bsd/include/commonlib/bsd/cbfs_private.h +++ b/src/commonlib/bsd/include/commonlib/bsd/cbfs_private.h @@ -78,24 +78,24 @@ enum cbfs_walk_flags { * CB_SUCCESS/<other> - First non-CB_CBFS_NOT_FOUND code returned by walker() * CB_CBFS_NOT_FOUND - walker() returned CB_CBFS_NOT_FOUND for every file in the CBFS */ -cb_err_t cbfs_walk(cbfs_dev_t dev, cb_err_t (*walker)(cbfs_dev_t dev, size_t offset, - const union cbfs_mdata *mdata, - size_t already_read, void *arg), - void *arg, struct vb2_hash *metadata_hash, enum cbfs_walk_flags); +enum cb_err cbfs_walk(cbfs_dev_t dev, enum cb_err (*walker)(cbfs_dev_t dev, size_t offset, + const union cbfs_mdata *mdata, + size_t already_read, void *arg), + void *arg, struct vb2_hash *metadata_hash, enum cbfs_walk_flags); /* * Helper function that can be used by a |walker| callback to cbfs_walk() to copy the metadata * of a file into a permanent buffer. Will copy the |already_read| metadata from |src| into * |dst| and load remaining metadata from |dev| as required. */ -cb_err_t cbfs_copy_fill_metadata(union cbfs_mdata *dst, const union cbfs_mdata *src, - size_t already_read, cbfs_dev_t dev, size_t offset); +enum cb_err cbfs_copy_fill_metadata(union cbfs_mdata *dst, const union cbfs_mdata *src, + size_t already_read, cbfs_dev_t dev, size_t offset); /* Find a file named |name| in the CBFS on |dev|. Copy its metadata (including attributes) * into |mdata_out| and pass out the offset to the file data on the CBFS device. * Verify the metadata with |metadata_hash| if provided. */ -cb_err_t cbfs_lookup(cbfs_dev_t dev, const char *name, union cbfs_mdata *mdata_out, - size_t *data_offset_out, struct vb2_hash *metadata_hash); +enum cb_err cbfs_lookup(cbfs_dev_t dev, const char *name, union cbfs_mdata *mdata_out, + size_t *data_offset_out, struct vb2_hash *metadata_hash); /* Both base address and size of CBFS mcaches must be aligned to this value! */ #define CBFS_MCACHE_ALIGNMENT sizeof(uint32_t) /* Largest data type used in CBFS */ @@ -105,15 +105,15 @@ cb_err_t cbfs_lookup(cbfs_dev_t dev, const char *name, union cbfs_mdata *mdata_o * CB_CBFS_CACHE_FULL, the mcache is still valid and can be used, but lookups may return * CB_CBFS_CACHE_FULL for files that didn't fit to indicate that the caller needs to fall back * to cbfs_lookup(). */ -cb_err_t cbfs_mcache_build(cbfs_dev_t dev, void *mcache, size_t mcache_size, - struct vb2_hash *metadata_hash); +enum cb_err cbfs_mcache_build(cbfs_dev_t dev, void *mcache, size_t mcache_size, + struct vb2_hash *metadata_hash); /* * Find a file named |name| in a CBFS metadata cache and copy its metadata into |mdata_out|. * Pass out offset to the file data (on the original CBFS device used for cbfs_mcache_build()). */ -cb_err_t cbfs_mcache_lookup(const void *mcache, size_t mcache_size, const char *name, - union cbfs_mdata *mdata_out, size_t *data_offset_out); +enum cb_err cbfs_mcache_lookup(const void *mcache, size_t mcache_size, const char *name, + union cbfs_mdata *mdata_out, size_t *data_offset_out); /* Returns the amount of bytes actually used by the CBFS metadata cache in |mcache|. */ size_t cbfs_mcache_real_size(const void *mcache, size_t mcache_size); |