Merge "zsmalloc: use bit_spin_lock"
This commit is contained in:
commit
88cb62f261
1 changed files with 3 additions and 7 deletions
|
@ -868,21 +868,17 @@ static unsigned long obj_idx_to_offset(struct page *page,
|
|||
|
||||
static inline int trypin_tag(unsigned long handle)
|
||||
{
|
||||
unsigned long *ptr = (unsigned long *)handle;
|
||||
|
||||
return !test_and_set_bit_lock(HANDLE_PIN_BIT, ptr);
|
||||
return bit_spin_trylock(HANDLE_PIN_BIT, (unsigned long *)handle);
|
||||
}
|
||||
|
||||
static void pin_tag(unsigned long handle)
|
||||
{
|
||||
while (!trypin_tag(handle));
|
||||
bit_spin_lock(HANDLE_PIN_BIT, (unsigned long *)handle);
|
||||
}
|
||||
|
||||
static void unpin_tag(unsigned long handle)
|
||||
{
|
||||
unsigned long *ptr = (unsigned long *)handle;
|
||||
|
||||
clear_bit_unlock(HANDLE_PIN_BIT, ptr);
|
||||
bit_spin_unlock(HANDLE_PIN_BIT, (unsigned long *)handle);
|
||||
}
|
||||
|
||||
static void reset_page(struct page *page)
|
||||
|
|
Loading…
Add table
Reference in a new issue