[CRIU] [PATCH 4/7] btrfs: Introduce BTRFS engine
Pavel Emelyanov
xemul at parallels.com
Wed Dec 4 05:47:06 PST 2013
On 12/04/2013 05:23 PM, Cyrill Gorcunov wrote:
>
> 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
>
> + BUG_ON(m->private);
> + m->private = (void *)result;
> + btrfs_show_subvolumes(r);
That's the only place where mi->private is used. IOW -- it's now write-only field.
More information about the CRIU
mailing list