Skip to contentSkip to conversation

inode binding on 2.6

PATCH In review Rusty Lynch 2 participants 4 messages Mar 4, 2004 – Mar 8, 2004 OCFS2

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 inode binding on 2.6

Ok, the fog is starting to clear and I am starting to get my hands around how inodes work in ocfs. On the current tree, a 2.6 build will:
* never set a new inodes i_ino
* never bind the new inode

The reason inode->i_ino is never initialized is because iget5_locked (unlike iget4) does not set the i_ino when it creates a new inode, but leaves that job to the passed in set function.

I've made some considerable changes to fix this, including:
* Added a new ino entry to the find_inode_args type. This allows the set function helper for iget5_locked to know how to initialize the i_ino on the new inode
* changed ocfs_read_locked_inode() to take a find_inode_args pointer instead of a ocfs_file_entry pointer. This allows ocfs_read_locked_inode to bind new inodes by knowing when not to perform a bind in the case of revalidating an inode.
* changed ocfs_init_locked_inode (the iget5_locked set function) to set the new inode i_ino for more then root inodes.
* changed ocfs_iget() to pass in the args.ino instead of the bottom half of the offset, and then also to just pass ocfs_read_locked_inode the args and let ocfs_read_locked_inode read the file entry
* various places were calling ocfs_iget when they should be calling ocfs_get_inode_from_offset() exactly like the 2.4 builds do

None of these changes should effect the 2.4 build, and this patch does make it possible to mount ocfs2 on a 2.6 box, walk a directory of file put on the file system from a 2.4 build, and cat the files.

There is still a fatal bug that will hang the system just about anytime any kind of clean up happens, which makes the 2.6 build still unusable (but closer to usable.)

    --rusty
inode.c +30 -24
Index: src/inode.c
===================================================================
@@ -317,14 +317,16 @@
  * by this point, i_sb, i_dev, i_ino are filled in
  *
  */
-void ocfs_read_locked_inode (struct inode *inode, ocfs_file_entry *entry)
+void ocfs_read_locked_inode (struct inode *inode, ocfs_find_inode_args *args)
 {
 	struct super_block *sb;
 	ocfs_super *osb;
 	ocfs_inode *newoin;
 	umode_t mode;
+	__u64 voteoff;
+	ocfs_file_entry *fe = NULL;
 
-	LOG_ENTRY_ARGS ("(0x%08x, 0x%08x)\n", inode, entry);
+	LOG_ENTRY_ARGS ("(%p, %p)\n", inode, args);
 
 	if (inode == NULL || inode->i_sb == NULL) {
 		LOG_ERROR_STR ("bad inode");
@@ -355,26 +357,26 @@
 	}
 
 	LOG_TRACE_ARGS("Populating non-root inode (i_ino = %lu)\n", inode->i_ino);
-
-	if (entry == NULL) {
+	if (args)
+		fe = (ocfs_file_entry *) OCFS_BH_GET_DATA_READ(args->fe_bh);
+	if (!fe) {
 		make_bad_inode (inode);
 		goto bail;
 	}
 	
 	newoin = NULL;
 
-	mode = entry->prot_bits;
-
-	switch (entry->attribs) {
+	mode = fe->prot_bits;
+	switch (fe->attribs) {
 	    case OCFS_ATTRIB_DIRECTORY:
 		    mode |= S_IFDIR;
 		    break;
 	    case OCFS_ATTRIB_CHAR:
-		    inode->i_rdev = MKDEV (entry->dev_major, entry->dev_minor);
+		    inode->i_rdev = MKDEV (fe->dev_major, fe->dev_minor);
 		    mode |= S_IFCHR;
 		    break;
 	    case OCFS_ATTRIB_BLOCK:
-		    inode->i_rdev = MKDEV (entry->dev_major, entry->dev_minor);
+		    inode->i_rdev = MKDEV (fe->dev_major, fe->dev_minor);
 		    mode |= S_IFBLK;
 		    break;
 	    case OCFS_ATTRIB_FIFO:
@@ -391,9 +393,15 @@
 		    mode |= S_IFREG;
 		    break;
 	}
-	ocfs_populate_inode (inode, entry, mode, newoin, false);
+	ocfs_populate_inode (inode, fe, mode, newoin, false);
+	voteoff = S_ISDIR (mode) ? fe->extents[0].disk_off : fe->this_sector;
+	if (!args->skip_bind)
+		ocfs_inode_hash_bind(osb, voteoff, inode);
 
 bail:
+	if (fe)
+		OCFS_BH_PUT_DATA(args->fe_bh);
+
 	LOG_EXIT ();
 	return;
 }				/* ocfs_read_locked_inode */
@@ -578,17 +586,20 @@
  * us to sleep.
  * return 0 on success, 1 on failure
  */
-int ocfs_init_locked_inode(struct inode * inode, void * opaque) {
+int ocfs_init_locked_inode(struct inode * inode, void * opaque) 
+{
+	ocfs_find_inode_args *args = (ocfs_find_inode_args *) opaque;
 	int ret = 1;
-	LOG_ENTRY_ARGS("inode = %x, opaque = %x\n", inode, opaque);
+	LOG_ENTRY_ARGS("inode = %p, opaque = %p\n", inode, opaque);
 
 	/* We might be called from ocfs_fill_super in which case, opaque
 	 * will be null (but we'll be looking for the root inode
 	 * anyway... */
-	if (opaque == NULL) {
+	if (args == NULL) {
 		inode->i_ino = OCFS_ROOT_INODE_NUMBER;
+	} else {
+		inode->i_ino = args->ino;
 	}
-
 	ret = 0;
 //bail:
 	LOG_EXIT_STATUS(ret);
@@ -605,8 +616,6 @@
 struct inode * ocfs_iget(struct super_block *sb, ocfs_find_inode_args *args) 
 {
 	struct inode *inode = NULL;
-	__u64 off;
-	ocfs_file_entry *fe = NULL;
 
 	LOG_ENTRY();
 
@@ -616,13 +625,14 @@
 	/* if args == NULL, we want the root inode */
 	if (!args) {
 		LOG_TRACE_STR("looking for root inode");
-		inode = iget5_locked(sb, OCFS_ROOT_INODE_NUMBER, ocfs_find_actor, ocfs_init_locked_inode, NULL);
+		inode = iget5_locked(sb, OCFS_ROOT_INODE_NUMBER, 
+				     ocfs_find_actor, ocfs_init_locked_inode, 
+				     NULL);
 	} else {
 		LOG_TRACE_STR("looking for non-root inode");
-		off = args->offset;
 		/* Need to verify that ocfs_find_inode does the right thing,
 		 * and need to actually write ocfs_init_inode */
-		inode = iget5_locked(sb, LO (off), ocfs_find_actor,
+		inode = iget5_locked(sb, args->ino, ocfs_find_actor,
 				     ocfs_init_locked_inode, args);
 	}
 
@@ -632,11 +642,7 @@
 	/* inode was *not* in the inode cache */
 	if (inode->i_state & I_NEW) {
 		LOG_TRACE_STR("Inode was not in inode cache, reading it.");
-		if (args)
-			fe = OCFS_BH_GET_DATA_READ(args->fe_bh); /* read */
-		ocfs_read_locked_inode(inode, fe);
-		if (args)
-			OCFS_BH_PUT_DATA(args->fe_bh);
+		ocfs_read_locked_inode(inode, args);
 		unlock_new_inode(inode);
 	}
 
dcache.c +4 -5
Index: src/dcache.c
===================================================================
@@ -50,10 +50,9 @@
         struct qstr q;
 	struct buffer_head *fe_bh = NULL;
 	int needs_trunc;
+	ocfs_find_inode_args args;
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 	int flags = nd->flags;
-#else
-	ocfs_find_inode_args args;
 #endif
 
         LOG_ENTRY_ARGS ("(0x%08x, %d, '%*s')\n", dentry, flags,
@@ -134,14 +133,14 @@
                 LOG_TRACE_STR("found the file entry, but it has been deleted or renamed!");
                 ret = 0;  /* it is now officially stale :) */
         } else {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-		ocfs_read_locked_inode (inode, fe);
-#else
 		args.offset = fe->this_sector;
 		args.fe_bh = fe_bh;
 		args.skip_bind = 1;
 		OCFS_BH_PUT_DATA(fe_bh);
 		fe = NULL;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+		ocfs_read_locked_inode (inode, &args);
+#else
 		ocfs_read_inode2 (inode, (void *) &args);
 #endif
 		ret = 1;
journal.c +0 -8
Index: src/journal.c
===================================================================
@@ -900,11 +900,7 @@
 		       LO(fe->this_sector));
 	OCFS_BH_PUT_DATA(bh);
 	fe = NULL;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-	inode = ocfs_iget (osb->sb, &args);
-#else
 	inode = ocfs_get_inode_from_offset(osb, args.offset, bh);
-#endif
 	if (inode == NULL) {
 		LOG_ERROR_STR("access error");
 		status = -EACCES;
@@ -1531,11 +1527,7 @@
 	args.skip_bind = 0;
 	OCFS_BH_PUT_DATA(bh);
 	fe = NULL;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-	inode = ocfs_iget (osb->sb, &args);
-#else
 	inode = ocfs_get_inode_from_offset(osb, args.offset, bh);
-#endif
 	if (inode == NULL) {
 		LOG_ERROR_STR("access error");
 		status = -EACCES;
hash.c +2 -3
Index: src/hash.c
===================================================================
@@ -1714,7 +1714,6 @@
 {
 	struct inode *inode = NULL;
 	struct super_block *sb = osb->sb;
-	unsigned long ino = 0;
 	__u64 fe_off;
 	ocfs_file_entry *fe;
 	ocfs_find_inode_args args;
@@ -1780,12 +1779,12 @@
 		/* alright, allocate a new inode number for this guy
 		 * and insert it into the hash. It's not bound yet --
 		 * read_inode2 binds the actual inode to it. */
-		ino = ocfs_inode_hash_insert(osb, offset, fe_off);
+		args.ino = ocfs_inode_hash_insert(osb, offset, fe_off);
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 		inode = ocfs_iget (sb, &args);
 #else
 		inode =
-			iget4 (sb, ino,
+			iget4 (sb, args.ino,
 			       (find_inode_t) ocfs_find_inode, 
 			       (void *) (&args));
 #endif
inc/ocfs.h +5 -4
Index: src/inc/ocfs.h
===================================================================
@@ -27,10 +27,6 @@
 #ifndef OCFS_H
 #define OCFS_H
 
-/* XXX Hack to avoid warning */
-struct mem_dqinfo;
-extern inline void mark_info_dirty(struct mem_dqinfo *info);
-
 /*
 ** System header files
 */
@@ -49,6 +45,10 @@
 #endif
 extern inline int generic_fls(int x);
 extern inline int get_bitmask_order(unsigned int count);
+
+/* XXX Hack to avoid warning */
+struct mem_dqinfo;
+extern inline void mark_info_dirty(struct mem_dqinfo *info);
 #endif /* 2.4 kernel */
 
 #include  <linux/module.h>
@@ -2589,6 +2589,7 @@
 	__u64 offset;
 	struct buffer_head *fe_bh;
 	int skip_bind;
+	unsigned long ino;
 }
 ocfs_find_inode_args;
 /* timeout structure taken from Ben's aio.c */
inc/proto.h +1 -1
Index: src/inc/proto.h
===================================================================
@@ -86,7 +86,7 @@
 
 int ocfs_find_inode (struct inode *inode, unsigned long ino, void *opaque);
 void ocfs_populate_inode (struct inode *inode, ocfs_file_entry *fe, umode_t mode, void *genptr, bool create_ino);
-void ocfs_read_locked_inode (struct inode *inode, ocfs_file_entry *entry);
+void ocfs_read_locked_inode (struct inode *inode, ocfs_find_inode_args *args);
 void ocfs_read_inode2 (struct inode *inode, void *opaque);
 void ocfs_read_inode (struct inode *inode);
 struct inode * ocfs_iget(struct super_block *sb, ocfs_find_inode_args *args);
namei.c +2 -3
Index: src/namei.c
===================================================================
@@ -74,7 +74,6 @@
 	struct super_block *sb = dir->i_sb;
 	struct dentry *ret;
 	ocfs_super *osb = (ocfs_super *) OCFS_GENERIC_SB_P(sb);
-	unsigned long ino;
 	__u64 inode_off;
 
 	LOG_ENTRY_ARGS ("(0x%08x, 0x%08x, '%*s')\n", dir, dentry,
@@ -125,12 +124,12 @@
 		/* alright, allocate a new inode number for this guy
 		 * and insert it into the hash. It's not bound yet --
 		 * read_inode2 binds the actual inode to it. */
-		ino = ocfs_inode_hash_insert(osb, inode_off, fe_off);
+		args.ino = ocfs_inode_hash_insert(osb, inode_off, fe_off);
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 		inode = ocfs_iget (sb, &args);
 #else
 		inode =
-			iget4 (sb, ino,
+			iget4 (sb, args.ino,
 			       (find_inode_t) ocfs_find_inode, 
 			       (void *) (&args));
 #endif
#1 lore raw

On Thu, Mar 04, 2004 at 02:19:40PM -0800, Rusty Lynch wrote:
<snip>
Looks good so far...

Quoted 7 lines

None of these changes should effect the 2.4 build, and this patch does make it possible to mount ocfs2 on a 2.6 box, walk a directory of file put on the file system from a 2.4 build, and cat the files.

There is still a fatal bug that will hang the system just about anytime any kind of clean up happens, which makes the 2.6 build still unusable (but closer to usable.)

Can you give me an explanation of the bug?

Quoted 4 lines

Index: src/inode.c
===================================================================

inode.c +0 -0

<snip>

inode.c line 399

Quoted 9 lines
inode.c +4 -1
@@ -391,9 +393,15 @@
 		    mode |= S_IFREG;
 		    break;
 	}
-	ocfs_populate_inode (inode, entry, mode, newoin, false);
+	ocfs_populate_inode (inode, fe, mode, newoin, false);
+	voteoff = S_ISDIR (mode) ? fe->extents[0].disk_off : fe->this_sector;
+	if (!args->skip_bind)
+		ocfs_inode_hash_bind(osb, voteoff, inode);

Good so far, but aren't you missing the ocfs_inode_hash_bind() call for the root inode case in this function? Check out ocfs_read_inode2 to see what I'm talking about. You can safely ignore the skip_bind argument for the root inode.

<snip>

inc/ocfs.h line 33

Quoted 12 lines

Index: src/inc/ocfs.h
===================================================================

inc/ocfs.h +0 -4
@@ -27,10 +27,6 @@
 #ifndef OCFS_H
 #define OCFS_H
 
-/* XXX Hack to avoid warning */
-struct mem_dqinfo;
-extern inline void mark_info_dirty(struct mem_dqinfo *info);
-

Are you trying to slip an unrelated patch by me? ;)
Not that it's not correct (and I'll gladly commit it after you regenerate this patch)

Could I get you to regenerate this against current svn? Also, please add that call to ocfs_inode_hash_bind.

	--Mark

--
Mark Fasheh
Software Developer, Oracle Corp
[email protected]

#2 lore raw
Quoted 4 lines · Mark Fasheh

On Thu, Mar 04, 2004 at 02:19:40PM -0800, Rusty Lynch wrote:
<snip>
Looks good so far...

Quoted 8 lines
Quoted 7 lines

None of these changes should effect the 2.4 build, and this patch does make it possible to mount ocfs2 on a 2.6 box, walk a directory of file put on the file system from a 2.4 build, and cat the files.

There is still a fatal bug that will hang the system just about anytime any kind of clean up happens, which makes the 2.6 build still unusable (but closer to usable.)

Can you give me an explanation of the bug?

I still need to properly charactorize the bug, and it is very likely that there are multiple bugs, but some examples of how to trigger a freeze are:

* delete a file
* move a file (even from another filesystem to the ocfs2 mount)
* umount the file system

Normally the last debug message I see is ocfs_iput() exiting, and for some reason kgdb is unable to walk the stack so I don't really get any usefull information from the debugger. Oh yea... On the svn version from a couple of days ago, I was able to track down the mount hang to when journal_destroy() calls kfree() on the journal_t (but I have not tried since on the new tree.)

Quoted 7 lines
Quoted 6 lines

Index: src/inode.c
===================================================================

inode.c +0 -0

<snip>

Quoted 13 lines

inode.c line 399

Quoted 9 lines
inode.c +4 -1
@@ -391,9 +393,15 @@
 		    mode |= S_IFREG;
 		    break;
 	}
-	ocfs_populate_inode (inode, entry, mode, newoin, false);
+	ocfs_populate_inode (inode, fe, mode, newoin, false);
+	voteoff = S_ISDIR (mode) ? fe->extents[0].disk_off : fe->this_sector;
+	if (!args->skip_bind)
+		ocfs_inode_hash_bind(osb, voteoff, inode);

Good so far, but aren't you missing the ocfs_inode_hash_bind() call for the root inode case in this function? Check out ocfs_read_inode2 to see what I'm talking about. You can safely ignore the skip_bind argument for the root inode.

got it.

Quoted 9 lines

<snip>

Quoted 8 lines

Index: src/inc/ocfs.h
===================================================================

inc/ocfs.h +0 -0
@@ -27,10 +27,6 @@
 #ifndef OCFS_H
 #define OCFS_H
 
Quoted 7 lines

inc/ocfs.h line 33

Quoted 4 lines
inc/ocfs.h +0 -4
-/* XXX Hack to avoid warning */
-struct mem_dqinfo;
-extern inline void mark_info_dirty(struct mem_dqinfo *info);
-

Are you trying to slip an unrelated patch by me? ;)
Not that it's not correct (and I'll gladly commit it after you regenerate this patch)

My mistake. This is the patch that I sent out earlier. I've just started using the latest -mm tree, which breaks without the patch... but since your willing to take it I left it in :->

Quoted 4 lines

Could I get you to regenerate this against current svn? Also, please add that call to ocfs_inode_hash_bind.

	--Mark

[email protected]

inode.c +31 -24
Index: src/inode.c
===================================================================
@@ -317,14 +317,16 @@
  * by this point, i_sb, i_dev, i_ino are filled in
  *
  */
-void ocfs_read_locked_inode (struct inode *inode, ocfs_file_entry *entry)
+void ocfs_read_locked_inode (struct inode *inode, ocfs_find_inode_args *args)
 {
 	struct super_block *sb;
 	ocfs_super *osb;
 	ocfs_inode *newoin;
 	umode_t mode;
+	__u64 voteoff;
+	ocfs_file_entry *fe = NULL;
 
-	LOG_ENTRY_ARGS ("(0x%08x, 0x%08x)\n", inode, entry);
+	LOG_ENTRY_ARGS ("(%p, %p)\n", inode, args);
 
 	if (inode == NULL || inode->i_sb == NULL) {
 		LOG_ERROR_STR ("bad inode");
@@ -351,30 +353,31 @@
 		SET_INODE_OIN (inode, osb->oin_root_dir);
 		SET_INODE_VOTEOFF(inode, osb->vol_layout.root_start_off);
 		SET_INODE_FEOFF(inode, 0);
+		ocfs_inode_hash_bind(osb, GET_INODE_VOTEOFF(inode), inode);
 		goto bail;
 	}
 
 	LOG_TRACE_ARGS("Populating non-root inode (i_ino = %lu)\n", inode->i_ino);
-
-	if (entry == NULL) {
+	if (args)
+		fe = (ocfs_file_entry *) OCFS_BH_GET_DATA_READ(args->fe_bh);
+	if (!fe) {
 		make_bad_inode (inode);
 		goto bail;
 	}
 	
 	newoin = NULL;
 
-	mode = entry->prot_bits;
-
-	switch (entry->attribs) {
+	mode = fe->prot_bits;
+	switch (fe->attribs) {
 	    case OCFS_ATTRIB_DIRECTORY:
 		    mode |= S_IFDIR;
 		    break;
 	    case OCFS_ATTRIB_CHAR:
-		    inode->i_rdev = MKDEV (entry->dev_major, entry->dev_minor);
+		    inode->i_rdev = MKDEV (fe->dev_major, fe->dev_minor);
 		    mode |= S_IFCHR;
 		    break;
 	    case OCFS_ATTRIB_BLOCK:
-		    inode->i_rdev = MKDEV (entry->dev_major, entry->dev_minor);
+		    inode->i_rdev = MKDEV (fe->dev_major, fe->dev_minor);
 		    mode |= S_IFBLK;
 		    break;
 	    case OCFS_ATTRIB_FIFO:
@@ -391,9 +394,15 @@
 		    mode |= S_IFREG;
 		    break;
 	}
-	ocfs_populate_inode (inode, entry, mode, newoin, false);
+	ocfs_populate_inode (inode, fe, mode, newoin, false);
+	voteoff = S_ISDIR (mode) ? fe->extents[0].disk_off : fe->this_sector;
+	if (!args->skip_bind)
+		ocfs_inode_hash_bind(osb, voteoff, inode);
 
 bail:
+	if (fe)
+		OCFS_BH_PUT_DATA(args->fe_bh);
+
 	LOG_EXIT ();
 	return;
 }				/* ocfs_read_locked_inode */
@@ -578,17 +587,20 @@
  * us to sleep.
  * return 0 on success, 1 on failure
  */
-int ocfs_init_locked_inode(struct inode * inode, void * opaque) {
+int ocfs_init_locked_inode(struct inode * inode, void * opaque) 
+{
+	ocfs_find_inode_args *args = (ocfs_find_inode_args *) opaque;
 	int ret = 1;
-	LOG_ENTRY_ARGS("inode = %x, opaque = %x\n", inode, opaque);
+	LOG_ENTRY_ARGS("inode = %p, opaque = %p\n", inode, opaque);
 
 	/* We might be called from ocfs_fill_super in which case, opaque
 	 * will be null (but we'll be looking for the root inode
 	 * anyway... */
-	if (opaque == NULL) {
+	if (args == NULL) {
 		inode->i_ino = OCFS_ROOT_INODE_NUMBER;
+	} else {
+		inode->i_ino = args->ino;
 	}
-
 	ret = 0;
 //bail:
 	LOG_EXIT_STATUS(ret);
@@ -605,8 +617,6 @@
 struct inode * ocfs_iget(struct super_block *sb, ocfs_find_inode_args *args) 
 {
 	struct inode *inode = NULL;
-	__u64 off;
-	ocfs_file_entry *fe = NULL;
 
 	LOG_ENTRY();
 
@@ -616,13 +626,14 @@
 	/* if args == NULL, we want the root inode */
 	if (!args) {
 		LOG_TRACE_STR("looking for root inode");
-		inode = iget5_locked(sb, OCFS_ROOT_INODE_NUMBER, ocfs_find_actor, ocfs_init_locked_inode, NULL);
+		inode = iget5_locked(sb, OCFS_ROOT_INODE_NUMBER, 
+				     ocfs_find_actor, ocfs_init_locked_inode, 
+				     NULL);
 	} else {
 		LOG_TRACE_STR("looking for non-root inode");
-		off = args->offset;
 		/* Need to verify that ocfs_find_inode does the right thing,
 		 * and need to actually write ocfs_init_inode */
-		inode = iget5_locked(sb, LO (off), ocfs_find_actor,
+		inode = iget5_locked(sb, args->ino, ocfs_find_actor,
 				     ocfs_init_locked_inode, args);
 	}
 
@@ -632,11 +643,7 @@
 	/* inode was *not* in the inode cache */
 	if (inode->i_state & I_NEW) {
 		LOG_TRACE_STR("Inode was not in inode cache, reading it.");
-		if (args)
-			fe = OCFS_BH_GET_DATA_READ(args->fe_bh); /* read */
-		ocfs_read_locked_inode(inode, fe);
-		if (args)
-			OCFS_BH_PUT_DATA(args->fe_bh);
+		ocfs_read_locked_inode(inode, args);
 		unlock_new_inode(inode);
 	}
 
dcache.c +4 -5
Index: src/dcache.c
===================================================================
@@ -50,10 +50,9 @@
         struct qstr q;
 	struct buffer_head *fe_bh = NULL;
 	int needs_trunc;
+	ocfs_find_inode_args args;
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 	int flags = nd->flags;
-#else
-	ocfs_find_inode_args args;
 #endif
 
         LOG_ENTRY_ARGS ("(0x%08x, %d, '%*s')\n", dentry, flags,
@@ -134,14 +133,14 @@
                 LOG_TRACE_STR("found the file entry, but it has been deleted or renamed!");
                 ret = 0;  /* it is now officially stale :) */
         } else {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-		ocfs_read_locked_inode (inode, fe);
-#else
 		args.offset = fe->this_sector;
 		args.fe_bh = fe_bh;
 		args.skip_bind = 1;
 		OCFS_BH_PUT_DATA(fe_bh);
 		fe = NULL;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+		ocfs_read_locked_inode (inode, &args);
+#else
 		ocfs_read_inode2 (inode, (void *) &args);
 #endif
 		ret = 1;
journal.c +0 -8
Index: src/journal.c
===================================================================
@@ -900,11 +900,7 @@
 		       LO(fe->this_sector));
 	OCFS_BH_PUT_DATA(bh);
 	fe = NULL;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-	inode = ocfs_iget (osb->sb, &args);
-#else
 	inode = ocfs_get_inode_from_offset(osb, args.offset, bh);
-#endif
 	if (inode == NULL) {
 		LOG_ERROR_STR("access error");
 		status = -EACCES;
@@ -1539,11 +1535,7 @@
 	args.skip_bind = 0;
 	OCFS_BH_PUT_DATA(bh);
 	fe = NULL;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-	inode = ocfs_iget (osb->sb, &args);
-#else
 	inode = ocfs_get_inode_from_offset(osb, args.offset, bh);
-#endif
 	if (inode == NULL) {
 		LOG_ERROR_STR("access error");
 		status = -EACCES;
hash.c +2 -3
Index: src/hash.c
===================================================================
@@ -1714,7 +1714,6 @@
 {
 	struct inode *inode = NULL;
 	struct super_block *sb = osb->sb;
-	unsigned long ino = 0;
 	__u64 fe_off;
 	ocfs_file_entry *fe;
 	ocfs_find_inode_args args;
@@ -1780,12 +1779,12 @@
 		/* alright, allocate a new inode number for this guy
 		 * and insert it into the hash. It's not bound yet --
 		 * read_inode2 binds the actual inode to it. */
-		ino = ocfs_inode_hash_insert(osb, offset, fe_off);
+		args.ino = ocfs_inode_hash_insert(osb, offset, fe_off);
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 		inode = ocfs_iget (sb, &args);
 #else
 		inode =
-			iget4 (sb, ino,
+			iget4 (sb, args.ino,
 			       (find_inode_t) ocfs_find_inode, 
 			       (void *) (&args));
 #endif
inc/ocfs.h +4 -4
Index: src/inc/ocfs.h
===================================================================
@@ -27,10 +27,6 @@
 #ifndef OCFS_H
 #define OCFS_H
 
-/* XXX Hack to avoid warning */
-struct mem_dqinfo;
-extern inline void mark_info_dirty(struct mem_dqinfo *info);
-
 /*
 ** System header files
 */
@@ -49,6 +45,9 @@
 #endif
 extern inline int generic_fls(int x);
 extern inline int get_bitmask_order(unsigned int count);
+/* XXX Hack to avoid warning */
+struct mem_dqinfo;
+extern inline void mark_info_dirty(struct mem_dqinfo *info);
 #else /* 2.4 kernel */
 #include <asm/processor.h>
 #endif /* 2.6 kernel */
@@ -2595,6 +2594,7 @@
 	__u64 offset;
 	struct buffer_head *fe_bh;
 	int skip_bind;
+	unsigned long ino;
 }
 ocfs_find_inode_args;
 /* timeout structure taken from Ben's aio.c */
inc/proto.h +1 -1
Index: src/inc/proto.h
===================================================================
@@ -86,7 +86,7 @@
 
 int ocfs_find_inode (struct inode *inode, unsigned long ino, void *opaque);
 void ocfs_populate_inode (struct inode *inode, ocfs_file_entry *fe, umode_t mode, void *genptr, bool create_ino);
-void ocfs_read_locked_inode (struct inode *inode, ocfs_file_entry *entry);
+void ocfs_read_locked_inode (struct inode *inode, ocfs_find_inode_args *args);
 void ocfs_read_inode2 (struct inode *inode, void *opaque);
 void ocfs_read_inode (struct inode *inode);
 struct inode * ocfs_iget(struct super_block *sb, ocfs_find_inode_args *args);
namei.c +2 -3
Index: src/namei.c
===================================================================
@@ -74,7 +74,6 @@
 	struct super_block *sb = dir->i_sb;
 	struct dentry *ret;
 	ocfs_super *osb = (ocfs_super *) OCFS_GENERIC_SB_P(sb);
-	unsigned long ino;
 	__u64 inode_off;
 
 	LOG_ENTRY_ARGS ("(0x%08x, 0x%08x, '%*s')\n", dir, dentry,
@@ -125,12 +124,12 @@
 		/* alright, allocate a new inode number for this guy
 		 * and insert it into the hash. It's not bound yet --
 		 * read_inode2 binds the actual inode to it. */
-		ino = ocfs_inode_hash_insert(osb, inode_off, fe_off);
+		args.ino = ocfs_inode_hash_insert(osb, inode_off, fe_off);
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 		inode = ocfs_iget (sb, &args);
 #else
 		inode =
-			iget4 (sb, ino,
+			iget4 (sb, args.ino,
 			       (find_inode_t) ocfs_find_inode, 
 			       (void *) (&args));
 #endif