mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
atomic: Use atomic_read instead of atomic_get
To switch to kernel's style. Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
56cb0f8baf
commit
71f7f7546c
3 changed files with 5 additions and 10 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
4
stats.c
4
stats.c
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue