Skip to contentSkip to conversation

use asynchronous journal commit in ocfs_rename

PATCH New Ling 2 participants 2 messages Jul 28, 2004 – Jul 31, 2004 OCFS2

lore
Share & tools
lore

Ling

#0 lore raw

PATCH 1/1 use asynchronous journal commit in ocfs_rename

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

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

namei.c (working copy) renamed from namei.c (revision 1312) +7 -9
@@ -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);
-       }
 
-       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);
#1 lore raw

PATCH 1/1 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 51 lines

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

namei.c (working copy) renamed from namei.c (revision 1312) +7 -9
@@ -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);
-       }
 
-       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]