aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/jbd/transaction.c9
-rw-r--r--include/linux/jbd.h5
2 files changed, 14 insertions, 0 deletions
diff --git a/fs/jbd/transaction.c b/fs/jbd/transaction.c
index 772b6531a2a2..8df5bac0b7a5 100644
--- a/fs/jbd/transaction.c
+++ b/fs/jbd/transaction.c
@@ -233,6 +233,8 @@ out:
233 return ret; 233 return ret;
234} 234}
235 235
236static struct lock_class_key jbd_handle_key;
237
236/* Allocate a new handle. This should probably be in a slab... */ 238/* Allocate a new handle. This should probably be in a slab... */
237static handle_t *new_handle(int nblocks) 239static handle_t *new_handle(int nblocks)
238{ 240{
@@ -243,6 +245,8 @@ static handle_t *new_handle(int nblocks)
243 handle->h_buffer_credits = nblocks; 245 handle->h_buffer_credits = nblocks;
244 handle->h_ref = 1; 246 handle->h_ref = 1;
245 247
248 lockdep_init_map(&handle->h_lockdep_map, "jbd_handle", &jbd_handle_key, 0);
249
246 return handle; 250 return handle;
247} 251}
248 252
@@ -286,6 +290,9 @@ handle_t *journal_start(journal_t *journal, int nblocks)
286 current->journal_info = NULL; 290 current->journal_info = NULL;
287 handle = ERR_PTR(err); 291 handle = ERR_PTR(err);
288 } 292 }
293
294 lock_acquire(&handle->h_lockdep_map, 0, 0, 0, 2, _THIS_IP_);
295
289 return handle; 296 return handle;
290} 297}
291 298
@@ -1411,6 +1418,8 @@ int journal_stop(handle_t *handle)
1411 spin_unlock(&journal->j_state_lock); 1418 spin_unlock(&journal->j_state_lock);
1412 } 1419 }
1413 1420
1421 lock_release(&handle->h_lockdep_map, 1, _THIS_IP_);
1422
1414 jbd_free_handle(handle); 1423 jbd_free_handle(handle);
1415 return err; 1424 return err;
1416} 1425}
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index 452737551260..700a93b79189 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -30,6 +30,7 @@
30#include <linux/bit_spinlock.h> 30#include <linux/bit_spinlock.h>
31#include <linux/mutex.h> 31#include <linux/mutex.h>
32#include <linux/timer.h> 32#include <linux/timer.h>
33#include <linux/lockdep.h>
33 34
34#include <asm/semaphore.h> 35#include <asm/semaphore.h>
35#endif 36#endif
@@ -396,6 +397,10 @@ struct handle_s
396 unsigned int h_sync: 1; /* sync-on-close */ 397 unsigned int h_sync: 1; /* sync-on-close */
397 unsigned int h_jdata: 1; /* force data journaling */ 398 unsigned int h_jdata: 1; /* force data journaling */
398 unsigned int h_aborted: 1; /* fatal error on handle */ 399 unsigned int h_aborted: 1; /* fatal error on handle */
400
401#ifdef CONFIG_DEBUG_LOCK_ALLOC
402 struct lockdep_map h_lockdep_map;
403#endif
399}; 404};
400 405
401 406