1.1 --- a/libe2access/lib/src/image.c Thu Mar 03 23:40:20 2022 +0100
1.2 +++ b/libe2access/lib/src/image.c Thu Mar 03 23:59:16 2022 +0100
1.3 @@ -318,6 +318,24 @@
1.4 return image_find_by_path(fs, path, ino);
1.5 }
1.6
1.7 +/* Find an object in the given directory with the given inode. */
1.8 +
1.9 +errcode_t image_find_file_by_inode(ext2_filsys fs, ext2_ino_t ino_parent,
1.10 + const char *basename, ext2_ino_t *ino)
1.11 +{
1.12 + char *buf;
1.13 + errcode_t retval = ext2fs_get_mem(fs->blocksize, &buf);
1.14 +
1.15 + if (retval)
1.16 + return retval;
1.17 +
1.18 + retval = ext2fs_lookup(fs, ino_parent, basename, strlen(basename), buf, ino);
1.19 +
1.20 + ext2fs_free_mem(&buf);
1.21 +
1.22 + return retval;
1.23 +}
1.24 +
1.25 /* Obtain the inode for the object with the given path. */
1.26
1.27 errcode_t image_inode(ext2_filsys fs, const char *path,