On Mon, 4 Apr 2016, Waiman Long wrote:
Why notYes, that will certainly make it look nicer. I will update the patch once I+ if ((unsigned int)stat>= pcs->nstats)pstat = get_cpu_ptr(&pcs->stats[stat]);
+ return;
+ preempt_disable();
+ pstat = this_cpu_ptr(&pcs->stats[stat]);
+ *pstat += cnt;
+ preempt_enable();
+}
*pstat += cnt;
put_cpu_ptr(&pcs->stats[stat]);
It will generate identical code but this one uses APIs, making the
intention clearer. But as I said this is just a minor nit.
you can add my Reviewed-by: Nikolay Borisov<kernel@xxxxxxxx> for this
particular patch.
get feedback from my other ext4 patches.
this_cpu_add(pci->stats[stat], cnt)
This is a single instruction on x86.