From 24277ad103932a60eb40349c2743e550fb9594c9 Mon Sep 17 00:00:00 2001 From: Minje Ahn Date: Fri, 26 Feb 2016 15:40:09 +0900 Subject: [PATCH] Remove unused code (start path for checking location) Change-Id: Ib24d34ff04c4e3c8bca559abe0a3169d5571dbf5 Signed-off-by: Minje Ahn --- src/common/include/media-common-db-svc.h | 4 ++-- src/common/media-common-db-svc.c | 4 ++-- src/scanner-v2/media-scanner-scan-v2.c | 12 ++++++------ src/scanner/media-scanner-scan.c | 25 +++++++------------------ 4 files changed, 17 insertions(+), 28 deletions(-) diff --git a/src/common/include/media-common-db-svc.h b/src/common/include/media-common-db-svc.h index 0bab21f..d372334 100755 --- a/src/common/include/media-common-db-svc.h +++ b/src/common/include/media-common-db-svc.h @@ -58,7 +58,7 @@ typedef int (*INSERT_ITEM_END)(void*, uid_t, char **); typedef int (*SET_ITEM_VALIDITY_BEGIN)(void*, int, char **); typedef int (*SET_ITEM_VALIDITY_END)(void*, uid_t, char **); typedef int (*UPDATE_BEGIN)(void); -typedef int (*UPDATE_END)(const char *, uid_t); +typedef int (*UPDATE_END)(uid_t); typedef int (*SEND_DIR_UPDATE_NOTI)(void *, const char *, const char *, const char *, int, int, char **); typedef int (*CHECK_ITEM_EXIST)(void*, const char *, const char *, bool *, char **); @@ -169,7 +169,7 @@ void ms_reset_delete_count(); FOR BULK COMMIT *****************************************************************************************************/ void ms_register_start(void **handle, ms_noti_switch_e noti_status, int pid); -void ms_register_end(void **handle, const char *start_path, uid_t uid); +void ms_register_end(void **handle, uid_t uid); void ms_validate_start(void **handle); void ms_validate_end(void **handle, uid_t uid); void ms_insert_folder_start(void **handle); diff --git a/src/common/media-common-db-svc.c b/src/common/media-common-db-svc.c index 6d85d8a..af601ca 100755 --- a/src/common/media-common-db-svc.c +++ b/src/common/media-common-db-svc.c @@ -1341,7 +1341,7 @@ void ms_register_start(void **handle, ms_noti_switch_e noti_status, int pid) } } -void ms_register_end(void **handle, const char *start_path, uid_t uid) +void ms_register_end(void **handle, uid_t uid) { int lib_index; int ret = 0; @@ -1356,7 +1356,7 @@ void ms_register_end(void **handle, const char *start_path, uid_t uid) } for (lib_index = 0; lib_index < lib_num; lib_index++) { - ret = ((UPDATE_END)func_array[lib_index][eUPDATE_END])(start_path, uid);/*dlopen*/ + ret = ((UPDATE_END)func_array[lib_index][eUPDATE_END])(uid);/*dlopen*/ if (ret != 0) { MS_DBG_ERR("error : %s [%s]", g_array_index(so_array, char*, lib_index), err_msg); MS_SAFE_FREE(err_msg); diff --git a/src/scanner-v2/media-scanner-scan-v2.c b/src/scanner-v2/media-scanner-scan-v2.c index f0ce45c..0bfaa86 100755 --- a/src/scanner-v2/media-scanner-scan-v2.c +++ b/src/scanner-v2/media-scanner-scan-v2.c @@ -91,7 +91,7 @@ static bool __msc_is_valid_path(const char *path, uid_t uid); static void __msc_trim_dir_path(char *dir_path); static void __msc_insert_register_request(GArray *register_array, ms_comm_msg_s *insert_data); static void __msc_bacth_commit_enable(void* handle, bool ins_status, bool valid_status, bool noti_enable, int pid); -static void __msc_bacth_commit_disable(void* handle, bool ins_status, bool valid_status, const char *path, int result, uid_t uid); +static void __msc_bacth_commit_disable(void* handle, bool ins_status, bool valid_status, int result, uid_t uid); static int __msc_dir_scan_for_folder(void **handle, const char *storage_id, const char*start_path, ms_storage_type_t storage_type, int scan_type, int pid, uid_t uid); static int __msc_dir_scan_for_storage(void **handle, const char *storage_id, const char*start_path, ms_storage_type_t storage_type, int scan_type, int pid, uid_t uid); static bool __msc_storage_mount_status(const char* start_path); @@ -1246,7 +1246,7 @@ gboolean msc_directory_scan_thread(void *data) msc_del_cancel_path(); /*call for bundle commit*/ - __msc_bacth_commit_disable(handle, TRUE, TRUE, scan_data->msg, ret, scan_data->uid); + __msc_bacth_commit_disable(handle, TRUE, TRUE, ret, scan_data->uid); MS_DBG_ERR("folder scan done, sent cb event path = [%s]", scan_data->msg); __msc_call_dir_scan_cb(); @@ -1586,7 +1586,7 @@ gboolean msc_storage_scan_thread(void *data) /*call for bundle commit*/ if (scan_type != MS_MSG_STORAGE_INVALID) { - __msc_bacth_commit_disable(handle, TRUE, valid_status, scan_data->msg, ret, scan_data->uid); + __msc_bacth_commit_disable(handle, TRUE, valid_status, ret, scan_data->uid); } if (scan_type == MS_MSG_STORAGE_PARTIAL && ret == MS_MEDIA_ERR_NONE) { @@ -1898,7 +1898,7 @@ static int __msc_batch_insert(ms_msg_type_e current_msg, int pid, GArray *path_a } /*call for bundle commit*/ - __msc_bacth_commit_disable(handle, TRUE, FALSE, NULL, MS_MEDIA_ERR_NONE, uid); + __msc_bacth_commit_disable(handle, TRUE, FALSE, MS_MEDIA_ERR_NONE, uid); /*disconnect form media db*/ if (handle) ms_disconnect_db(&handle); @@ -2036,11 +2036,11 @@ static void __msc_bacth_commit_enable(void* handle, bool ins_status, bool valid_ return; } -static void __msc_bacth_commit_disable(void* handle, bool ins_status, bool valid_status, const char *path, int result, uid_t uid) +static void __msc_bacth_commit_disable(void* handle, bool ins_status, bool valid_status, int result, uid_t uid) { /*call for bundle commit*/ if (valid_status) ms_validate_end(handle, uid); - if (ins_status) ms_register_end(handle, path, uid); + if (ins_status) ms_register_end(handle, uid); return; } diff --git a/src/scanner/media-scanner-scan.c b/src/scanner/media-scanner-scan.c index 38d75ea..97b7862 100755 --- a/src/scanner/media-scanner-scan.c +++ b/src/scanner/media-scanner-scan.c @@ -79,7 +79,7 @@ static bool __msc_is_valid_path(const char *path, uid_t uid); static void __msc_trim_dir_path(char *dir_path); static void __msc_insert_register_request(GArray *register_array, ms_comm_msg_s *insert_data); static void __msc_bacth_commit_enable(void* handle, bool ins_status, bool valid_status, bool noti_enable, int pid); -static void __msc_bacth_commit_disable(void* handle, bool ins_status, bool valid_status, const char *path, uid_t uid); +static void __msc_bacth_commit_disable(void* handle, bool ins_status, bool valid_status, uid_t uid); static int __msc_set_storage_scan_status(ms_storage_scan_status_e status); //static int __msc_get_storage_scan_status(ms_storage_scan_status_e *status, uid_t uid); //static bool __msc_storage_mount_status(const char* start_path); @@ -418,15 +418,6 @@ static int __msc_dir_scan(void **handle, const char *storage_id, const char*star { GArray *dir_array = NULL; int ret = MS_MEDIA_ERR_NONE; - char *new_start_path = NULL; - - new_start_path = strdup(start_path); - if (new_start_path == NULL) { - MS_DBG_ERR("g_array_new failed"); - return MS_MEDIA_ERR_OUT_OF_MEMORY; - } - - MS_DBG_ERR("[No-Error] start path [%s]", new_start_path); /*call for bundle commit*/ __msc_bacth_commit_enable(handle, TRUE, TRUE, MS_NOTI_SWITCH_OFF, 0); @@ -434,9 +425,7 @@ static int __msc_dir_scan(void **handle, const char *storage_id, const char*star __msc_read_dir(handle, dir_array, start_path, storage_id, storage_type, scan_type, uid); /*call for bundle commit*/ - __msc_bacth_commit_disable(handle, TRUE, TRUE, new_start_path, uid); - - MS_SAFE_FREE(new_start_path); + __msc_bacth_commit_disable(handle, TRUE, TRUE, uid); MS_DBG_INFO("ret : %d", ret); @@ -1081,7 +1070,7 @@ gboolean msc_storage_scan_thread(void *data) } /*call for bundle commit*/ - __msc_bacth_commit_disable(handle, TRUE, valid_status, scan_data->msg, scan_data->uid); + __msc_bacth_commit_disable(handle, TRUE, valid_status, scan_data->uid); if (scan_type == MS_MSG_STORAGE_PARTIAL && ret == MS_MEDIA_ERR_NONE) { int del_count = 0; @@ -1413,13 +1402,13 @@ static int __msc_batch_insert(ms_msg_type_e current_msg, int pid, GArray *path_a if (power_off) { MS_DBG_ERR("power off"); /*call for bundle commit*/ - ms_register_end(handle, NULL, uid); + ms_register_end(handle, uid); break; } } /*call for bundle commit*/ - __msc_bacth_commit_disable(handle, TRUE, FALSE, NULL, uid); + __msc_bacth_commit_disable(handle, TRUE, FALSE, uid); /*disconnect form media db*/ if (handle) ms_disconnect_db(&handle); @@ -1557,10 +1546,10 @@ static void __msc_bacth_commit_enable(void* handle, bool ins_status, bool valid_ return; } -static void __msc_bacth_commit_disable(void* handle, bool ins_status, bool valid_status, const char *path, uid_t uid) +static void __msc_bacth_commit_disable(void* handle, bool ins_status, bool valid_status, uid_t uid) { /*call for bundle commit*/ - if (ins_status) ms_register_end(handle, path, uid); + if (ins_status) ms_register_end(handle, uid); if (valid_status) ms_validate_end(handle, uid); return; -- 2.7.4