From 3a0ee386184093a130d6c61c3eeb1d5a65bdd167 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 20 Jul 2023 08:40:34 +0200 Subject: Add an inode fieled to sqfs_dir_entry_t This might be needed externally for things like hard link detection. For the unix implementation, store the actual inode number here. Signed-off-by: David Oberhollenzer --- include/sqfs/dir_entry.h | 5 +++++ lib/sqfs/src/io/dir_unix.c | 1 + 2 files changed, 6 insertions(+) diff --git a/include/sqfs/dir_entry.h b/include/sqfs/dir_entry.h index cb13f4f..4db13cf 100644 --- a/include/sqfs/dir_entry.h +++ b/include/sqfs/dir_entry.h @@ -68,6 +68,11 @@ struct sqfs_dir_entry_t { */ sqfs_u64 rdev; + /** + * @brief Device and filesystem specific inode number. + */ + sqfs_u64 inode; + /** * @brief ID of the user that owns the entry. */ diff --git a/lib/sqfs/src/io/dir_unix.c b/lib/sqfs/src/io/dir_unix.c index 83127ec..efc9a2a 100644 --- a/lib/sqfs/src/io/dir_unix.c +++ b/lib/sqfs/src/io/dir_unix.c @@ -114,6 +114,7 @@ static int dir_next(sqfs_dir_iterator_t *base, sqfs_dir_entry_t **out) (*out)->rdev = it->sb.st_rdev; (*out)->uid = it->sb.st_uid; (*out)->gid = it->sb.st_gid; + (*out)->inode = it->sb.st_ino; if (S_ISREG(it->sb.st_mode)) (*out)->size = it->sb.st_size; -- cgit v1.2.3