After trying to compile defrag0.6 and e2fsprogs-1.02.tar.gz, I've noticed
that the (once upon a time) constant EXT2_FIRST_INO has turned into a macro.
This macro is (from linux/ext2_fs.h):
#ifdef __KERNEL__
...[others removed]
#define EXT2_FIRST_INO(s) ((s)->u.ext2_sb.s_first_ino)
#else
...[others removed]
#define EXT2_FIRST_INO(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \
EXT2_GOOD_OLD_FIRST_INO : \
(s)->s_first_ino)
#endif
My question is how to modify ext2_fs.h or the sources of those programs
relying on the old define of EXT2_FIRST_INO?
In the case of e2fsprogs, upgrade to 1.04; the latest version is able to
deal with updated header files (the change happened late in the 1.3
development cycle).
In the case of defrag0.6, the best way to make the change is pass the a
pointer to the ext2 superblock to the EXT2_FIRST_INO macro. This will
allow it to be compatible with future ext2 filesystems where the first
data inode may no longer be located at EXT2_GOOD_OLD_FIRST_INO.
If it's too hard to change the program to do this, the cheap-shot way of
solving the problem is to change uses of EXT2_FIRST_INO to
EXT2_GOOD_OLD_FIRST_INO in the application program. This will of course
have bad effects if you try to use this program on ext2 filesystems in
the future where the first data inode may be different from older
filesystems.
- Ted