Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
ext4: clean up compiler warning in start_this_handle()

+27 -19
+27 -19
fs/jbd2/transaction.c
··· 82 82 */ 83 83 84 84 /* 85 + * Update transiaction's maximum wait time, if debugging is enabled. 86 + * 87 + * In order for t_max_wait to be reliable, it must be protected by a 88 + * lock. But doing so will mean that start_this_handle() can not be 89 + * run in parallel on SMP systems, which limits our scalability. So 90 + * unless debugging is enabled, we no longer update t_max_wait, which 91 + * means that maximum wait time reported by the jbd2_run_stats 92 + * tracepoint will always be zero. 93 + */ 94 + static inline void update_t_max_wait(transaction_t *transaction) 95 + { 96 + #ifdef CONFIG_JBD2_DEBUG 97 + unsigned long ts = jiffies; 98 + 99 + if (jbd2_journal_enable_debug && 100 + time_after(transaction->t_start, ts)) { 101 + ts = jbd2_time_diff(ts, transaction->t_start); 102 + spin_lock(&transaction->t_handle_lock); 103 + if (ts > transaction->t_max_wait) 104 + transaction->t_max_wait = ts; 105 + spin_unlock(&transaction->t_handle_lock); 106 + } 107 + #endif 108 + } 109 + 110 + /* 85 111 * start_this_handle: Given a handle, deal with any locking or stalling 86 112 * needed to make sure that there is enough journal space for the handle 87 113 * to begin. Attach the handle to a transaction and set up the ··· 121 95 int needed; 122 96 int nblocks = handle->h_buffer_credits; 123 97 transaction_t *new_transaction = NULL; 124 - unsigned long ts = jiffies; 125 98 126 99 if (nblocks > journal->j_max_transaction_buffers) { 127 100 printk(KERN_ERR "JBD: %s wants too many credits (%d > %d)\n", ··· 266 241 267 242 /* OK, account for the buffers that this operation expects to 268 243 * use and add the handle to the running transaction. 269 - * 270 - * In order for t_max_wait to be reliable, it must be 271 - * protected by a lock. But doing so will mean that 272 - * start_this_handle() can not be run in parallel on SMP 273 - * systems, which limits our scalability. So we only enable 274 - * it when debugging is enabled. We may want to use a 275 - * separate flag, eventually, so we can enable this 276 - * independently of debugging. 277 244 */ 278 - #ifdef CONFIG_JBD2_DEBUG 279 - if (jbd2_journal_enable_debug && 280 - time_after(transaction->t_start, ts)) { 281 - ts = jbd2_time_diff(ts, transaction->t_start); 282 - spin_lock(&transaction->t_handle_lock); 283 - if (ts > transaction->t_max_wait) 284 - transaction->t_max_wait = ts; 285 - spin_unlock(&transaction->t_handle_lock); 286 - } 287 - #endif 245 + update_t_max_wait(transaction); 288 246 handle->h_transaction = transaction; 289 247 atomic_inc(&transaction->t_updates); 290 248 atomic_inc(&transaction->t_handle_count);