Tom Marshall | 34e1e5d | 2015-11-04 15:44:44 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 22 | namespace android { |
| 23 | namespace 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 | |
| 30 | class DiskPartition : public Disk { |
| 31 | public: |
| 32 | DiskPartition(const std::string& eventPath, dev_t device, |
| 33 | const std::string& nickname, |
Tom Marshall | 9f8b468 | 2015-11-05 11:20:54 -0800 | [diff] [blame^] | 34 | int flags, int partnum, |
| 35 | const std::string& fstype = "", const std::string& mntopts = ""); |
Tom Marshall | 34e1e5d | 2015-11-04 15:44:44 -0800 | [diff] [blame] | 36 | 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 | |
| 45 | private: |
| 46 | /* Partition number */ |
| 47 | int mPartNum; |
Tom Marshall | 9f8b468 | 2015-11-05 11:20:54 -0800 | [diff] [blame^] | 48 | /* Filesystem type */ |
| 49 | std::string mFsType; |
| 50 | /* Mount options */ |
| 51 | std::string mMntOpts; |
Tom Marshall | 34e1e5d | 2015-11-04 15:44:44 -0800 | [diff] [blame] | 52 | }; |
| 53 | |
| 54 | } // namespace vold |
| 55 | } // namespace android |
| 56 | |
| 57 | #endif |
| 58 | |