fs_mgr.h revision ab6b852235d99d752678312c155a3f1c140fb483
1/* 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 20#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; 41}; 42 43struct fstab *fs_mgr_read_fstab(const char *fstab_path); 44void fs_mgr_free_fstab(struct fstab *fstab); 45int fs_mgr_mount_all(struct fstab *fstab); 46int fs_mgr_do_mount(struct fstab *fstab, char *n_name, char *n_blk_device, 47 char *tmp_mount_point); 48int fs_mgr_do_tmpfs_mount(char *n_name); 49int fs_mgr_unmount_all(struct fstab *fstab); 50int fs_mgr_get_crypt_info(struct fstab *fstab, char *key_loc, 51 char *real_blk_device, int size); 52int fs_mgr_add_entry(struct fstab *fstab, 53 const char *mount_point, const char *fs_type, 54 const char *blk_device, long long length); 55struct fstab_rec *fs_mgr_get_entry_for_mount_point(struct fstab *fstab, const char *path); 56int fs_mgr_is_voldmanaged(struct fstab_rec *fstab); 57int fs_mgr_is_nonremovable(struct fstab_rec *fstab); 58int fs_mgr_is_encryptable(struct fstab_rec *fstab); 59#ifdef __cplusplus 60} 61#endif 62 63#endif /* __CORE_FS_MGR_H */ 64 65