aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jbd2/transaction.c
diff options
context:
space:
mode:
authorMingming Cao <cmm@us.ibm.com>2008-01-28 23:58:27 -0500
committerTheodore Ts'o <tytso@mit.edu>2008-01-28 23:58:27 -0500
commit7b7510662f4d05ddcc45d435769860e73e6aa20e (patch)
treeadf0fe32c57c53099b6604bcf40d914398a5504c /fs/jbd2/transaction.c
parentb939e3766ec19eb556cb784c2faace253c6e1560 (diff)
jbd2: add lockdep support
Ported from similar patch for the jbd layer. Signed-off-by: Mingming Cao <cmm@us.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/jbd2/transaction.c')
-rw-r--r--fs/jbd2/transaction.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
index f30802aeefae..70b3199e69dc 100644
--- a/fs/jbd2/transaction.c
+++ b/fs/jbd2/transaction.c
@@ -241,6 +241,8 @@ out:
241 return ret; 241 return ret;
242} 242}
243 243
244static struct lock_class_key jbd2_handle_key;
245
244/* Allocate a new handle. This should probably be in a slab... */ 246/* Allocate a new handle. This should probably be in a slab... */
245static handle_t *new_handle(int nblocks) 247static handle_t *new_handle(int nblocks)
246{ 248{
@@ -251,6 +253,9 @@ static handle_t *new_handle(int nblocks)
251 handle->h_buffer_credits = nblocks; 253 handle->h_buffer_credits = nblocks;
252 handle->h_ref = 1; 254 handle->h_ref = 1;
253 255
256 lockdep_init_map(&handle->h_lockdep_map, "jbd2_handle",
257 &jbd2_handle_key, 0);
258
254 return handle; 259 return handle;
255} 260}
256 261
@@ -293,7 +298,11 @@ handle_t *jbd2_journal_start(journal_t *journal, int nblocks)
293 jbd2_free_handle(handle); 298 jbd2_free_handle(handle);
294 current->journal_info = NULL; 299 current->journal_info = NULL;
295 handle = ERR_PTR(err); 300 handle = ERR_PTR(err);
301 goto out;
296 } 302 }
303
304 lock_acquire(&handle->h_lockdep_map, 0, 0, 0, 2, _THIS_IP_);
305out:
297 return handle; 306 return handle;
298} 307}
299 308
@@ -1419,6 +1428,8 @@ int jbd2_journal_stop(handle_t *handle)
1419 spin_unlock(&journal->j_state_lock); 1428 spin_unlock(&journal->j_state_lock);
1420 } 1429 }
1421 1430
1431 lock_release(&handle->h_lockdep_map, 1, _THIS_IP_);
1432
1422 jbd2_free_handle(handle); 1433 jbd2_free_handle(handle);
1423 return err; 1434 return err;
1424} 1435}