summaryrefslogtreecommitdiffhomepage
path: root/src/compat/padata/padata.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/compat/padata/padata.c')
-rw-r--r--src/compat/padata/padata.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/compat/padata/padata.c b/src/compat/padata/padata.c
index 25836db..ece0ec7 100644
--- a/src/compat/padata/padata.c
+++ b/src/compat/padata/padata.c
@@ -59,7 +59,11 @@ static int padata_cpu_hash(struct parallel_data *pd)
pd->seq_nr++;
spin_unlock(&pd->seq_lock);
#else
+#ifdef CONFIG_PAX_REFCOUNT
+ unsigned int seq_nr = atomic_inc_return_unchecked(&pd->seq_nr);
+#else
unsigned int seq_nr = atomic_inc_return(&pd->seq_nr);
+#endif
cpu_index = seq_nr % cpumask_weight(pd->cpumask.pcpu);
#endif
@@ -427,8 +431,12 @@ static struct parallel_data *padata_alloc_pd(struct padata_instance *pinst,
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
pd->seq_nr = 0;
#else
+#ifdef CONFIG_PAX_REFCOUNT
+ atomic_set_unchecked(&pd->seq_nr, -1);
+#else
atomic_set(&pd->seq_nr, -1);
#endif
+#endif
atomic_set(&pd->reorder_objects, 0);
atomic_set(&pd->refcnt, 0);
pd->pinst = pinst;