kernel: resolving a handle now increments the refcount of the corresponding object

This commit is contained in:
2026-03-12 20:42:05 +00:00
parent 5a37b5e148
commit 6ba236b2fe
5 changed files with 7 additions and 39 deletions

View File

@@ -92,9 +92,6 @@ kern_status_t sys_port_connect(
return status;
}
/* add a reference to the port object to make sure it isn't deleted
* while we're using it */
object_ref(port_obj);
struct port *port = port_cast(port_obj);
task_unlock_irqrestore(self, flags);
@@ -117,7 +114,6 @@ kern_status_t sys_port_connect(
port_lock_irqsave(port, &flags);
status = port_connect(port, remote);
port_unlock_irqrestore(port, flags);
object_unref(port_obj);
object_unref(&remote->c_base);
return KERN_OK;
@@ -141,9 +137,6 @@ kern_status_t sys_port_disconnect(kern_handle_t port_handle)
return status;
}
/* add a reference to the port object to make sure it isn't deleted
* while we're using it */
object_ref(port_obj);
task_unlock_irqrestore(self, flags);
struct port *port = port_cast(port_obj);
@@ -251,9 +244,6 @@ kern_status_t sys_msg_send(
return status;
}
/* add a reference to the port object to make sure it isn't deleted
* while we're using it */
object_ref(port_obj);
task_unlock_irqrestore(self, flags);
struct port *port = port_cast(port_obj);
@@ -293,9 +283,6 @@ kern_status_t sys_msg_recv(kern_handle_t channel_handle, kern_msg_t *out_msg)
return status;
}
/* add a reference to the port object to make sure it isn't deleted
* while we're using it */
object_ref(channel_obj);
task_unlock_irqrestore(self, flags);
struct channel *channel = channel_cast(channel_obj);
@@ -338,9 +325,6 @@ kern_status_t sys_msg_reply(
return status;
}
/* add a reference to the port object to make sure it isn't deleted
* while we're using it */
object_ref(channel_obj);
task_unlock_irqrestore(self, flags);
struct channel *channel = channel_cast(channel_obj);
@@ -390,9 +374,6 @@ kern_status_t sys_msg_read(
return status;
}
/* add a reference to the port object to make sure it isn't deleted
* while we're using it */
object_ref(channel_obj);
task_unlock_irqrestore(self, flags);
struct channel *channel = channel_cast(channel_obj);
@@ -450,9 +431,6 @@ kern_status_t sys_msg_write(
return status;
}
/* add a reference to the port object to make sure it isn't deleted
* while we're using it */
object_ref(channel_obj);
task_unlock_irqrestore(self, flags);
struct channel *channel = channel_cast(channel_obj);