assert(f);
assert(ret);
- /* This function may clear, overwrite, or alter previously cached entries. After this function has
- * been called, all objects except for one obtained by this function are invalidated and must be
- * re-read before use. */
+ /* This function may clear, overwrite, or alter previously cached entries with the same type. After
+ * this function has been called, all previously read objects with the same type may be invalidated,
+ * hence must be re-read before use. */
if (size <= 0)
return -EINVAL;
assert(f);
- /* Even if this function fails, it may clear, overwrite, or alter previously cached entries. After
- * this function has been called, all objects except for one obtained by this function are
- * invalidated and must be re-read before use.. */
+ /* Even if this function fails, it may clear, overwrite, or alter previously cached entries with the
+ * same type. After this function has been called, all previously read objects with the same type may
+ * be invalidated, hence must be re-read before use. */
/* Objects may only be located at multiple of 64 bit */
if (!VALID64(offset))
r = journal_file_data_payload(from, NULL, q, NULL, 0, 0, &data, &l);
if (IN_SET(r, -EADDRNOTAVAIL, -EBADMSG)) {
log_debug_errno(r, "Entry item %"PRIu64" data object is bad, skipping over it: %m", i);
- goto next;
+ continue;
}
if (r < 0)
return r;
.object_offset = h,
.hash = le64toh(u->data.hash),
};
-
- next:
- /* The above journal_file_data_payload() may clear or overwrite cached object. Hence, we need
- * to re-read the object from the cache. */
- r = journal_file_move_to_object(from, OBJECT_ENTRY, p, &o);
- if (r < 0)
- return r;
}
if (m == 0)
p = journal_file_entry_item_object_offset(f, o, i);
r = journal_file_data_payload(f, NULL, p, field, field_length, j->data_threshold, &d, &l);
if (r == 0)
- goto next;
+ continue;
if (IN_SET(r, -EADDRNOTAVAIL, -EBADMSG)) {
log_debug_errno(r, "Entry item %"PRIu64" data object is bad, skipping over it: %m", i);
- goto next;
+ continue;
}
if (r < 0)
return r;
*size = l;
return 0;
-
- next:
- /* journal_file_data_payload() may clear or overwrite cached object. */
- r = journal_file_move_to_object(f, OBJECT_ENTRY, f->current_offset, &o);
- if (r < 0)
- return r;
}
return -ENOENT;
r = journal_file_data_payload(f, NULL, p, NULL, 0, j->data_threshold, &d, &l);
if (IN_SET(r, -EADDRNOTAVAIL, -EBADMSG)) {
log_debug_errno(r, "Entry item %"PRIu64" data object is bad, skipping over it: %m", j->current_field);
- goto next;
+ continue;
}
if (r < 0)
return r;
j->current_field++;
return 1;
-
- next:
- /* journal_file_data_payload() may clear or overwrite cached object. */
- r = journal_file_move_to_object(f, OBJECT_ENTRY, f->current_offset, &o);
- if (r < 0)
- return r;
}
return 0;