doc/dev/rbd-diff: specify that metadata records come before data

Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
Sage Weil 2013-03-28 21:19:32 -07:00 committed by Josh Durgin
parent 3694968a05
commit 5b0c68b928
2 changed files with 19 additions and 6 deletions

View File

@ -5,15 +5,19 @@ This is a simple streaming file format for representing a diff between
two snapshots (or a snapshot and the head) of an RBD image.
Header
------
~~~~~~
"rbd diff v1\n"
Record
------
Metadata records
~~~~~~~~~~~~~~~~
Every record has a one byte "tag" that identifies the record type, followed by some other
data.
Every record has a one byte "tag" that identifies the record type,
followed by some other data.
Metadata records come in the first part of the image. Order is not
important, as long as all the metadata records come before the data
records.
From snap
---------
@ -35,6 +39,11 @@ Size
u8: 's'
u64: (ending) image size
Data Records
~~~~~~~~~~~~
These records come in the second part of the sequence.
Updated data
------------
@ -50,6 +59,10 @@ u8: 'z'
le64: offset
le64: length
Final Record
~~~~~~~~~~~~
End
---

View File

@ -102,7 +102,7 @@ namespace librbd {
int resize_helper(ImageCtx *ictx, uint64_t size, ProgressContext& prog_ctx);
int snap_create(ImageCtx *ictx, const char *snap_name);
int snap_list(ImageCtx *ictx, std::vector<snap_info_t>& snaps);
bool snap_list(ImageCtx *ictx, const char *snap_name);
bool snap_exists(ImageCtx *ictx, const char *snap_name);
int snap_rollback(ImageCtx *ictx, const char *snap_name,
ProgressContext& prog_ctx);
int snap_remove(ImageCtx *ictx, const char *snap_name);