diff --git a/lfs.c b/lfs.c index 9d62462f..170a2aba 100644 --- a/lfs.c +++ b/lfs.c @@ -1113,11 +1113,11 @@ static lfs_ssize_t lfsr_bd_progtag(lfs_t *lfs, /// lfsr_data_t stuff /// -// the top bits of data's size indicates the actual encoding -// 0x0 => buffer pointer -// 0x4 => inlined data -// 0x8 => on-disk reference -// 0xc => concatenated data pointer +// the top 2 bits of data's size indicates the actual encoding +// 0b00 => in-RAM buffer +// 0b01 => a single leb128 +// 0b10 => on-disk reference +// 0b11 => concatenated datas #define LFSR_DATA_ONDISK 0x80000000 #define LFSR_DATA_ISIMM 0x40000000 #define LFSR_DATA_ISCAT 0xc0000000 diff --git a/lfs.h b/lfs.h index 6d2437df..0d282794 100644 --- a/lfs.h +++ b/lfs.h @@ -399,17 +399,11 @@ typedef struct lfs_mdir { // Either an on-disk or in-device data pointer // -// The sign-bit of the size field indicates if the data is -// in-device or on-disk. -// -// After removing the sign bit, the size always encodes the -// resulting size on-disk. -// -// The exact representation of in-device data also depends on the -// mode field: -// - pointer to a RAM-backed buffer -// - inlined data able to fit at least 1 leb128 -// - an array of concatenated datas +// The top 2 bits of data's size indicates the actual encoding +// 0b00 => in-RAM buffer +// 0b01 => a single leb128 +// 0b10 => on-disk reference +// 0b11 => concatenated datas // // Note concatenated datas can only be 1 level deep. Concatenating // concatenated datas would require recursion to resolve.