Skip to content

Commit

Permalink
Update explanation on directory index accounting
Browse files Browse the repository at this point in the history
Tests with the Debian image (which is generated with squashfs-tools,
so should be interpreted as ground truth) have showed that the count
is not stored off-by-one. The code was already doing the right thing,
but the documentation was wrong.

Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
  • Loading branch information
AgentD committed Jan 19, 2020
1 parent 1a4af49 commit e658852
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions doc/format.txt
Expand Up @@ -662,8 +662,8 @@
+------+--------------+------------------------------------------------------+
| u32 | parent inode | Same as above. |
+------+--------------+------------------------------------------------------+
| u16 | index count | One less than the number of directory index entries |
| | | following the inode structure. |
| u16 | index count | The number of directory index entries following the |
| | | inode structure. |
+------+--------------+------------------------------------------------------+
| u16 | block offset | Same as above. |
+------+--------------+------------------------------------------------------+
Expand Down
4 changes: 2 additions & 2 deletions include/sqfs/inode.h
Expand Up @@ -447,8 +447,8 @@ struct sqfs_inode_dir_ext_t {
/**
* @brief Number of directory index entries following the inode
*
* This number is stored off-by one and counts the number of
* @ref sqfs_dir_index_t entries following the inode.
* This number counts the number of @ref sqfs_dir_index_t entries
* following the inode.
*/
sqfs_u16 inodex_count;

Expand Down

0 comments on commit e658852

Please sign in to comment.