diff options
author | Jan Kara <jack@suse.cz> | 2016-06-30 11:39:38 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2016-06-30 11:39:38 -0400 |
commit | ab714aff4f744f52f0beae93ed441f2f5585eb7a (patch) | |
tree | 2c62c6356d6445d05492d3838e2acfc27db4192c /include/linux | |
parent | 7a4b188f0c0b49ed8ae41489494a9669ad7f1f8c (diff) | |
download | lwn-ab714aff4f744f52f0beae93ed441f2f5585eb7a.tar.gz lwn-ab714aff4f744f52f0beae93ed441f2f5585eb7a.zip |
jbd2: move lockdep tracking to journal_s
Currently lockdep map is tracked in each journal handle. To be able to
expand lockdep support to cover also other cases where we depend on
transaction commit and where handle is not available, move lockdep map
into struct journal_s. Since this makes the lockdep map shared for all
handles, we have to use rwsem_acquire_read() for acquisitions now.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/jbd2.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index efb232c5f668..3d210cbe4e1b 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h @@ -491,10 +491,6 @@ struct jbd2_journal_handle unsigned long h_start_jiffies; unsigned int h_requested_credits; - -#ifdef CONFIG_DEBUG_LOCK_ALLOC - struct lockdep_map h_lockdep_map; -#endif }; @@ -793,6 +789,7 @@ jbd2_time_diff(unsigned long start, unsigned long end) * @j_proc_entry: procfs entry for the jbd statistics directory * @j_stats: Overall statistics * @j_private: An opaque pointer to fs-private information. + * @j_trans_commit_map: Lockdep entity to track transaction commit dependencies */ struct journal_s @@ -1035,6 +1032,18 @@ struct journal_s /* Precomputed journal UUID checksum for seeding other checksums */ __u32 j_csum_seed; + +#ifdef CONFIG_DEBUG_LOCK_ALLOC + /* + * Lockdep entity to track transaction commit dependencies. Handles + * hold this "lock" for read, when we wait for commit, we acquire the + * "lock" for writing. This matches the properties of jbd2 journalling + * where the running transaction has to wait for all handles to be + * dropped to commit that transaction and also acquiring a handle may + * require transaction commit to finish. + */ + struct lockdep_map j_trans_commit_map; +#endif }; /* journal feature predicate functions */ |