Skip to content

Commit 1df3806

Browse files
committed
os/bluestore: Some in-code documentation for Onode / blob
Signed-off-by: Adam Kupczyk <[email protected]>
1 parent 1caadd7 commit 1df3806

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

src/os/bluestore/BlueStore.cc

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3641,6 +3641,54 @@ BlueStore::BlobRef BlueStore::ExtentMap::split_blob(
36413641
}
36423642

36433643
// Onode
3644+
//
3645+
// Mapping blobs over Onode's logical offsets.
3646+
//
3647+
// Blob is always continous. Blobs may overlap.
3648+
// Non-mapped regions are "0" when read.
3649+
// 1 2 3
3650+
// 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
3651+
// <blob.a.blob.a><blob.b.blo> <blob.c.blob.c.blob.c.blob>
3652+
// <blob.d.blob.d.b> <blob.e.blob.e>
3653+
// blob.a starts at 0x0 length 0xe
3654+
// blob.b starts at 0xf length 0xb
3655+
// blob.c starts at 0x23 length 0x1b
3656+
// blob.d starts at 0x06 length 0x12
3657+
// blob.e starts at 0x2d length 0xf
3658+
//
3659+
// Blobs can have non-encoded parts:
3660+
// 1 2 3
3661+
// 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
3662+
// aaaaaa......aaabbbbb...bbbb ccccccccccccccc..........cc
3663+
// dddddd........ddd .....eeeeeeeeee
3664+
// "." - non-encoded parts of blob (holes)
3665+
//
3666+
// Mapping logical to blob:
3667+
// extent_map maps {Onode's logical offset, length}=>{Blob, in-blob offset}
3668+
// {0x0, 0x6}=>{blob.a, 0x0}
3669+
// {0x6, 0x6}=>{blob.d, 0x0}
3670+
// {0xc, 0x3}=>{blob.a, 0xc}
3671+
// {0xf, 0x5}=>{blob.b, 0x0}
3672+
// {0x14, 0x3}=>{blob.d, 0xe}
3673+
// {0x17, 0x4}=>{blob.b, 0x8}
3674+
// a hole here
3675+
// {0x23, 0xe}=>{blob.c, 0x0}
3676+
// and so on...
3677+
//
3678+
// Compressed blobs do not have non-encoded parts.
3679+
// Same example as above but all blobs are compressed:
3680+
// 1 2 3
3681+
// 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
3682+
// aaaaaaAAAAAAaaabbbbbBBBbbbb cccccccccccccccCCCCCCCCCCcc
3683+
// ddddddDDDDDDDDddd EEEEEeeeeeeeeee
3684+
// A-E: parts of blobs that are never used.
3685+
// This can happen when a compressed blob is overwritten partially.
3686+
// The target ranges are no longer used, but are left there because they are necessary
3687+
// for successful decompression.
3688+
//
3689+
// In compressed blobs PExtentVector and csum refer to actually occupied disk space.
3690+
// Blob's logical length is larger then occupied disk space.
3691+
// Mapping from extent_map always uses offsets of decompressed data.
36443692

36453693
#undef dout_prefix
36463694
#define dout_prefix *_dout << "bluestore.onode(" << this << ")." << __func__ << " "

0 commit comments

Comments
 (0)