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