+/**
+ * Remove optional fields that the client doesn't expect.
+ * This is typically in order to ensure compatibility with older clients.
+ * It is assumed that since we exclusively remove fields, the block will be
+ * big enough to handle the remapped records. It is also assumed that records
+ * of a block have the same format (i.e.: the same features enabled).
+ *
+ * \param[in,out] hdr Header of the block of records to remap.
+ * \param[in,out] last_hdr Last header, don't read past this point.
+ * \param[in] flags Flags describing the fields to keep.
+ */
+static void changelog_block_trim_ext(struct llog_rec_hdr *hdr,
+ struct llog_rec_hdr *last_hdr,
+ enum changelog_rec_flags flags)
+{
+ if (hdr->lrh_type != CHANGELOG_REC)
+ return;
+
+ do {
+ struct changelog_rec *rec = (struct changelog_rec *)(hdr + 1);
+
+ changelog_remap_rec(rec, rec->cr_flags & flags);
+ hdr = llog_rec_hdr_next(hdr);
+ } while ((char *)hdr <= (char *)last_hdr);
+}
+
+/**
+ * Implementation of the llog_operations::lop_next_block
+ *
+ * This function finds the the next llog block to return which contains
+ * record with required index. It is main part of llog processing.
+ *
+ * \param[in] env execution environment
+ * \param[in] loghandle llog handle of the current llog
+ * \param[in,out] cur_idx index preceeding cur_offset
+ * \param[in] next_idx target index to find
+ * \param[in,out] cur_offset furtherst point read in the file
+ * \param[in] buf pointer to data buffer to fill
+ * \param[in] len required len to read, it is
+ * LLOG_CHUNK_SIZE usually.
+ *
+ * \retval 0 on successful buffer read
+ * \retval negative value on error