Commit fa4f00e1 authored by Nils Goroll's avatar Nils Goroll

Skip checks on pointers and work lists when at VSL_ENDMARKER

Safe a couple of needless calls to vslc_vsm_check when we know that
there are no new records and this no need to check shm references /
the next cursor.
parent 35cf7813
......@@ -125,18 +125,6 @@ vslc_vsm_next(const struct VSL_cursor *cursor)
assert(&c->cursor == cursor);
CHECK_OBJ_NOTNULL(c->vsm, VSM_MAGIC);
i = vslc_vsm_check(&c->cursor, &c->next);
if (i <= 0)
/* Overrun */
return (-3);
/* Check VSL fantom and abandonment */
if (*(volatile const uint32_t *)c->next.ptr == VSL_ENDMARKER) {
if (VSM_invalid == VSM_StillValid(c->vsm, &c->vf) ||
VSM_Abandoned(c->vsm))
return (-2);
}
while (1) {
t = *(volatile const uint32_t *)c->next.ptr;
AN(t);
......@@ -151,13 +139,18 @@ vslc_vsm_next(const struct VSL_cursor *cursor)
}
if (t == VSL_ENDMARKER) {
if (VSM_invalid == VSM_StillValid(c->vsm, &c->vf) ||
VSM_Abandoned(c->vsm))
return (-2); /* VSL abandoned */
if (c->options & VSL_COPT_TAILSTOP)
/* EOF */
return (-1);
else
return (0);
return (-1); /* EOF */
return (0); /* No new records available */
}
i = vslc_vsm_check(&c->cursor, &c->next);
if (i <= 0)
return (-3); /* Overrun */
c->cursor.rec = c->next;
c->next.ptr = VSL_NEXT(c->next.ptr);
......
......@@ -1320,18 +1320,18 @@ VSLQ_Dispatch(struct VSLQ *vslq, VSLQ_dispatch_f *func, void *priv)
if (vslq->grouping == VSL_g_raw)
return (vslq_raw(vslq, func, priv));
/* Process next cursor input */
i = vslq_next(vslq);
if (i <= 0)
/* At end of log or cursor reports error condition */
return (i);
/* Check shmref list and buffer if necessary */
r = vslq_shmref_check(vslq);
if (r)
/* Buffering of shm ref failed */
return (r);
/* Process next cursor input */
i = vslq_next(vslq);
if (i < 0)
/* Cursor reports error condition */
return (i);
/* Check vtx timeout */
now = VTIM_mono();
while (!VTAILQ_EMPTY(&vslq->incomplete)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment