blob: 110e738300a15b17c173803809d3b06ce1b8728e [file] [log] [blame]
Ken Sumrall7574c032012-01-06 19:09:42 -08001/*
2 * Copyright (C) 2012 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef __CORE_FS_MGR_H
18#define __CORE_FS_MGR_H
19
Ken Sumrallab6b8522013-02-13 12:58:40 -080020#ifdef __cplusplus
21extern "C" {
22#endif
23
24struct fstab {
25 int num_entries;
26 struct fstab_rec *recs;
27 char *fstab_filename;
28};
29
30struct fstab_rec {
31 char *blk_device;
32 char *mount_point;
33 char *fs_type;
34 unsigned long flags;
35 char *fs_options;
36 int fs_mgr_flags;
37 char *key_loc;
38 long long length;
39 char *label;
40 int partnum;
Ken Sumrall5bc31a22013-07-08 19:11:55 -070041 int swap_prio;
42 unsigned int zram_size;
Ken Sumrallab6b8522013-02-13 12:58:40 -080043};
44
45struct fstab *fs_mgr_read_fstab(const char *fstab_path);
46void fs_mgr_free_fstab(struct fstab *fstab);
47int fs_mgr_mount_all(struct fstab *fstab);
48int fs_mgr_do_mount(struct fstab *fstab, char *n_name, char *n_blk_device,
49 char *tmp_mount_point);
Ken Sumrall7574c032012-01-06 19:09:42 -080050int fs_mgr_do_tmpfs_mount(char *n_name);
Ken Sumrallab6b8522013-02-13 12:58:40 -080051int fs_mgr_unmount_all(struct fstab *fstab);
52int fs_mgr_get_crypt_info(struct fstab *fstab, char *key_loc,
53 char *real_blk_device, int size);
54int fs_mgr_add_entry(struct fstab *fstab,
55 const char *mount_point, const char *fs_type,
56 const char *blk_device, long long length);
57struct fstab_rec *fs_mgr_get_entry_for_mount_point(struct fstab *fstab, const char *path);
58int fs_mgr_is_voldmanaged(struct fstab_rec *fstab);
59int fs_mgr_is_nonremovable(struct fstab_rec *fstab);
60int fs_mgr_is_encryptable(struct fstab_rec *fstab);
Ken Sumrall5bc31a22013-07-08 19:11:55 -070061int fs_mgr_swapon_all(struct fstab *fstab);
Ken Sumrallab6b8522013-02-13 12:58:40 -080062#ifdef __cplusplus
63}
64#endif
Ken Sumrall7574c032012-01-06 19:09:42 -080065
66#endif /* __CORE_FS_MGR_H */
67