From 0323aee0f37921a0bc9294fa93d8b5d5aa875ce2 Mon Sep 17 00:00:00 2001
From: Miles Bader <miles@gnu.org>
Date: Thu, 15 Aug 1996 02:23:31 +0000
Subject: (dino): Dont recalculate INODES_PER_BLOCK here. (ext2_debug):
 redefine macro after including ext2_fs.h.

---
 ext2fs/ext2fs.h | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

(limited to 'ext2fs/ext2fs.h')

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;
 }
-- 
cgit v1.2.3