提交 e7cec598 编写于 作者: X Xiaoguang Wang 提交者: Shile Zhang

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: NJoseph Qi <joseph.qi@linux.alibaba.com>
Signed-off-by: NXiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
上级 262a8500
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册