MEDIUM: task: extend the state field to 32 bits
authorWilly Tarreau <w@1wt.eu>
Tue, 2 Mar 2021 15:09:26 +0000 (16:09 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Thu, 9 Dec 2021 12:53:10 +0000 (13:53 +0100)
commit54ee4a87fa044391d22a79326790335bf8cc55f9
treec5644cb1080f8878c2818170a6756142cb63f843
parent360246c7cae4cfe2a560b2dbf26dc52b7418a6ca
MEDIUM: task: extend the state field to 32 bits

It's been too short for quite a while now and is now full. It's still
time to extend it to 32-bits since we have room for this without
wasting any space, so we now gained 16 new bits for future flags.

The values were not reassigned just in case there would be a few
hidden u16 or short somewhere in which these flags are placed (as
it used to be the case with stream->pending_events).

The patch is tagged MEDIUM because this required to update the task's
process() prototype to use an int instead of a short, that's quite a
bunch of places.

(cherry picked from commit 144f84a09d48e758396ba17f1ddef41b63f30a72)
Add every other prototypes which use a "unsigned short state".
This patch was cherry-picked in 2.3 in order to shut clang warning:
src/mux_h2.c:4085:49: error: implicit conversion from 'int' to 'unsigned short' changes value from -32769 to 32767 [-Werror,-Wconstant-conversion]
        HA_ATOMIC_AND(&h2c->wait_event.tasklet->state, ~TASK_F_USR1);
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
include/haproxy/atomic.h:270:62: note: expanded from macro 'HA_ATOMIC_AND'
                                     ~~~~~~~~~~~~~~~~~~      ^~~~~
Signed-off-by: William Lallemand <wlallemand@haproxy.org>
35 files changed:
include/haproxy/applet.h
include/haproxy/check.h
include/haproxy/connection.h
include/haproxy/extcheck.h
include/haproxy/hlua.h
include/haproxy/proxy.h
include/haproxy/server.h
include/haproxy/stream-t.h
include/haproxy/stream.h
include/haproxy/stream_interface.h
include/haproxy/task-t.h
include/haproxy/task.h
src/applet.c
src/check.c
src/dns.c
src/extcheck.c
src/flt_spoe.c
src/hlua.c
src/listener.c
src/mailers.c
src/mux_fcgi.c
src/mux_h1.c
src/mux_h2.c
src/mux_pt.c
src/peers.c
src/proxy.c
src/server.c
src/session.c
src/sink.c
src/ssl_sock.c
src/stick_table.c
src/stream.c
src/stream_interface.c
src/task.c
src/xprt_handshake.c