Project

General

Profile

Feature #9954

Updated by Sage Weil over 9 years ago

Add a method to assure that an extent in a bufferlist is contigous. Something like 

 bufferlist bl; 

 ... 

 char *ptr = bl.make_contiguous(offset, length); 

 If it is already contiguous, return a pointer to the position at offset. 

 If it is not contiguous, reallocate that range of the buffer (or do a full rebuild()).    Then return a pointer to the offset. 

 After this call, it's safe to use ptr directly for up to length bytes from the start position.

Back