search for: get_last_st

Displaying 4 results from an estimated 4 matches for "get_last_st".

2019 Jun 05
2
Re: [PATCH libnbd 4/4] lib: Atomically update h->state when leaving the locked region.
...gt; -#define set_state(h,next_state) ((h)->state) = (next_state) > +#define set_next_state(h,_next_state) ((h)->next_state) = (_next_state) > +#define get_next_state(h) ((h)->next_state) > #define get_state(h) ((h)->state) So I wonder if it's better to rename get_state as get_last_state or get_visible_state? And/or rename get_next_state/set_next_state to get_state/set_state? Ideas welcome to make the code clearer. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fed...
2019 Jun 05
1
Re: [PATCH libnbd 4/4] lib: Atomically update h->state when leaving the locked region.
...->state) = (next_state) >>> +#define set_next_state(h,_next_state) ((h)->next_state) = (_next_state) >>> +#define get_next_state(h) ((h)->next_state) >>> #define get_state(h) ((h)->state) >> >> So I wonder if it's better to rename get_state as get_last_state or >> get_visible_state? > > Or even get_public_state? get_public_state sounds nice (the state that nbd_connection_state will return). > >> And/or rename get_next_state/set_next_state to >> get_state/set_state? If we rename the public state (which implies that it...
2019 Jun 05
0
Re: [PATCH libnbd 4/4] lib: Atomically update h->state when leaving the locked region.
...next_state) ((h)->state) = (next_state) > > +#define set_next_state(h,_next_state) ((h)->next_state) = (_next_state) > > +#define get_next_state(h) ((h)->next_state) > > #define get_state(h) ((h)->state) > > So I wonder if it's better to rename get_state as get_last_state or > get_visible_state? Or even get_public_state? > And/or rename get_next_state/set_next_state to > get_state/set_state? > > Ideas welcome to make the code clearer. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming an...
2019 Jun 05
9
[PATCH libnbd 0/4] lib: Atomically update h->state.
I need to think about this patch series a bit more, but it does at least pass the tests. Rich.