]> err.no Git - linux-2.6/blobdiff - fs/jbd/transaction.c
Merge git://git.linux-nfs.org/pub/linux/nfs-2.6
[linux-2.6] / fs / jbd / transaction.c
index cceaf57e37781304df0b553ca2f8e9957fd65ecb..8df5bac0b7a52a5402116745ce3eb341e89e8a3f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * linux/fs/transaction.c
+ * linux/fs/jbd/transaction.c
  *
  * Written by Stephen C. Tweedie <sct@redhat.com>, 1998
  *
@@ -23,7 +23,6 @@
 #include <linux/errno.h>
 #include <linux/slab.h>
 #include <linux/timer.h>
-#include <linux/smp_lock.h>
 #include <linux/mm.h>
 #include <linux/highmem.h>
 
@@ -234,6 +233,8 @@ out:
        return ret;
 }
 
+static struct lock_class_key jbd_handle_key;
+
 /* Allocate a new handle.  This should probably be in a slab... */
 static handle_t *new_handle(int nblocks)
 {
@@ -244,6 +245,8 @@ static handle_t *new_handle(int nblocks)
        handle->h_buffer_credits = nblocks;
        handle->h_ref = 1;
 
+       lockdep_init_map(&handle->h_lockdep_map, "jbd_handle", &jbd_handle_key, 0);
+
        return handle;
 }
 
@@ -287,6 +290,9 @@ handle_t *journal_start(journal_t *journal, int nblocks)
                current->journal_info = NULL;
                handle = ERR_PTR(err);
        }
+
+       lock_acquire(&handle->h_lockdep_map, 0, 0, 0, 2, _THIS_IP_);
+
        return handle;
 }
 
@@ -1412,6 +1418,8 @@ int journal_stop(handle_t *handle)
                spin_unlock(&journal->j_state_lock);
        }
 
+       lock_release(&handle->h_lockdep_map, 1, _THIS_IP_);
+
        jbd_free_handle(handle);
        return err;
 }