diff options
author | Jens Axboe <axboe@kernel.dk> | 2024-03-11 13:40:22 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-03-11 13:40:22 -0600 |
commit | 84e19c9ac84d96c07784735d67b5f051b031d8de (patch) | |
tree | 76db12ef23edd5621899a61c98efb0c71780a3f8 | |
parent | 4ec1f37c934fdc90cf968492b6ea11de874ae22c (diff) | |
download | liburing-84e19c9ac84d96c07784735d67b5f051b031d8de.tar.gz |
examples/proxy: drop (now) unused list code
We do deferred non-sendmsg sends smarter now, get rid of this now
unused stuff.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | examples/list.h | 61 | ||||
-rw-r--r-- | examples/proxy.c | 10 |
2 files changed, 0 insertions, 71 deletions
diff --git a/examples/list.h b/examples/list.h deleted file mode 100644 index 5642235f..00000000 --- a/examples/list.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef LIBURING_EX_LIST_H -#define LIBURING_EX_LIST_H - -struct list_head { - struct list_head *prev, *next; -}; - -#ifndef offsetof -#define offsetof(TYPE, FIELD) ((size_t) &((TYPE *)0)->FIELD) -#endif - -#ifndef container_of -#define container_of(PTR, TYPE, FIELD) ({ \ - __typeof__(((TYPE *)0)->FIELD) *__FIELD_PTR = (PTR); \ - (TYPE *)((char *) __FIELD_PTR - offsetof(TYPE, FIELD)); \ -}) -#endif - -static inline void init_list_head(struct list_head *list) -{ - list->next = list; - list->prev = list; -} - -static inline void __list_add(struct list_head *new, struct list_head *prev, - struct list_head *next) -{ - next->prev = new; - new->next = next; - new->prev = prev; - prev->next = new; -} - -static inline void list_add_tail(struct list_head *new, struct list_head *head) -{ - __list_add(new, head->prev, head); -} - -static inline void __list_del(struct list_head *prev, struct list_head *next) -{ - next->prev = prev; - prev->next = next; -} - -static inline void list_del(struct list_head *entry) -{ - __list_del(entry->prev, entry->next); -} - -static inline bool list_empty(struct list_head *list) -{ - return list->next == list; -} - -#define list_entry(ptr, type, member) \ - container_of(ptr, type, member) - -#define list_first_entry(ptr, type, member) \ - list_entry((ptr)->next, type, member) - -#endif diff --git a/examples/proxy.c b/examples/proxy.c index 37ca812f..df9c156b 100644 --- a/examples/proxy.c +++ b/examples/proxy.c @@ -47,7 +47,6 @@ #include <liburing.h> #include "proxy.h" -#include "list.h" #include "helpers.h" /* @@ -97,13 +96,6 @@ static int br_mask; static int ring_size = 128; -struct pending_send { - struct list_head list; - - int fd, bid, len; - void *data; -}; - /* * For sendmsg/recvmsg. recvmsg just has a single vec, sendmsg will have * two vecs - one that is currently submitted and being sent, and one that @@ -140,7 +132,6 @@ struct conn_dir { int pending_shutdown; int pending_send; int pending_recv; - struct list_head send_list; int out_buffers; @@ -826,7 +817,6 @@ static int handle_accept(struct io_uring *ring, struct io_uring_cqe *cqe) struct conn_dir *cd = &c->cd[i]; cd->index = i; - init_list_head(&cd->send_list); cd->snd_next_bid = -1; cd->rcv_next_bid = -1; init_msgs(cd); |