aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jbd2
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jbd2')
-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}