Project

General

Profile

Actions

Feature #9954

closed

buffer: method to ensure an extent is contiguous

Added by Sage Weil over 9 years ago. Updated over 9 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
Development
Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:

Description

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.


Related issues 1 (0 open1 closed)

Blocks Ceph - Feature #9953: osd: efficient ObjectStore::Transaction encodingResolvedHaomai Wang

Actions
Actions

Also available in: Atom PDF