remove unnecessary '/' from the path
[platform/core/system/libstorage.git] / src / storage-internal.c
index 9be1060..7f5d359 100755 (executable)
@@ -27,8 +27,6 @@
 #include "common.h"
 #include "log.h"
 
-#define COMPAT_DIR "/opt/usr/media"
-
 #ifndef __USE_FILE_OFFSET64
 int __WEAK__ storage_get_internal_memory_size(struct statvfs *buf);
 #else
@@ -62,30 +60,12 @@ static int internal_get_space(unsigned long long *total, unsigned long long *ava
 
 static const char *internal_get_root(void)
 {
-       struct libmnt_table *t = NULL;
-       int r = 0;
-       struct libmnt_fs *fs;
        const char *ret;
 
-       ret = tzplatform_getenv(TZ_USER_CONTENT);
-
-       t = mnt_new_table();
-       if(!t)
-               return ret;
-
-       r = mnt_table_parse_mtab(t, NULL);
-       if (r < 0) {
-               mnt_free_table(t);
-               return ret;
-       }
-
-       fs = mnt_table_find_target(t, COMPAT_DIR, MNT_ITER_BACKWARD);
-       if (fs) {
-               // TODO : mnt_fs_get_root(fs) should be matched to tzplatform_getenv(TZ_USER_CONTENT).
+       if (is_compat_bind_mount())
                ret = COMPAT_DIR;
-       }
-
-       mnt_free_table(t);
+       else
+               ret = tzplatform_getenv(TZ_USER_CONTENT);
 
        return ret;
 }