ANDROID: restore some removed refcount functions

Due to the refcount functions being cleaned up and majorly simplified in
5.4.208, a number of previously exported functions that were part of
inline functions were removed and the real functions used instead.  As
those were part of the Android ABI, restore functions for these
"checked" refcount abis so that existing code continues to build
properly, while anything that is rebuilt, will be able to take advantage
of the new inline functions instead.

The functions restored are:
	refcount_inc_checked
	refcount_inc_not_zero_checked
	refcount_dec_checked
	refcount_dec_and_test_checked

Bug: 161946584
Fixes: d0d583484d ("locking/refcount: Consolidate implementations of refcount_t")
Cc: Will Deacon <willdeacon@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ic080315ac173da8b374e0e5f2394cf2b6c1c109c
This commit is contained in:
Greg Kroah-Hartman 2022-07-30 14:46:45 +02:00
parent 380aec8a64
commit 5b72a540b0

View File

@ -184,3 +184,32 @@ bool refcount_dec_and_lock_irqsave(refcount_t *r, spinlock_t *lock,
return true;
}
EXPORT_SYMBOL(refcount_dec_and_lock_irqsave);
/**************************************************************************/
/*
* Android backport use only, due to these functions going away in 5.4.208
* Do not use these in new code, this is only for ABI preservation.
*/
void refcount_inc_checked(refcount_t *r)
{
refcount_inc(r);
}
EXPORT_SYMBOL(refcount_inc_checked);
bool refcount_inc_not_zero_checked(refcount_t *r)
{
return refcount_inc_not_zero(r);
}
EXPORT_SYMBOL(refcount_inc_not_zero_checked);
void refcount_dec_checked(refcount_t *r)
{
refcount_dec(r);
}
EXPORT_SYMBOL(refcount_dec_checked);
bool refcount_dec_and_test_checked(refcount_t *r)
{
return refcount_sub_and_test(1, r);
}
EXPORT_SYMBOL(refcount_dec_and_test_checked);