File: lcfs-mount.h

package info (click to toggle)
composefs 1.0.8-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 11,040 kB
  • sloc: ansic: 9,004; sh: 416; python: 225; makefile: 5
file content (52 lines) | stat: -rw-r--r-- 1,245 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* lcfs
   Copyright (C) 2023 Alexander Larsson <alexl@redhat.com>

   SPDX-License-Identifier: GPL-2.0-or-later OR Apache-2.0
*/
#ifndef _LCFS_MOUNT_H
#define _LCFS_MOUNT_H

#include <stdlib.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>

#ifndef LCFS_EXTERN
#define LCFS_EXTERN extern
#endif

#define ENOVERITY ENOTTY
#define EWRONGVERITY EILSEQ
#define ENOSIGNATURE EBADMSG

enum lcfs_mount_flags_t {
	LCFS_MOUNT_FLAGS_NONE = 0,
	LCFS_MOUNT_FLAGS_REQUIRE_VERITY = (1 << 0),
	LCFS_MOUNT_FLAGS_READONLY = (1 << 1),
	LCFS_MOUNT_FLAGS_IDMAP = (1 << 3),
	LCFS_MOUNT_FLAGS_TRY_VERITY = (1 << 4),

	LCFS_MOUNT_FLAGS_MASK = (1 << 5) - 1,
};

struct lcfs_mount_options_s {
	const char **objdirs;
	size_t n_objdirs;
	const char *workdir;
	const char *upperdir;
	const char *expected_fsverity_digest;
	uint32_t flags;
	int idmap_fd; /* userns fd */
	const char *image_mountdir; /* Temporary location to mount images if needed */

	uint32_t reserved[4];
	void *reserved2[4];
};

LCFS_EXTERN int lcfs_mount_image(const char *path, const char *mountpoint,
				 struct lcfs_mount_options_s *options);
LCFS_EXTERN int lcfs_mount_fd(int fd, const char *mountpoint,
			      struct lcfs_mount_options_s *options);

#endif