aboutsummaryrefslogtreecommitdiff
path: root/include/sqfs
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-09-16 03:00:30 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-09-19 11:45:53 +0200
commit2d01fe534a775dcab61651ef807fc118c579dd3d (patch)
tree188a0e75e971a23a5f4a2dc80d3a56b08a2ea36f /include/sqfs
parent273a5ef517dd6c3f8b795b1dacf40d5a83acbbcc (diff)
libsqfs: Expose the directory reader cache query function
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include/sqfs')
-rw-r--r--include/sqfs/dir_reader.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/sqfs/dir_reader.h b/include/sqfs/dir_reader.h
index 11f7ae0..ceac22b 100644
--- a/include/sqfs/dir_reader.h
+++ b/include/sqfs/dir_reader.h
@@ -253,6 +253,26 @@ SQFS_API int sqfs_dir_reader_get_inode(sqfs_dir_reader_t *rd, sqfs_u64 ref,
SQFS_API int sqfs_dir_reader_get_root_inode(sqfs_dir_reader_t *rd,
sqfs_inode_generic_t **inode);
+/**
+ * @brief Try to lookup a cached inode number
+ *
+ * @memberof sqfs_dir_reader_t
+ *
+ * If the inode reader was created with the @ref SQFS_DIR_READER_DOT_ENTRIES
+ * flag, it maintains an internal cache of all directory inodes that it has
+ * seen while traversing the filesystem. The cache maps inode numbers to
+ * inode references. This is used to lookup the parent inode of directory.
+ * This function can be used to query the cache directly.
+ *
+ * @param rd A pointer to a directory reader.
+ * @param inode An inode number.
+ * @param ref Retrns an inode reference on success.
+ *
+ * @return Zero on success, @ref SQFS_ERROR_NO_ENTRY if the inode is unknown
+ */
+SQFS_API int sqfs_dir_reader_resolve_inum(sqfs_dir_reader_t *rd,
+ sqfs_u32 inode, sqfs_u64 *ref);
+
#ifdef __cplusplus
}
#endif