summaryrefslogtreecommitdiff
path: root/kernel/queue.c
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2024-07-08 21:37:15 +0200
committerAnton Kling <anton@kling.gg>2024-07-08 21:37:15 +0200
commite49d2a9fa5a485c33a250ce843d44fc6dedea8b5 (patch)
tree4be00773adca0b6c59da6d07602338ff538a7199 /kernel/queue.c
parent35292a486c2b44862cac6887441d6fa18148b249 (diff)
Kernel/Net: Don't use kmalloc to create send buffers
Current method is also really bad since it uses multiple copies when it should instead just copy to the send buffer of the network card directly. But I have other things that I want to prioritize first.
Diffstat (limited to 'kernel/queue.c')
-rw-r--r--kernel/queue.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/kernel/queue.c b/kernel/queue.c
index 6d4209d..e1b2943 100644
--- a/kernel/queue.c
+++ b/kernel/queue.c
@@ -43,6 +43,13 @@ int queue_get_entries(struct queue_list *list, struct queue_entry *events,
}
}
}
+ if (QUEUE_WAIT_CLOSE & entry->listen) {
+ if (ptr->inode->_is_open) {
+ if (!ptr->inode->_is_open(ptr->inode)) {
+ should_add = 1;
+ }
+ }
+ }
if (should_add) {
if (events) {
memcpy(events + rc, entry, sizeof(struct queue_entry));
@@ -130,7 +137,7 @@ int queue_mod_entries(int fd, int flag, struct queue_entry *entries,
}
for (int j = 0; j < num_entries; j++) {
if (entry->fd == entries[j].fd) {
- relist_remove(&list->entries, i);
+ assert(relist_remove(&list->entries, i));
kfree(entry);
break;
}