Skip to contentSkip to conversation

use asynchronous journal commit in ocfs_rename

PATCH New Ling 2 participants 2 messages Aug 2, 2004 – Aug 3, 2004 OCFS2

lore
Share & tools
lore

Ling

#0 lore raw

PATCH 1/1 use asynchronous journal commit in ocfs_rename

ok. I've made the patch. see attach.

Quoted 68 lines

-----Original Message-----
From: Mark Fasheh [mailto:[email protected]]
Sent: 2004��7��31�� 0:01
To: Ling, Xiaofeng
Cc: Ocfs2-Devel
Subject: Re: [Ocfs2-devel] [Patch] use asynchronous journal commit in ocfs_rename

Quoted 2 lines · Xiaofeng

Use asynchronous commit in ocfs_rename can make the speed of rename from 95dir/s to 11834dir/s.

Cool. the patch looks good at first glance. Would you be interested in taking it one step further and doing the same for the last couple sync transactions? (link, truncate, and symlink)

Basically the same thing you just did here. The best thing in fact would be
to just get rid of those flags (and the code which acts on them) altogether.

It's about time we got rid of that junk.

	--Mark
Quoted 1 line

---------------------------------------------------------------
---------

Quoted 42 lines

---------------------
Index: namei.c
===================================================================

namei.c (working copy) renamed from namei.c (revision 1312) +7 -4
@@ -1049,6 +1049,8 @@
                goto bail;
        }
 
+       ocfs_handle_set_checkpoint(handle, 0);
+       ocfs_handle_set_sync(handle, 0);
        /* if old and new are the same, this'll just do one lock. */
        status = ocfs_double_lock(osb, handle,
                                  OCFS_LKM_EXMODE,
@@ -1084,6 +1086,9 @@
                LOG_ERROR_STATUS(status);
                goto finally;
        }
+
+       ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE,
+                            FLAG_FILE_CREATE | FLAG_DIR, old_inode);
        got_oldlock = 1;
 
        if (S_ISDIR(old_inode->i_mode)) {
@@ -1157,6 +1162,8 @@
                }
                got_newlock = 1;
 
+               ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE,
+                            FLAG_FILE_CREATE | FLAG_DIR, new_inode);
                /* if our caching is working right, then after the
                 * verify_update_inode, newfe->i_nlink ==
                 * new_inode->i_nlink */
@@ -1294,16 +1301,7 @@
        status = 0;
 
 bail:
-       if (got_oldlock) {
-               ocfs_release_lock(osb, OCFS_LKM_EXMODE, oldfe_flags,
-                                 old_inode);
-       }
 
Quoted 17 lines
Quoted 8 lines
namei.c (working copy) renamed from namei.c (revision 1312) +0 -5
-       if (got_newlock) {
-               ocfs_release_lock(osb, OCFS_LKM_EXMODE, newfe_flags,
-                                 new_inode);
-       }
-
        double_up_write(&OCFS_I(old_dir)->ip_io_sem,
                        &OCFS_I(new_dir)->ip_io_sem);
        up_write(&OCFS_I(old_inode)->ip_io_sem);
Quoted 4 lines

_______________________________________________
Ocfs2-devel mailing list
[email protected]
http://oss.oracle.com/mailman/listinfo/ocfs2-devel

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: allasync.patch
Type: application/octet-stream
Size: 4982 bytes
Desc: allasync.patch
Url : http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20040803/41942687/allasync.obj

#1 lore raw

PATCH 1/1 use asynchronous journal commit in ocfs_rename

Quoted 1 line · Xiaofeng

ok. I've made the patch. see attach.

Coolness, next time could you include it inline in the mail? :)

In ocfs_link, you did:
ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, FLAG_FILE_CREATE, inode);

You left out the FLAG_FILE_UPDATE_OIN which is somewhat critical as it is what the other node keys on to know that it needs to update the inode information (otherwise i_nlink might've gotten out of sync).

Also, tmpstat is no longer used in ocfs_link so I removed it.

I came across an unexpected bug in the way we handle symlinks, but the fix (which is unfortunately, something of a hack) was fairly simple.

I'm looking forward to just removing the checkpointing code altogether now :)

	--Mark

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