1 /*
2  * Copyright (c) 2024-2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef EROFS_OVERLAY_COMMON_H
17 #define EROFS_OVERLAY_COMMON_H
18 
19 #include <stdbool.h>
20 #include <stdint.h>
21 #include "fs_manager/ext4_super_block.h"
22 #include "fs_manager/erofs_super_block.h"
23 
24 #ifdef __cplusplus
25 #if __cplusplus
26 extern "C" {
27 #endif
28 #endif
29 
30 #define MODE_MKDIR 0755
31 #define EXT4_SUPER_MAGIC 0xEF53
32 #define EXT4_SUPER_OFFSET 0x400
33 #define SECTOR_SIZE 512
34 #define PREFIX_LOWER "/mnt/lower"
35 #define PREFIX_OVERLAY "/mnt/overlay"
36 #define PREFIX_UPPER "/upper"
37 #define PREFIX_WORK "/work"
38 
39 bool IsOverlayEnable(void);
40 
41 bool CheckIsExt4(const char *dev, uint64_t offset);
42 
43 bool CheckIsErofs(const char *dev);
44 
45 #ifdef __cplusplus
46 #if __cplusplus
47 }
48 #endif
49 #endif
50 
51 #endif