pespin has submitted this change. (
https://gerrit.osmocom.org/c/libosmocore/+/39070?usp=email )
Change subject: osmo_io: close() op in backend only takes care of closing
......................................................................
osmo_io: close() op in backend only takes care of closing
Move dependent steps such as unregister to be done at the common path,
and leave the close() op on each backend to implement only the specific
close operations.
Change-Id: I0150afcc0b83ea8b2d00d108658ed688ce487f7f
---
M src/core/osmo_io.c
M src/core/osmo_io_poll.c
M src/core/osmo_io_uring.c
3 files changed, 4 insertions(+), 5 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
osmith: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c
index cef9bec..387cefb 100644
--- a/src/core/osmo_io.c
+++ b/src/core/osmo_io.c
@@ -845,6 +845,10 @@
iofd->pending = NULL;
+ osmo_iofd_ops.read_disable(iofd);
+ osmo_iofd_ops.write_disable(iofd);
+ osmo_iofd_unregister(iofd);
+
rc = osmo_iofd_ops.close(iofd);
iofd->fd = -1;
return rc;
diff --git a/src/core/osmo_io_poll.c b/src/core/osmo_io_poll.c
index 89ff466..92f03f8 100644
--- a/src/core/osmo_io_poll.c
+++ b/src/core/osmo_io_poll.c
@@ -156,9 +156,7 @@
static int iofd_poll_close(struct osmo_io_fd *iofd)
{
- iofd_poll_unregister(iofd);
osmo_fd_close(&iofd->u.poll.ofd);
-
return 0;
}
diff --git a/src/core/osmo_io_uring.c b/src/core/osmo_io_uring.c
index be7e1d8..72a465e 100644
--- a/src/core/osmo_io_uring.c
+++ b/src/core/osmo_io_uring.c
@@ -507,9 +507,6 @@
static int iofd_uring_close(struct osmo_io_fd *iofd)
{
- iofd_uring_read_disable(iofd);
- iofd_uring_write_disable(iofd);
- iofd_uring_unregister(iofd);
return close(iofd->fd);
}
--
To view, visit
https://gerrit.osmocom.org/c/libosmocore/+/39070?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I0150afcc0b83ea8b2d00d108658ed688ce487f7f
Gerrit-Change-Number: 39070
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>