Skip to content

RFC erofs-utils: add dm-persistent file delta support

Yifan Zhao linux-erofs 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2erofs-utils: mkfs: add file-delta frameworkinclude/erofs/internal.h lib/Makefile.am lib/blobchunk.c +7 more+725 -70 replies
2/2erofs-utils: mkfs: support dm-persistent file deltaslib/Makefile.am lib/dm_persistent.c lib/liberofs_dm_persistent.h +2 more+424 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH RFC 0/2] erofs-utils: add dm-persistent file delta support

This series adds a file-delta framework and a dm-persistent backend to mkfs.erofs. Unchanged data is referenced from the parent image; changed nonzero data is stored in the new image.

Example: rootfs/disk.img is the baseline file, and epoch1.cow is a sealed dm-persistent v1 snapshot exception store for that file, using 4096-byte (8-sector) chunks.

  # Create the parent image containing /disk.img.
  mkfs.erofs -Eforce-chunk-indexes --chunksize=4096 \
    parent.erofs rootfs/

  # Apply epoch1.cow to /disk.img and write next.erofs.
  mkfs.erofs -Eforce-chunk-indexes --chunksize=4096 \
    --file-delta=dm-persistent:/disk.img:epoch1.cow \
    next.erofs parent.erofs

  # Check the new image using the parent as its external data device.
  fsck.erofs --device=parent.erofs next.erofs

The update --chunksize must match the exception store's chunk size.

Yifan Zhao (2):
erofs-utils: mkfs: add file-delta framework
erofs-utils: mkfs: support dm-persistent file deltas

 include/erofs/internal.h     |   2 +
 lib/Makefile.am              |   5 +-
 lib/blobchunk.c              |  25 +++
 lib/dm_persistent.c          | 396 +++++++++++++++++++++++++++++++++++
 lib/file_delta.c             | 214 +++++++++++++++++++
 lib/file_delta_chunk.c       | 203 ++++++++++++++++++
 lib/liberofs_chunk.h         |   2 +
 lib/liberofs_dm_persistent.h |   9 +
 lib/liberofs_file_delta.h    |  81 +++++++
 lib/rebuild.c                |  34 ++-
 man/mkfs.erofs.1             |  71 +++++++
 mkfs/main.c                  | 113 +++++++++-
 12 files changed, 1148 insertions(+), 7 deletions(-)
 create mode 100644 lib/dm_persistent.c
 create mode 100644 lib/file_delta.c
 create mode 100644 lib/file_delta_chunk.c
 create mode 100644 lib/liberofs_dm_persistent.h
 create mode 100644 lib/liberofs_file_delta.h

base-commit: 2429baa75a5278ddaf8221740a6a65dd390acb08

Signature · 1 line
2.55.0