pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/41700?usp=email )

Change subject: gsmtap_util: Get rid of unused wq
......................................................................

gsmtap_util: Get rid of unused wq

struct gsmtap_inst went private in
1584b2ac39292aedddb8abd165957912fe9399c0 and
f38077ee6ab429ef3f0881a8ca7de4877032358a, which were merged prior to
libosmocore release 1.10.0. That release bumped the LIBVERSION major
counter, and hence that struct is officially not available and protected
by LIBVERSION ABI since then.

That means we can safely remove it from the implementation since nobody
compiled against this libversion should be using those fields directly anymore.

Related: OS#6213
Change-Id: I4f1cf168c230471a6d7be4bb065d7105a993349f
---
M src/core/gsmtap_util.c
1 file changed, 8 insertions(+), 23 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved
  osmith: Looks good to me, but someone else must approve
  fixeria: Looks good to me, but someone else must approve
  daniel: Looks good to me, but someone else must approve




diff --git a/src/core/gsmtap_util.c b/src/core/gsmtap_util.c
index 62d3ffa..d6a9752 100644
--- a/src/core/gsmtap_util.c
+++ b/src/core/gsmtap_util.c
@@ -47,28 +47,14 @@
  *
  * \file gsmtap_util.c */

-/*! one gsmtap instance
- *  Until gsmtap_inst_fd() is removed from the API at some point in the 
future, we have to keep the first member as
- *  'int' and the second as 'struct osmo_wqueue' (this effectively makes sure 
that the struct member wq.bfd.fd maintains
- *  the same memory offset from the start of the struct) to ensure that 
inlined static 'instances' of gsmtap_inst_fd() in
- *  old binaries keep working the way they used to even with gsmtap_inst 
objects obtained from newer versions of libosmocore */
+/*! one gsmtap instance */
 struct gsmtap_inst {
-       int osmo_io_mode;         /*!< Indicates whether or not to use Osmo IO 
mode for message output (thus enabling use of tx queues).
-                                  *   This field member may not be changed or 
moved (backwards compatibility) */
-       struct osmo_wqueue wq;    /*!< the wait queue. This field member may 
not be changed or moved (backwards compatibility) */
-
-       struct osmo_io_fd *out;   /*!< Used when osmo_io_mode is nonzero */
+       int osmo_io_mode;        /*!< Indicates whether or not to use Osmo IO 
mode for message output (thus enabling use of tx queues) */
+       int source_fd;          /*!< the gsmtap source FD */
+       struct osmo_io_fd *out; /*!< Used when osmo_io_mode is nonzero */
        int sink_fd;
 };

-struct _gsmtap_inst_legacy {
-       int ofd_wq_mode;
-       struct osmo_wqueue wq;
-       struct osmo_fd sink_ofd;
-};
-osmo_static_assert(offsetof(struct gsmtap_inst, wq) == offsetof(struct 
_gsmtap_inst_legacy, wq),
-                  gsmtap_inst_new_wq_offset_equals_legacy_wq_offset);
-
 /*! Deprecated, use gsmtap_inst_fd2() instead
  *  \param[in] gti GSMTAP instance
  *  \returns file descriptor of GSMTAP instance */
@@ -82,7 +68,7 @@
  *  \returns file descriptor of GSMTAP instance */
 int gsmtap_inst_fd2(const struct gsmtap_inst *gti)
 {
-       return gti->wq.bfd.fd;
+       return gti->source_fd;
 }

 /*! convert RSL channel number to GSMTAP channel type
@@ -485,15 +471,14 @@

        gti = talloc_zero(NULL, struct gsmtap_inst);
        gti->osmo_io_mode = ofd_wq_mode;
-       /* Still using the wq member for its 'fd' field only, since we are 
keeping it for now, anyways  */
-       gti->wq.bfd.fd = fd;
+       gti->source_fd = fd;
        gti->sink_fd = -1;

        if (ofd_wq_mode) {
-               gti->out = osmo_iofd_setup(gti, gti->wq.bfd.fd, 
"gsmtap_inst.io_fd", OSMO_IO_FD_MODE_READ_WRITE, &gsmtap_ops, NULL);
+               gti->out = osmo_iofd_setup(gti, gti->source_fd, 
"gsmtap_inst.io_fd", OSMO_IO_FD_MODE_READ_WRITE, &gsmtap_ops, NULL);
                if (gti->out == NULL)
                        goto err_cleanup;
-               if (osmo_iofd_register(gti->out, gti->wq.bfd.fd) < 0)
+               if (osmo_iofd_register(gti->out, gti->source_fd) < 0)
                        goto err_cleanup;

                /* Use a big enough tx queue to avoid gsmtap messages being 
dropped: */

--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41700?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: I4f1cf168c230471a6d7be4bb065d7105a993349f
Gerrit-Change-Number: 41700
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <[email protected]>
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>

Reply via email to