src.ctf.fs: remove ctf_msg_iter_seek_whence parameter to medium ops seek
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 5 Nov 2019 20:18:01 +0000 (15:18 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 15 Nov 2019 21:10:12 +0000 (16:10 -0500)
It is useless, as there is a single value.  If we ever really need to
specify if the given offset is absolute or relative, we can add back a
parameter, as this is an internal API.  In the mean time, it's just an
annoyance.

Change-Id: I3eba79f51d9d5aee82d3bed6ce736459f8dbffa3
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
src/plugins/ctf/common/msg-iter/msg-iter.c
src/plugins/ctf/common/msg-iter/msg-iter.h
src/plugins/ctf/fs-src/data-stream-file.c

index c094acc4c002fcf0b03ec4a348543abc1709d416..a074aafe1814ec0ba948976d04bdf8d50894371b 100644 (file)
@@ -3178,8 +3178,7 @@ enum ctf_msg_iter_status ctf_msg_iter_seek(struct ctf_msg_iter *msg_it,
                goto end;
        }
 
-       medium_status = msg_it->medium.medops.seek(
-               CTF_MSG_ITER_SEEK_WHENCE_SET, offset, msg_it->medium.data);
+       medium_status = msg_it->medium.medops.seek(offset, msg_it->medium.data);
        if (medium_status != CTF_MSG_ITER_MEDIUM_STATUS_OK) {
                if (medium_status == CTF_MSG_ITER_MEDIUM_STATUS_EOF) {
                        status = CTF_MSG_ITER_STATUS_EOF;
index cc5313b1f54eac7a01b555c3e4b6498feb2472cb..9fecf72889e9e7ce795dee236b9a56459c625a8b 100644 (file)
@@ -110,17 +110,6 @@ enum ctf_msg_iter_status {
        CTF_MSG_ITER_STATUS_OK = CTF_MSG_ITER_MEDIUM_STATUS_OK,
 };
 
-/**
- * CTF message iterator seek operation directives.
- */
-enum ctf_msg_iter_seek_whence {
-       /**
-        * Set the iterator's position to an absolute offset in the underlying
-        * medium.
-        */
-       CTF_MSG_ITER_SEEK_WHENCE_SET,
-};
-
 /**
  * Medium operations.
  *
@@ -201,17 +190,13 @@ struct ctf_msg_iter_medium_ops {
         * Repositions the underlying stream's position.
         *
         * This *optional* method repositions the underlying stream
-        * to a given absolute or relative position, as indicated by
-        * the whence directive.
+        * to a given absolute position in the medium.
         *
-        * @param whence        One of #ctf_msg_iter_seek_whence values
         * @param offset        Offset to use for the given directive
         * @param data          User data
         * @returns             One of #ctf_msg_iter_medium_status values
         */
-       enum ctf_msg_iter_medium_status (* seek)(
-                       enum ctf_msg_iter_seek_whence whence,
-                       off_t offset, void *data);
+       enum ctf_msg_iter_medium_status (* seek)(off_t offset, void *data);
 
        /**
         * Returns a stream instance (weak reference) for the given
index 94fe42ac1ab73a3e2baa7b84d1e736556b3e532f..9d9726fdc62840f7c5bd091c18d461b34e9f0bff 100644 (file)
@@ -213,8 +213,7 @@ end:
 }
 
 static
-enum ctf_msg_iter_medium_status medop_seek(enum ctf_msg_iter_seek_whence whence,
-               off_t offset, void *data)
+enum ctf_msg_iter_medium_status medop_seek(off_t offset, void *data)
 {
        enum ctf_msg_iter_medium_status status;
        struct ctf_fs_ds_file *ds_file = data;
@@ -222,11 +221,9 @@ enum ctf_msg_iter_medium_status medop_seek(enum ctf_msg_iter_seek_whence whence,
        bt_self_component *self_comp = ds_file->self_comp;
        bt_logging_level log_level = ds_file->log_level;
 
-       if (whence != CTF_MSG_ITER_SEEK_WHENCE_SET ||
-               offset < 0 || offset > file_size) {
-               BT_COMP_LOGE("Invalid medium seek request: whence=%d, offset=%jd, "
-                               "file-size=%jd", (int) whence, (intmax_t) offset,
-                               (intmax_t) file_size);
+       if (offset < 0 || offset > file_size) {
+               BT_COMP_LOGE("Invalid medium seek request: offset=%jd, file-size=%jd",
+                       (intmax_t) offset, (intmax_t) file_size);
                status = CTF_MSG_ITER_MEDIUM_STATUS_INVAL;
                goto end;
        }
This page took 0.02653 seconds and 4 git commands to generate.