blob: bea85218587e406f43fcc4855aa2ad4a1d33178e [file] [log] [blame]
The Android Open Source Project13f797d2009-02-10 15:44:07 -08001
2/*
3 * Copyright (C) 2008 The Android Open Source Project
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef _DEVMAPPER_H
19#define _DEVMAPPER_H
20
21#include <pthread.h>
22
23#include "vold.h"
24#include "blkdev.h"
25#include "media.h"
26
27#define MAX_LOOP 8
28
29enum dm_src_type {
30 dmsrc_unknown,
31 dmsrc_loopback,
32 dmsrc_partition,
33};
34
35struct loop_data {
36 char *loop_src;
37
38 char *loop_dev;
39 int loop_no;
40};
41
42struct part_data {
43 char part_type;
44
45 char *part_dev;
46};
47
48struct devmapping {
49 enum dm_src_type src_type;
50 union {
51 struct loop_data loop;
52 struct part_data part;
53 } type_data;
54
55 uint32_t size_mb;
56 char *target;
57 char *params;
58 char *tgt_fs;
59};
60
61struct devmapping *devmapper_init(char *, char *, unsigned int, char *, char *, char*);
62int devmapper_start(struct devmapping *);
63int devmapper_stop(struct devmapping *);
64#endif