Commit 2a7ae342 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] Change atomic_inc to cache_get twice.

parent 67dec770
...@@ -173,7 +173,7 @@ RTN *FNAME ARGS \ ...@@ -173,7 +173,7 @@ RTN *FNAME ARGS \
if (set && !INPLACE && test_bit(CACHE_VALID, &tmp->MEMBER.flags) && !new) \ if (set && !INPLACE && test_bit(CACHE_VALID, &tmp->MEMBER.flags) && !new) \
break; \ break; \
\ \
atomic_inc(&tmp->MEMBER.refcnt); \ cache_get(&tmp->MEMBER); \
if (set) { \ if (set) { \
if (!INPLACE && test_bit(CACHE_VALID, &tmp->MEMBER.flags))\ if (!INPLACE && test_bit(CACHE_VALID, &tmp->MEMBER.flags))\
{ /* need to swap in new */ \ { /* need to swap in new */ \
...@@ -221,7 +221,7 @@ RTN *FNAME ARGS \ ...@@ -221,7 +221,7 @@ RTN *FNAME ARGS \
new = kmalloc(sizeof(*new), GFP_KERNEL); \ new = kmalloc(sizeof(*new), GFP_KERNEL); \
if (new) { \ if (new) { \
cache_init(&new->MEMBER); \ cache_init(&new->MEMBER); \
atomic_inc(&new->MEMBER.refcnt); \ cache_get(&new->MEMBER); \
INIT; \ INIT; \
tmp = new; \ tmp = new; \
goto retry; \ goto retry; \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment