]>
git.proxmox.com Git - mirror_lxc.git/blob - src/lxc/storage/overlay.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
3 #ifndef __LXC_OVERLAY_H
4 #define __LXC_OVERLAY_H
11 #include <sys/types.h>
23 extern int ovl_clonepaths(struct lxc_storage
*orig
, struct lxc_storage
*new,
24 const char *oldname
, const char *cname
,
25 const char *oldpath
, const char *lxcpath
, int snap
,
26 uint64_t newsize
, struct lxc_conf
*conf
);
27 extern int ovl_create(struct lxc_storage
*bdev
, const char *dest
, const char *n
,
28 struct bdev_specs
*specs
);
29 extern int ovl_destroy(struct lxc_storage
*orig
);
30 extern bool ovl_detect(const char *path
);
31 extern int ovl_mount(struct lxc_storage
*bdev
);
32 extern int ovl_umount(struct lxc_storage
*bdev
);
34 /* To be called from lxcapi_clone() in lxccontainer.c: When we clone a container
35 * with overlay lxc.mount.entry entries we need to update absolute paths for
36 * upper- and workdir. This update is done in two locations:
37 * lxc_conf->unexpanded_config and lxc_conf->mount_list. Both updates are done
38 * independent of each other since lxc_conf->mountlist may container more mount
39 * entries (e.g. from other included files) than lxc_conf->unexpanded_config .
41 extern int ovl_update_abs_paths(struct lxc_conf
*lxc_conf
, const char *lxc_path
,
42 const char *lxc_name
, const char *newpath
,
45 /* To be called from functions in lxccontainer.c: Get lower directory for
48 extern const char *ovl_get_lower(const char *rootfs_path
);
50 /* Get rootfs path for overlay backed containers. Allocated memory must be freed
53 extern char *ovl_get_rootfs(const char *rootfs_path
, size_t *rootfslen
);
55 /* Create upper- and workdirs for overlay mounts.
57 extern int ovl_mkdir(const struct mntent
*mntent
,
58 const struct lxc_rootfs
*rootfs
, const char *lxc_name
,
59 const char *lxc_path
);
61 #endif /* __LXC_OVERLAY_H */