diff options
author | Miles Bader <miles@gnu.org> | 1996-08-15 02:23:31 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1996-08-15 02:23:31 +0000 |
commit | 0323aee0f37921a0bc9294fa93d8b5d5aa875ce2 (patch) | |
tree | 946ebbdd7b2366ee26f3f59d9ae482e495facb94 /ext2fs | |
parent | d7f2b3d06e56f236ec9d1948d4d0989deeaa2132 (diff) |
(dino): Dont recalculate INODES_PER_BLOCK here.
(ext2_debug): redefine macro after including ext2_fs.h.
Diffstat (limited to 'ext2fs')
-rw-r--r-- | ext2fs/ext2fs.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ext2fs/ext2fs.h b/ext2fs/ext2fs.h index 80cd3ea6..b84b0446 100644 --- a/ext2fs/ext2fs.h +++ b/ext2fs/ext2fs.h @@ -41,6 +41,17 @@ typedef int8_t __s8; #include "ext2_fs.h" #include "ext2_fs_i.h" +/* If ext2_fs.h defined a debug routine, undef it and use our own. */ +#undef ext2_debug + +#ifdef EXT2FS_DEBUG +extern int ext2_debug_flag; +#define ext2_debug(f, a...) \ + do { if (ext2_debug_flag) printf ("ext2fs: (debug) %s: " f "\n", __FUNCTION__ , ## a); } while (0) +#else +#define ext2_debug(f, a...) (void)0 +#endif + #undef __hurd__ /* Define this if memory objects should not be cached by the kernel. @@ -309,7 +320,6 @@ dino (ino_t inum) unsigned long bg_num = (inum - 1) / inodes_per_group; unsigned long group_inum = (inum - 1) % inodes_per_group; struct ext2_group_desc *bg = group_desc(bg_num); - unsigned long inodes_per_block = EXT2_INODES_PER_BLOCK(sblock); block_t block = bg->bg_inode_table + (group_inum / inodes_per_block); return ((struct ext2_inode *)bptr(block)) + group_inum % inodes_per_block; } |