blob: 4c9ab08cb54508521b2d5d4c3b6467c0e6673995 [file] [log] [blame]
Tom Marshall34e1e5d2015-11-04 15:44:44 -08001/*
2 * Copyright (C) 2015 Cyanogen, Inc.
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 ANDROID_VOLD_DISKPARTITION_H
18#define ANDROID_VOLD_DISKPARTITION_H
19
20#include "Disk.h"
21
22namespace android {
23namespace vold {
24
25/*
26 * Representation of a single partition on physical media. Useful for
27 * single media partitions such as "internal" sdcard partitions.
28 */
29
30class DiskPartition : public Disk {
31public:
32 DiskPartition(const std::string& eventPath, dev_t device,
33 const std::string& nickname,
Tom Marshall9f8b4682015-11-05 11:20:54 -080034 int flags, int partnum,
35 const std::string& fstype = "", const std::string& mntopts = "");
Tom Marshall34e1e5d2015-11-04 15:44:44 -080036 virtual ~DiskPartition();
37
38 virtual status_t create();
39 virtual status_t destroy();
40
41 virtual status_t partitionPublic();
42 virtual status_t partitionPrivate();
43 virtual status_t partitionMixed(int8_t ratio);
44
45private:
46 /* Partition number */
47 int mPartNum;
Tom Marshall9f8b4682015-11-05 11:20:54 -080048 /* Filesystem type */
49 std::string mFsType;
50 /* Mount options */
51 std::string mMntOpts;
Tom Marshall34e1e5d2015-11-04 15:44:44 -080052};
53
54} // namespace vold
55} // namespace android
56
57#endif
58