From 5e7ce8c83dd1ded633b2a1bbeea37cbb53f743f0 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 3 Oct 2019 15:21:35 +0200 Subject: Add a counter-part to sqfs_inode_get_xattr_index Combines all the type depenend attribute setting and inode type promotion into a single function. Signed-off-by: David Oberhollenzer --- include/sqfs/inode.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include') diff --git a/include/sqfs/inode.h b/include/sqfs/inode.h index 8b69b7e..336a394 100644 --- a/include/sqfs/inode.h +++ b/include/sqfs/inode.h @@ -551,6 +551,22 @@ extern "C" { SQFS_API int sqfs_inode_get_xattr_index(const sqfs_inode_generic_t *inode, sqfs_u32 *out); +/** + * @brief Set the extended attribute index of an inode. + * + * For basic inodes, this function promes the inodes to extended inodes if the + * index is not 0xFFFFFFFF. If the index is 0xFFFFFFFF, the function tries to + * demote extended inode to a basic inode after setting the index. + * + * @param inode A pointer to an inode. + * @param index The extended attribute index. + * + * @return Zero on success, an @ref SQFS_ERROR_CORRUPTED if the node has + * an unknown type set. + */ +SQFS_API int sqfs_inode_set_xattr_index(sqfs_inode_generic_t *inode, + sqfs_u32 index); + /** * @brief Convert a basic inode to an extended inode. * -- cgit v1.2.3