From e7cec59860c0c06eb14d4f30c826d0d013062869 Mon Sep 17 00:00:00 2001 From: Xiaoguang Wang Date: Thu, 6 Feb 2020 14:47:01 +0800 Subject: [PATCH] alinux: jbd2: fix build errors Fix below build errors, 'wait_sum' and 'iowait_sum' need CONFIG_SCHEDSTATS to be configured. fs/jbd2/transaction.c: In function 'new_handle': fs/jbd2/transaction.c:406:51: error: 'struct sched_statistics' has no member named 'wait_sum' handle->h_sched_wait_sum = current->se.statistics.wait_sum; fs/jbd2/transaction.c:407:48: error: 'struct sched_statistics' has no member named 'iowait_sum' handle->h_io_wait_sum = current->se.statistics.iowait_sum; fs/jbd2/transaction.c: In function 'jbd2_journal_stop': fs/jbd2/transaction.c:1790:38: error: 'struct sched_statistics' has no member named 'wait_sum' sched_wait = current->se.statistics.wait_sum - fs/jbd2/transaction.c:1792:35: error: 'struct sched_statistics' has no member named 'iowait_sum' io_wait = current->se.statistics.iowait_sum - Fixes: 67393bb9f538 ("alinux: jbd2: track slow handle which is preventing transaction committing") Reviewed-by: Joseph Qi Signed-off-by: Xiaoguang Wang --- fs/jbd2/transaction.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c index cd5a879c8cbe..55b60c4bd54d 100644 --- a/fs/jbd2/transaction.c +++ b/fs/jbd2/transaction.c @@ -403,8 +403,10 @@ static handle_t *new_handle(int nblocks) handle->h_buffer_credits = nblocks; handle->h_ref = 1; handle->h_pre_start_jiffies = jiffies; +#ifdef CONFIG_SCHEDSTATS handle->h_sched_wait_sum = current->se.statistics.wait_sum; handle->h_io_wait_sum = current->se.statistics.iowait_sum; +#endif return handle; } @@ -1821,10 +1823,15 @@ int jbd2_journal_stop(handle_t *handle) journal_space_wait = handle->h_start_jiffies - handle->h_pre_start_jiffies; +#ifdef CONFIG_SCHEDSTATS sched_wait = current->se.statistics.wait_sum - handle->h_sched_wait_sum; io_wait = current->se.statistics.iowait_sum - handle->h_io_wait_sum; +#else + sched_wait = 0; + io_wait = 0; +#endif trace_jbd2_slow_handle_stats(journal->j_fs_dev->bd_dev, transaction->t_tid, handle->h_type, handle->h_line_no, jiffies - handle->h_start_jiffies, handle->h_sync, -- GitLab