#define JPEG_MARKER_LEN 2 ///< The size in bytes of JPEG marker
#define JPEG_TRAILER_LEN 2 ///< The size in bytes of JPEG trailer
#define CIRCBUF_ALIGNMENT_SIZE 32 ///< Align of CIRCBUF entries
// Switching CHUNK -> SEGMENT
#define PAGE_PHYS 4096 // 512 // alignment size for O_DIRECT, may be different from LBA block size that is 512
enumsegments{
SEGMENT_GLUE,///< pointer to a page-aligned buffer to accommodate over-page of data, trailer, zeros, header and start of the data
SEGMENT_FIRST,///< first (or the only) continuous page-aligned data segment that does not need to be copied (may start with ofset to PAGE_PHYS-aligned)
SEGMENT_SECOND,///< optional second part of the data buffer, end PAGE_PHYS-aligned
SEGMENTS_NUMBER///< Just to get number of segment types