diff options
Diffstat (limited to 'include/linux/jbd2.h')
-rw-r--r-- | include/linux/jbd2.h | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index efb232c5f668..dfaa1f4dcb0c 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
@@ -491,10 +491,6 @@ struct jbd2_journal_handle | |||
491 | 491 | ||
492 | unsigned long h_start_jiffies; | 492 | unsigned long h_start_jiffies; |
493 | unsigned int h_requested_credits; | 493 | unsigned int h_requested_credits; |
494 | |||
495 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
496 | struct lockdep_map h_lockdep_map; | ||
497 | #endif | ||
498 | }; | 494 | }; |
499 | 495 | ||
500 | 496 | ||
@@ -793,6 +789,7 @@ jbd2_time_diff(unsigned long start, unsigned long end) | |||
793 | * @j_proc_entry: procfs entry for the jbd statistics directory | 789 | * @j_proc_entry: procfs entry for the jbd statistics directory |
794 | * @j_stats: Overall statistics | 790 | * @j_stats: Overall statistics |
795 | * @j_private: An opaque pointer to fs-private information. | 791 | * @j_private: An opaque pointer to fs-private information. |
792 | * @j_trans_commit_map: Lockdep entity to track transaction commit dependencies | ||
796 | */ | 793 | */ |
797 | 794 | ||
798 | struct journal_s | 795 | struct journal_s |
@@ -1035,8 +1032,26 @@ struct journal_s | |||
1035 | 1032 | ||
1036 | /* Precomputed journal UUID checksum for seeding other checksums */ | 1033 | /* Precomputed journal UUID checksum for seeding other checksums */ |
1037 | __u32 j_csum_seed; | 1034 | __u32 j_csum_seed; |
1035 | |||
1036 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
1037 | /* | ||
1038 | * Lockdep entity to track transaction commit dependencies. Handles | ||
1039 | * hold this "lock" for read, when we wait for commit, we acquire the | ||
1040 | * "lock" for writing. This matches the properties of jbd2 journalling | ||
1041 | * where the running transaction has to wait for all handles to be | ||
1042 | * dropped to commit that transaction and also acquiring a handle may | ||
1043 | * require transaction commit to finish. | ||
1044 | */ | ||
1045 | struct lockdep_map j_trans_commit_map; | ||
1046 | #endif | ||
1038 | }; | 1047 | }; |
1039 | 1048 | ||
1049 | #define jbd2_might_wait_for_commit(j) \ | ||
1050 | do { \ | ||
1051 | rwsem_acquire(&j->j_trans_commit_map, 0, 0, _THIS_IP_); \ | ||
1052 | rwsem_release(&j->j_trans_commit_map, 1, _THIS_IP_); \ | ||
1053 | } while (0) | ||
1054 | |||
1040 | /* journal feature predicate functions */ | 1055 | /* journal feature predicate functions */ |
1041 | #define JBD2_FEATURE_COMPAT_FUNCS(name, flagname) \ | 1056 | #define JBD2_FEATURE_COMPAT_FUNCS(name, flagname) \ |
1042 | static inline bool jbd2_has_feature_##name(journal_t *j) \ | 1057 | static inline bool jbd2_has_feature_##name(journal_t *j) \ |