aboutsummaryrefslogtreecommitdiff
path: root/include/sqfs
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-03-04 01:09:18 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-03-04 01:09:18 +0100
commit74b739ac61fb49f93a8ce814a37026bf1d405466 (patch)
tree5f05446ed9081db38bbbd36ed9f3681a15686dd6 /include/sqfs
parent44c81eeffe9c8820b1009a7a5c728782aa5ebf40 (diff)
Cleanup: match xattr reader API closer to id table API
Instead of creating everything in the "create" function, cleanup and create/initialize stuff in a "load" function. This allows the xattr reader to be reset/re-used and adds the benefit of not having to lug around references to the super block, compressor and file (altough the later two are hidden inside the meta reader). Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include/sqfs')
-rw-r--r--include/sqfs/xattr_reader.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/include/sqfs/xattr_reader.h b/include/sqfs/xattr_reader.h
index 7912de4..54ffc12 100644
--- a/include/sqfs/xattr_reader.h
+++ b/include/sqfs/xattr_reader.h
@@ -83,18 +83,12 @@ extern "C" {
* Do not destroy any of the pointed to objects before destroying the xattr
* reader.
*
- * @param file A pointer to a file object that contains the SquashFS filesystem
- * @param super A pointer to the SquashFS super block required to find the
- * location tables.
- * @param cmp A pointer to a compressor used to uncompress the loaded meta data
- * blocks.
+ * @param flags Currently must be set to 0, or creation will fail.
*
* @return A pointer to a new xattr reader instance on success, NULL on
* allocation failure.
*/
-SQFS_API sqfs_xattr_reader_t *sqfs_xattr_reader_create(sqfs_file_t *file,
- sqfs_super_t *super,
- sqfs_compressor_t *cmp);
+SQFS_API sqfs_xattr_reader_t *sqfs_xattr_reader_create(sqfs_u32 flags);
/**
* @brief Load the locations of the xattr meta data blocks into memory
@@ -104,9 +98,18 @@ SQFS_API sqfs_xattr_reader_t *sqfs_xattr_reader_create(sqfs_file_t *file,
* This function must be called explicitly after an xattr reader has been
* created to load the actual location table from disk.
*
+ * @param xr A pointer to an xattr reader instance.
+ * @param super A pointer to the SquashFS super block required to find the
+ * location tables.
+ * @param file A pointer to a file object that contains the SquashFS filesystem.
+ * @param cmp A pointer to a compressor used to uncompress the loaded meta data
+ * blocks.
+ *
* @return Zero on success, a negative @ref E_SQFS_ERROR value on failure.
*/
-SQFS_API int sqfs_xattr_reader_load_locations(sqfs_xattr_reader_t *xr);
+SQFS_API int sqfs_xattr_reader_load(sqfs_xattr_reader_t *xr,
+ const sqfs_super_t *super,
+ sqfs_file_t *file, sqfs_compressor_t *cmp);
/**
* @brief Resolve an xattr index from an inode to an xattr description