-
Split bdev into modules: overlay · 38683db4Christian Brauner authored
With this commit we start to split bdev.{c,h} into modules located in the subfolder bdev. We start by creating a module for overlay: overlay.{c,h}. - The functions: - overlayfs_detect() - overlayfs_mount() - overlayfs_umount() - overlayfs_clonepaths() - overlayfs_destroy() - overlayfs_create() move from bdev.{c,h} to overlay.{c,h}. The only thing that remains in bdev.c is the static definition of - static const struct bdev_ops overlayfs_ops - The functions: - update_ovl_paths() - overlay_getlower() move from lxccontainer.c to overlay.{c,h}. update_ovl_paths() is used to update absolute paths for overlay lxc.mount.entry entries but it seems to fit more here than into lxccontainer.c. The Function overlay_getlower() is used to extract the lower directory for overlay (and aufs) rootfs. It should at some point become a common helper. - The functions: - do_rsync() - dir_new_path() remain in bdev.c for now but become extern. We declare them extern in overlay.c to be able to call them. As the comment to them correctly notices, they should at some point become common helpers and probably move to utils.{c,h} or some other more appropriate place. - The structs: - struct bdev; /* defined in bdev.h */ - struct bdev_specs; /* defined in lxccontainer.h */ - struct lxc_conf; /* defined conf.h */ are forward declared/put as incomplete types in overlay.h so that the functions have access to it. - The header overlay.h is *not* included in bdev.h but only in bdev.c so that when bdev.h is included the public functions in overlay.h cannot be accessed, i.e. if an implementation wants to call functions from overlay.h they need to explicitly include it. (As is e.g. done in the case of lxccontainer.c.) - The header - lxc-btrfs.h also moves to the bdev subfolder. - Adapt Makefile.am to the new bdev layout. Signed-off-by:Christian Brauner <christian.brauner@mailbox.org>
38683db4
×