1.1 --- a/libe2access/lib/src/image.c Thu Feb 17 19:42:31 2022 +0100
1.2 +++ b/libe2access/lib/src/image.c Thu Feb 17 22:12:53 2022 +0100
1.3 @@ -378,7 +378,7 @@
1.4 return retval;
1.5 }
1.6
1.7 - if (!_image_isdir(fs, ino))
1.8 + if (!image_isdir_by_inode(fs, ino))
1.9 return 1;
1.10
1.11 /* List the directory contents. */
1.12 @@ -487,7 +487,7 @@
1.13 struct ext2_inode_large inode;
1.14 ext2_ino_t ino_parent = 0;
1.15 errcode_t retval;
1.16 - int isdir = _image_isdir(fs, ino);
1.17 + int isdir = image_isdir_by_inode(fs, ino);
1.18
1.19 if (isdir)
1.20 {
1.21 @@ -585,7 +585,7 @@
1.22 if (retval)
1.23 return retval;
1.24
1.25 - if (_image_isdir(fs, source))
1.26 + if (image_isdir_by_inode(fs, source))
1.27 {
1.28 /* Update the link count for the target. */
1.29
1.30 @@ -713,14 +713,14 @@
1.31
1.32 /* Test object presence and types in the filesystem image. */
1.33
1.34 -int image_exists(ext2_filsys fs, const char *name)
1.35 +int image_exists(ext2_filsys fs, const char *path)
1.36 {
1.37 ext2_ino_t ino;
1.38
1.39 - return !image_find_by_path(fs, name, &ino);
1.40 + return !image_find_by_path(fs, path, &ino);
1.41 }
1.42
1.43 -int _image_isdir(ext2_filsys fs, ext2_ino_t ino)
1.44 +int image_isdir_by_inode(ext2_filsys fs, ext2_ino_t ino)
1.45 {
1.46 struct ext2_inode inode;
1.47
1.48 @@ -730,22 +730,17 @@
1.49 return LINUX_S_ISDIR(inode.i_mode);
1.50 }
1.51
1.52 -int image_isdir(ext2_filsys fs, const char *name)
1.53 +int image_isdir_by_path(ext2_filsys fs, const char *path)
1.54 {
1.55 ext2_ino_t ino;
1.56
1.57 - return image_isdir_by_path(fs, name, &ino);
1.58 + if (image_find_by_path(fs, path, &ino))
1.59 + return 0;
1.60 +
1.61 + return image_isdir_by_inode(fs, ino);
1.62 }
1.63
1.64 -int image_isdir_by_path(ext2_filsys fs, const char *name, ext2_ino_t *ino)
1.65 -{
1.66 - if (image_find_by_path(fs, name, ino))
1.67 - return 0;
1.68 -
1.69 - return _image_isdir(fs, *ino);
1.70 -}
1.71 -
1.72 -int _image_isfile(ext2_filsys fs, ext2_ino_t ino)
1.73 +int image_isfile_by_inode(ext2_filsys fs, ext2_ino_t ino)
1.74 {
1.75 struct ext2_inode inode;
1.76
1.77 @@ -755,19 +750,14 @@
1.78 return LINUX_S_ISREG(inode.i_mode);
1.79 }
1.80
1.81 -int image_isfile(ext2_filsys fs, const char *name)
1.82 +int image_isfile_by_path(ext2_filsys fs, const char *path)
1.83 {
1.84 ext2_ino_t ino;
1.85
1.86 - return image_isfile_by_path(fs, name, &ino);
1.87 -}
1.88 -
1.89 -int image_isfile_by_path(ext2_filsys fs, const char *name, ext2_ino_t *ino)
1.90 -{
1.91 - if (image_find_by_path(fs, name, ino))
1.92 + if (image_find_by_path(fs, path, &ino))
1.93 return 0;
1.94
1.95 - return _image_isfile(fs, *ino);
1.96 + return image_isfile_by_inode(fs, ino);
1.97 }
1.98
1.99 /* vim: tabstop=4 expandtab shiftwidth=4