i_ino[0] is a unique inode serial number in the erofs filesystem to
count inodes one by one, while i_ino[1] is a unique number identifying
the source inode in the source directory, which is usually derived from
st->st_ino.
Read on-disk ino and store it in i_ino[0] given the above background.
Fixes: 5e35b75ad499 ("erofs-utils: introduce fuse implementation")
Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
Link: https://lore.kernel.org/r/20230816021347.126886-4-jefflexu@linux.alibaba.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
die = (struct erofs_inode_extended *)buf;
vi->xattr_isize = erofs_xattr_ibody_size(die->i_xattr_icount);
vi->i_mode = le16_to_cpu(die->i_mode);
+ vi->i_ino[0] = le32_to_cpu(die->i_ino);
switch (vi->i_mode & S_IFMT) {
case S_IFREG:
vi->inode_isize = sizeof(struct erofs_inode_compact);
vi->xattr_isize = erofs_xattr_ibody_size(dic->i_xattr_icount);
vi->i_mode = le16_to_cpu(dic->i_mode);
+ vi->i_ino[0] = le32_to_cpu(dic->i_ino);
switch (vi->i_mode & S_IFMT) {
case S_IFREG: