[CRIU] [PATCH 4/7] btrfs: Introduce BTRFS engine

Cyrill Gorcunov gorcunov at openvz.org
Wed Dec 4 05:23:34 PST 2013


It is been found that BTRFS uses per subvolume device
numbering scheme  which causes some of our tests to fail
if they are laying on this filesystem.

Here we introduce minimal engine which parses subvolumes
present on mount point.

The interface is two functions

 - btrfs_lazy_parse_subvol: this one parses subvolume
   and chaches the results

 - is_btrfs_subvol: test if device id is laying on subvolume

Note is_btrfs_subvol return false if previously the subvolume
we're inspecting here was not parsed with btrfs_lazy_parse_subvol
call.

In the code we assume that cpu we're running on
is little endian, thus if one day we run on big
ending machine the code must be updated accordingly.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 Makefile.crtools      |   1 +
 include/mount-btrfs.h |  79 ++++++++
 mount-btrfs.c         | 506 ++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 586 insertions(+)
 create mode 100644 include/mount-btrfs.h
 create mode 100644 mount-btrfs.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-btrfs-Introduce-BTRFS-engine.patch
Type: text/x-patch
Size: 13943 bytes
Desc: not available
URL: <http://lists.openvz.org/pipermail/criu/attachments/20131204/e3682526/attachment-0001.bin>


More information about the CRIU mailing list