Commit 7a9e02d6 authored by Christoph Lameter's avatar Christoph Lameter Committed by Tejun Heo

this_cpu: xfs_icsb_modify_counters does not need "cpu" variable

The xfs_icsb_modify_counters() function no longer needs the cpu variable
if we use this_cpu_ptr() and we can get rid of get/put_cpu().
Acked-by: default avatarTejun Heo <tj@kernel.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Acked-by: default avatarOlaf Weber <olaf@sgi.com>
Signed-off-by: default avatarChristoph Lameter <cl@linux-foundation.org>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent e7dcaa47
...@@ -2389,12 +2389,12 @@ xfs_icsb_modify_counters( ...@@ -2389,12 +2389,12 @@ xfs_icsb_modify_counters(
{ {
xfs_icsb_cnts_t *icsbp; xfs_icsb_cnts_t *icsbp;
long long lcounter; /* long counter for 64 bit fields */ long long lcounter; /* long counter for 64 bit fields */
int cpu, ret = 0; int ret = 0;
might_sleep(); might_sleep();
again: again:
cpu = get_cpu(); preempt_disable();
icsbp = (xfs_icsb_cnts_t *)per_cpu_ptr(mp->m_sb_cnts, cpu); icsbp = this_cpu_ptr(mp->m_sb_cnts);
/* /*
* if the counter is disabled, go to slow path * if the counter is disabled, go to slow path
...@@ -2438,11 +2438,11 @@ xfs_icsb_modify_counters( ...@@ -2438,11 +2438,11 @@ xfs_icsb_modify_counters(
break; break;
} }
xfs_icsb_unlock_cntr(icsbp); xfs_icsb_unlock_cntr(icsbp);
put_cpu(); preempt_enable();
return 0; return 0;
slow_path: slow_path:
put_cpu(); preempt_enable();
/* /*
* serialise with a mutex so we don't burn lots of cpu on * serialise with a mutex so we don't burn lots of cpu on
...@@ -2490,7 +2490,7 @@ xfs_icsb_modify_counters( ...@@ -2490,7 +2490,7 @@ xfs_icsb_modify_counters(
balance_counter: balance_counter:
xfs_icsb_unlock_cntr(icsbp); xfs_icsb_unlock_cntr(icsbp);
put_cpu(); preempt_enable();
/* /*
* We may have multiple threads here if multiple per-cpu * We may have multiple threads here if multiple per-cpu
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment