blob: 660ef194006cebcfd4d65b4c751a20f4c7af67c7 [file] [log] [blame]
Jeff Sharkeydeb24052015-03-02 21:01:40 -08001/*
2 * Copyright (C) 2015 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 ANDROID_VOLD_UTILS_H
18#define ANDROID_VOLD_UTILS_H
19
20#include <utils/Errors.h>
21
22#include <string>
23
24// DISALLOW_COPY_AND_ASSIGN disallows the copy and operator= functions. It goes in the private:
25// declarations in a class.
26#if !defined(DISALLOW_COPY_AND_ASSIGN)
27#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
28 TypeName(const TypeName&) = delete; \
29 void operator=(const TypeName&) = delete
30#endif
31
32namespace android {
33namespace vold {
34
35status_t CreateDeviceNode(const std::string& path, dev_t dev);
36status_t DestroyDeviceNode(const std::string& path);
37
38/* Really unmounts the path, killing active processes along the way */
39status_t ForceUnmount(const std::string& path);
40
Jeff Sharkey36801cc2015-03-13 16:09:20 -070041/* Creates bind mount from source to target */
42status_t BindMount(const std::string& source, const std::string& target);
43
Jeff Sharkeydeb24052015-03-02 21:01:40 -080044} // namespace vold
45} // namespace android
46
47#endif