|
@@ -1462,12 +1462,12 @@ EXPORT_SYMBOL(xfrm_find_acq_byseq);
|
|
u32 xfrm_get_acqseq(void)
|
|
u32 xfrm_get_acqseq(void)
|
|
{
|
|
{
|
|
u32 res;
|
|
u32 res;
|
|
- static u32 acqseq;
|
|
|
|
- static DEFINE_SPINLOCK(acqseq_lock);
|
|
|
|
|
|
+ static atomic_t acqseq;
|
|
|
|
+
|
|
|
|
+ do {
|
|
|
|
+ res = atomic_inc_return(&acqseq);
|
|
|
|
+ } while (!res);
|
|
|
|
|
|
- spin_lock_bh(&acqseq_lock);
|
|
|
|
- res = (++acqseq ? : ++acqseq);
|
|
|
|
- spin_unlock_bh(&acqseq_lock);
|
|
|
|
return res;
|
|
return res;
|
|
}
|
|
}
|
|
EXPORT_SYMBOL(xfrm_get_acqseq);
|
|
EXPORT_SYMBOL(xfrm_get_acqseq);
|