3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
26 #include "storage-expand.h"
27 #include <sys/statvfs.h>
30 #define API __attribute__ ((visibility("default")))
34 #define __WEAK__ __attribute__ ((weak))
37 #ifndef __CONSTRUCTOR__
38 #define __CONSTRUCTOR__ __attribute__ ((constructor))
41 #ifndef __DESTRUCTOR__
42 #define __DESTRUCTOR__ __attribute__ ((destructor))
45 enum storage_cb_type {
47 STORAGE_CALLBACK_TYPE,
51 struct storage_cb_info {
54 storage_state_changed_cb state_cb;
55 storage_changed_cb type_cb;
61 const char *(*root) (void);
62 int (*get_state) (void);
63 int (*get_space) (unsigned long long *total, unsigned long long *available);
64 int (*register_cb) (enum storage_cb_type type, struct storage_cb_info *info);
65 int (*unregister_cb) (enum storage_cb_type type, struct storage_cb_info *info);
69 #define STORAGE_OPS_REGISTER(st) \
70 static void __CONSTRUCTOR__ module_init(void) \
74 static void __DESTRUCTOR__ module_exit(void) \
79 void add_device(const struct storage_ops *st);
80 void remove_device(const struct storage_ops *st);
82 int storage_get_external_memory_size_with_path(char *path, struct statvfs *buf);
83 int storage_get_external_memory_size64_with_path(char *path, struct statvfs *buf);
85 #define COMPAT_DIR "/opt/usr/media"
86 int is_compat_bind_mount(void);
87 int storage_ext_is_supported(void);
88 int mount_check(const char *path);
90 #define USER_UID_START 5000