Commit 71f7f754 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

atomic: Use atomic_read instead of atomic_get

To switch to kernel's style.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 56cb0f8b
......@@ -16,11 +16,6 @@ static inline int atomic_read(const atomic_t *v)
return (*(volatile int *)&(v)->counter);
}
/*
* FIXME Use atomic_read instead of atomic_get all over the code
*/
#define atomic_get atomic_read
static inline void atomic_set(atomic_t *v, int i)
{
v->counter = i;
......
......@@ -21,7 +21,7 @@ typedef struct {
/* Get current futex @f value */
static inline u32 futex_get(futex_t *f)
{
return atomic_get(&f->raw);
return atomic_read(&f->raw);
}
/* Set futex @f value to @v */
......@@ -39,7 +39,7 @@ static inline void futex_set(futex_t *f, u32 v)
u32 tmp; \
\
while (1) { \
tmp = (u32)atomic_get(&(__f)->raw); \
tmp = (u32)atomic_read(&(__f)->raw); \
if ((tmp & FUTEX_ABORT_FLAG) || \
(tmp __cond (__v))) \
break; \
......@@ -102,7 +102,7 @@ static inline void futex_wait_while_eq(futex_t *f, u32 v)
/* Wait while futex @f value is @v */
static inline void futex_wait_while(futex_t *f, u32 v)
{
while ((u32)atomic_get(&f->raw) == v) {
while ((u32)atomic_read(&f->raw) == v) {
int ret = sys_futex((u32 *)&f->raw.counter, FUTEX_WAIT, v, NULL, NULL, 0);
BUG_ON(ret < 0 && ret != -EWOULDBLOCK);
}
......
......@@ -128,8 +128,8 @@ void write_stats(int what)
} else if (what == RESTORE_STATS) {
stats.restore = &rs_entry;
rs_entry.pages_compared = atomic_get(&rstats->counts[CNT_PAGES_COMPARED]);
rs_entry.pages_skipped_cow = atomic_get(&rstats->counts[CNT_PAGES_SKIPPED_COW]);
rs_entry.pages_compared = atomic_read(&rstats->counts[CNT_PAGES_COMPARED]);
rs_entry.pages_skipped_cow = atomic_read(&rstats->counts[CNT_PAGES_SKIPPED_COW]);
encode_time(TIME_FORK, &rs_entry.forking_time);
encode_time(TIME_RESTORE, &rs_entry.restore_time);
......
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