HAMMER VFS - Remove the unused also_ip argument from the cursor API
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 24 Jan 2009 19:49:34 +0000 (11:49 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 24 Jan 2009 19:49:34 +0000 (11:49 -0800)
sys/vfs/hammer/hammer.h
sys/vfs/hammer/hammer_cursor.c
sys/vfs/hammer/hammer_inode.c
sys/vfs/hammer/hammer_mirror.c
sys/vfs/hammer/hammer_pfs.c
sys/vfs/hammer/hammer_prune.c
sys/vfs/hammer/hammer_reblock.c

index 451e40d..83360b1 100644 (file)
@@ -930,8 +930,8 @@ int hammer_init_cursor(hammer_transaction_t trans, hammer_cursor_t cursor,
 void   hammer_normalize_cursor(hammer_cursor_t cursor);
 void   hammer_done_cursor(hammer_cursor_t cursor);
 int    hammer_recover_cursor(hammer_cursor_t cursor);
-void   hammer_unlock_cursor(hammer_cursor_t cursor, int also_ip);
-int    hammer_lock_cursor(hammer_cursor_t cursor, int also_ip);
+void   hammer_unlock_cursor(hammer_cursor_t cursor);
+int    hammer_lock_cursor(hammer_cursor_t cursor);
 hammer_cursor_t        hammer_push_cursor(hammer_cursor_t ocursor);
 void   hammer_pop_cursor(hammer_cursor_t ocursor, hammer_cursor_t ncursor);
 
index 039b238..7def588 100644 (file)
@@ -487,7 +487,7 @@ hammer_cursor_down(hammer_cursor_t cursor)
  * operations.
  */
 void
-hammer_unlock_cursor(hammer_cursor_t cursor, int also_ip)
+hammer_unlock_cursor(hammer_cursor_t cursor)
 {
        hammer_node_t node;
        hammer_inode_t ip;
@@ -508,9 +508,6 @@ hammer_unlock_cursor(hammer_cursor_t cursor, int also_ip)
        cursor->flags |= HAMMER_CURSOR_TRACKED;
        TAILQ_INSERT_TAIL(&node->cursor_list, cursor, deadlk_entry);
        hammer_unlock(&node->lock);
-
-       if (also_ip && (ip = cursor->ip) != NULL)
-               hammer_unlock(&ip->lock);
 }
 
 /*
@@ -522,7 +519,7 @@ hammer_unlock_cursor(hammer_cursor_t cursor, int also_ip)
  * the element after it.
  */
 int
-hammer_lock_cursor(hammer_cursor_t cursor, int also_ip)
+hammer_lock_cursor(hammer_cursor_t cursor)
 {
        hammer_inode_t ip;
        hammer_node_t node;
@@ -530,16 +527,6 @@ hammer_lock_cursor(hammer_cursor_t cursor, int also_ip)
 
        KKASSERT(cursor->flags & HAMMER_CURSOR_TRACKED);
 
-       /*
-        * Relock the inode
-        */
-       if (also_ip && (ip = cursor->ip) != NULL) {
-               if (cursor->trans->type == HAMMER_TRANS_FLS)
-                       hammer_lock_ex(&ip->lock);
-               else
-                       hammer_lock_sh(&ip->lock);
-       }
-
        /*
         * Relock the node
         */
@@ -589,7 +576,7 @@ hammer_recover_cursor(hammer_cursor_t cursor)
 {
        int error;
 
-       hammer_unlock_cursor(cursor, 0);
+       hammer_unlock_cursor(cursor);
        KKASSERT(cursor->trans->sync_lock_refs > 0);
 
        /*
@@ -606,7 +593,7 @@ hammer_recover_cursor(hammer_cursor_t cursor)
                hammer_rel_mem_record(cursor->deadlk_rec);
                cursor->deadlk_rec = NULL;
        }
-       error = hammer_lock_cursor(cursor, 0);
+       error = hammer_lock_cursor(cursor);
        return(error);
 }
 
@@ -672,7 +659,7 @@ hammer_pop_cursor(hammer_cursor_t ocursor, hammer_cursor_t ncursor)
        hammer_done_cursor(ncursor);
        kfree(ncursor, hmp->m_misc);
        KKASSERT(ocursor->ip == ip);
-       hammer_lock_cursor(ocursor, 0);
+       hammer_lock_cursor(ocursor);
 }
 
 /*
index 537bd19..73c75de 100644 (file)
@@ -2337,9 +2337,9 @@ done:
         * due to the exclusive sync lock the finalizer must get.
         */
         if (hammer_flusher_meta_limit(hmp)) {
-               hammer_unlock_cursor(cursor, 0);
+               hammer_unlock_cursor(cursor);
                 hammer_flusher_finalize(trans, 0);
-               hammer_lock_cursor(cursor, 0);
+               hammer_lock_cursor(cursor);
        }
 
        return(error);
index 81789ca..9c97143 100644 (file)
@@ -359,9 +359,9 @@ hammer_ioc_mirror_write(hammer_transaction_t trans, hammer_inode_t ip,
                 */
                while (hammer_flusher_meta_halflimit(trans->hmp) ||
                       hammer_flusher_undo_exhausted(trans, 2)) {
-                       hammer_unlock_cursor(&cursor, 0);
+                       hammer_unlock_cursor(&cursor);
                        hammer_flusher_wait(trans->hmp, seq);
-                       hammer_lock_cursor(&cursor, 0);
+                       hammer_lock_cursor(&cursor);
                        seq = hammer_flusher_async_one(trans->hmp);
                }
 
@@ -374,9 +374,9 @@ hammer_ioc_mirror_write(hammer_transaction_t trans, hammer_inode_t ip,
                                error = ENOSPC;
                                break;
                        }
-                       hammer_unlock_cursor(&cursor, 0);
+                       hammer_unlock_cursor(&cursor);
                        hammer_flusher_wait(trans->hmp, seq);
-                       hammer_lock_cursor(&cursor, 0);
+                       hammer_lock_cursor(&cursor);
                        seq = hammer_flusher_async(trans->hmp, NULL);
                }
 
index e92b05f..49e8465 100644 (file)
@@ -411,9 +411,9 @@ retry:
 
                while (hammer_flusher_meta_halflimit(trans->hmp) ||
                       hammer_flusher_undo_exhausted(trans, 2)) {
-                       hammer_unlock_cursor(&cursor, 0);
+                       hammer_unlock_cursor(&cursor);
                        hammer_flusher_wait(trans->hmp, seq);
-                       hammer_lock_cursor(&cursor, 0);
+                       hammer_lock_cursor(&cursor);
                        seq = hammer_flusher_async_one(trans->hmp);
                }
 
index c9baa3a..63da51b 100644 (file)
@@ -216,9 +216,9 @@ retry:
 
                while (hammer_flusher_meta_halflimit(trans->hmp) ||
                       hammer_flusher_undo_exhausted(trans, 2)) {
-                       hammer_unlock_cursor(&cursor, 0);
+                       hammer_unlock_cursor(&cursor);
                        hammer_flusher_wait(trans->hmp, seq);
-                       hammer_lock_cursor(&cursor, 0);
+                       hammer_lock_cursor(&cursor);
                        seq = hammer_flusher_async_one(trans->hmp);
                }
                hammer_sync_lock_sh(trans);
index d000e66..18336e3 100644 (file)
@@ -149,9 +149,9 @@ retry:
                                error = ENOSPC;
                                break;
                        }
-                       hammer_unlock_cursor(&cursor, 0);
+                       hammer_unlock_cursor(&cursor);
                        hammer_flusher_wait(trans->hmp, seq);
-                       hammer_lock_cursor(&cursor, 0);
+                       hammer_lock_cursor(&cursor);
                        seq = hammer_flusher_async(trans->hmp, NULL);
                        continue;
                }
@@ -168,9 +168,9 @@ retry:
 
                while (hammer_flusher_meta_halflimit(trans->hmp) ||
                       hammer_flusher_undo_exhausted(trans, 2)) {
-                       hammer_unlock_cursor(&cursor, 0);
+                       hammer_unlock_cursor(&cursor);
                        hammer_flusher_wait(trans->hmp, seq);
-                       hammer_lock_cursor(&cursor, 0);
+                       hammer_lock_cursor(&cursor);
                        seq = hammer_flusher_async_one(trans->hmp);
                }
 
@@ -189,9 +189,9 @@ retry:
                 * (The cursor's node and element may change!)
                 */
                if (bd_heatup()) {
-                       hammer_unlock_cursor(&cursor, 0);
+                       hammer_unlock_cursor(&cursor);
                        bwillwrite(HAMMER_XBUFSIZE);
-                       hammer_lock_cursor(&cursor, 0);
+                       hammer_lock_cursor(&cursor);
                }
 
                if (error == 0) {
@@ -289,9 +289,9 @@ hammer_reblock_helper(struct hammer_ioc_reblock *reblock,
                         * the cursor locked.
                         */
                        leaf = elm->leaf;
-                       hammer_unlock_cursor(cursor, 0);
+                       hammer_unlock_cursor(cursor);
                        hammer_io_direct_uncache(hmp, &leaf);
-                       hammer_lock_cursor(cursor, 0);
+                       hammer_lock_cursor(cursor);
                        if (cursor->flags & HAMMER_CURSOR_RETEST) {
                                kprintf("hammer: retest after uncache\n");
                                error = EDEADLK;