1. First letter to uppercase.
2. Period at the end.
3. Rearrange parameters.
Change-Id: I6705c61a5d03c99b2371a5df0d76eafa29e39526
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
{
FUNC_BEGIN();
- DMSG("Terminating app");
+ DMSG("Terminating app.");
ui_app_exit();
FUNC_END();
if (ad) {
if (elm_naviframe_top_item_get(ad->naviframe) == elm_naviframe_bottom_item_get(ad->naviframe)) {
- DMSG("Terminating app");
+ DMSG("Terminating app.");
ui_app_exit();
} else {
elm_naviframe_item_pop(ad->naviframe);
char edje_file[PATH_MAX];
app_get_resource(EDJE_FILE, edje_file, PATH_MAX-1);
- DMSG("edje path: %s", edje_file);
+ DMSG("edje path=%s", edje_file);
Eina_Bool retBool = elm_layout_file_set(layout, edje_file, group_name);
if (retBool != EINA_TRUE) {
- DMSG_ERR("Wrong groupName:[%s]", group_name);
+ DMSG_ERR("Wrong groupName(%s).", group_name);
return NULL;
}
char img_file[PATH_MAX];
app_get_resource(image_path, img_file, PATH_MAX-1);
- DMSG("image path: %s", img_file);
+ DMSG("Image path=%s", img_file);
Evas_Object* icon_image = elm_image_add(parent);
elm_image_file_set(icon_image, img_file, NULL);
int value = elm_radio_value_get(ad->home_page_data->radio_group);
switch (value) {
case USE_AS_PORTABLE_STORAGE:
- DMSG("selected USE_AS_PORTABLE_STORAGE");
+ DMSG("Selected USE_AS_PORTABLE_STORAGE.");
create_portable_storage_page_base_layout(ad);
break;
case USE_AS_INTERNAL_STORAGE:
- DMSG("selected USE_AS_INTERNAL_STORAGE");
+ DMSG("Selected USE_AS_INTERNAL_STORAGE.");
create_internal_storage_page_base_layout(ad);
break;
default:
- DMSG("Wrong radio value");
+ DMSG("Wrong radio value.");
break;
}
home_page_data_s* home_page_data = (home_page_data_s*)malloc(sizeof(home_page_data_s));
if (!home_page_data) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
return;
}
home_page_genlist_itc = elm_genlist_item_class_new();
if (!home_page_genlist_itc) {
- DMSG_ERR("elm_genlist_item_class_new failed");
+ DMSG_ERR("Failed to elm_genlist_item_class_new.");
return;
}
item = (home_genlist_item_s *)malloc(sizeof(home_genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item = (home_genlist_item_s *)malloc(sizeof(home_genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item = (home_genlist_item_s *)malloc(sizeof(home_genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
// What if sdcard #1 is setting on extended internal storage,
// and another sdcard #2 is inserted and then #1 is removed?
if (dev != STORAGE_DEV_EXTENDED_INTERNAL) {
- DMSG("Not mapper device");
+ DMSG("Not mapper device.");
return;
}
ret = app_control_send_launch_request(app_control, NULL, ad);
if (ret != APP_CONTROL_ERROR_NONE)
- DMSG_ERR("app_control_send_launch_request() is failed err = %d", ret);
+ DMSG_ERR("Failed to app_control_send_launch_request(): %d", ret);
app_control_destroy(app_control);
ret = app_control_send_launch_request(app_control, NULL, NULL);
if (ret != APP_CONTROL_ERROR_NONE)
- DMSG_ERR("app_control_send_launch_request() is failed err = %d", ret);
+ DMSG_ERR("Failed to app_control_send_launch_request(): %d", ret);
app_control_destroy(app_control);
app_control_add_extra_data(app_control, VIEWTYPE_KEY, APPSELECT);
ret = app_control_send_launch_request(app_control, NULL, NULL);
if (ret != APP_CONTROL_ERROR_NONE)
- DMSG_ERR("app_control_send_launch_request() is failed err = %d", ret);
+ DMSG_ERR("Failed to app_control_send_launch_request(): %d", ret);
app_control_destroy(app_control);
app_control_add_extra_data(app_control, VIEWTYPE_KEY, DEFAULT_STORAGE);
ret = app_control_send_launch_request(app_control, NULL, NULL);
if (ret != APP_CONTROL_ERROR_NONE)
- DMSG_ERR("app_control_send_launch_request() is failed err = %d", ret);
+ DMSG_ERR("Failed to app_control_send_launch_request(): %d", ret);
app_control_destroy(app_control);
case INTERNAL_STORAGE_ITEM_PAGE_4_HEADING:
case INTERNAL_STORAGE_ITEM_PAGE_5_HEADING:
{
- DMSG("icon path: images/extended_storage_sd_card.png");
+ DMSG("Icon path: images/extended_storage_sd_card.png");
Evas_Object* icon = create_image(obj, "images/extended_storage_sd_card_internal.png");
evas_object_size_hint_min_set(icon, ELM_SCALE_SIZE(64), ELM_SCALE_SIZE(64));
evas_object_size_hint_max_set(icon, ELM_SCALE_SIZE(64), ELM_SCALE_SIZE(64));
item = (genlist_item_s *)malloc(sizeof(genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item->ad = ad;
item = (genlist_item_s *)malloc(sizeof(genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item->ad = ad;
item = (genlist_item_s *)malloc(sizeof(genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item->ad = ad;
item = (genlist_item_s *)malloc(sizeof(genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item->ad = ad;
item = (genlist_item_s *)malloc(sizeof(genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item->ad = ad;
item = (genlist_item_s *)malloc(sizeof(genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item->ad = ad;
item = (genlist_item_s *)malloc(sizeof(genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item->ad = ad;
item = (genlist_item_s *)malloc(sizeof(genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item->ad = ad;
item = (genlist_item_s *)malloc(sizeof(genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item->ad = ad;
item = (genlist_item_s *)malloc(sizeof(genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item->ad = ad;
item = (genlist_item_s *)malloc(sizeof(genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc");
goto out;
}
item->ad = ad;
item = (genlist_item_s *)malloc(sizeof(genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item->ad = ad;
item = (genlist_item_s *)malloc(sizeof(genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item->ad = ad;
item = (genlist_item_s *)malloc(sizeof(genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item->ad = ad;
item = (genlist_item_s *)malloc(sizeof(genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item->ad = ad;
item = (genlist_item_s *)malloc(sizeof(genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item->ad = ad;
item = (genlist_item_s *)malloc(sizeof(genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item->ad = ad;
item = (genlist_item_s *)malloc(sizeof(genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item->ad = ad;
item = (genlist_item_s *)malloc(sizeof(genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item->ad = ad;
item = (genlist_item_s *)malloc(sizeof(genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item->ad = ad;
ret = storage_set_changed_cb(STORAGE_TYPE_EXTENDED_INTERNAL, mapper_device_cb, ad);
if (ret != STORAGE_ERROR_NONE)
- DMSG_ERR("Failed to register signal handler for extended internal storage");
+ DMSG_ERR("Failed to register signal handler for extended internal storage.");
if (ad->internal_storage_page_data) {
ELM_OBJECT_ITEM_DEL(ad->internal_storage_page_data->internal_storage_page_navi_it);
internal_storage_page_data_s *internal_storage_page_data = (internal_storage_page_data_s *)malloc(sizeof(internal_storage_page_data_s));
if (!internal_storage_page_data) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
FUNC_END();
return;
}
// What if sdcard #1 is setting on extended internal storage,
// and another sdcard #2 is inserted and then #1 is removed?
if (dev != STORAGE_DEV_EXTENDED_INTERNAL) {
- DMSG("Not mapper device");
+ DMSG("Not mapper device.");
return;
}
output = dbus_handle_method_sync_with_reply_var(STORAGED_BUS_NAME,
STORAGED_PATH_BLOCK_MANAGER, STORAGED_INTERFACE_BLOCK_MANAGER, "GetDeviceList", g_variant_new("(s)", "mmc"));
if (!output) {
- DMSG("Failed to get storage information");
+ DMSG("Failed to get storage information.");
return;
}
if (strncmp(new_fstype, LUKS_NAME, strlen(LUKS_NAME) + 1))
continue;
- DMSG("Get Primary MMC: %d", id);
+ DMSG("Get Primary MMC=%d", id);
ad->storage_id = id;
break;
}
ret = app_control_send_launch_request(app_control, NULL, NULL);
if (ret != APP_CONTROL_ERROR_NONE)
- DMSG_ERR("app_control_send_launch_request() is failed err = %d", ret);
+ DMSG_ERR("Failed to app_control_send_launch_request(): %d", ret);
app_control_destroy(app_control);
app_control_add_extra_data(app_control, VIEWTYPE_KEY, DEFAULT_STORAGE);
ret = app_control_send_launch_request(app_control, NULL, NULL);
if (ret != APP_CONTROL_ERROR_NONE)
- DMSG_ERR("app_control_send_launch_request() is failed err = %d", ret);
+ DMSG_ERR("Failed to app_control_send_launch_request(): %d", ret);
app_control_destroy(app_control);
case PORTABLE_STORAGE_ITEM_PAGE_2_HEADING:
case PORTABLE_STORAGE_ITEM_PAGE_3_HEADING:
{
- DMSG("icon path: images/extended_storage_sd_card.png");
+ DMSG("Icon path=images/extended_storage_sd_card.png");
Evas_Object* icon = create_image(obj, "images/extended_storage_sd_card_portable.png");
evas_object_size_hint_min_set(icon, ELM_SCALE_SIZE(64), ELM_SCALE_SIZE(64));
evas_object_size_hint_max_set(icon, ELM_SCALE_SIZE(64), ELM_SCALE_SIZE(64));
item = (genlist_item_s *)malloc(sizeof(genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item->ad = ad;
item = (genlist_item_s *)malloc(sizeof(genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item->ad = ad;
item = (genlist_item_s *)malloc(sizeof(genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item->ad = ad;
item = (genlist_item_s *)malloc(sizeof(genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item->ad = ad;
item = (genlist_item_s *)malloc(sizeof(genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item->ad = ad;
item = (genlist_item_s *)malloc(sizeof(genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item->ad = ad;
item = (genlist_item_s *)malloc(sizeof(genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item->ad = ad;
item = (genlist_item_s *)malloc(sizeof(genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item->ad = ad;
item = (genlist_item_s *)malloc(sizeof(genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item->ad = ad;
item = (genlist_item_s *)malloc(sizeof(genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item->ad = ad;
item = (genlist_item_s *)malloc(sizeof(genlist_item_s));
if (!item) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
goto out;
}
item->ad = ad;
ret = storage_set_changed_cb(STORAGE_TYPE_EXTENDED_INTERNAL, mapper_device_cb, ad);
if (ret != STORAGE_ERROR_NONE)
- DMSG_ERR("Failed to register signal handler for extended internal storage");
+ DMSG_ERR("Failed to register signal handler for extended internal storage.");
if (ad->portable_storage_page_data) {
ELM_OBJECT_ITEM_DEL(ad->portable_storage_page_data->portable_storage_page_navi_it);
portable_storage_page_data_s* portable_storage_page_data = (portable_storage_page_data_s*)malloc(sizeof(portable_storage_page_data_s));
if (!portable_storage_page_data) {
- DMSG_ERR("malloc failed");
+ DMSG_ERR("Failed to malloc.");
return;
}
ad->portable_storage_page_data = portable_storage_page_data;
FUNC_BEGIN();
if (!key) {
- DMSG_ERR("key is NULL");
+ DMSG_ERR("Key is NULL.");
return;
}
int ret = preference_set_int(key, value);
if (PREFERENCE_ERROR_NONE != ret)
- DMSG_ERR("set_preference_int Failed :%d", ret);
+ DMSG_ERR("Failed to set_preference_int: %d", ret);
FUNC_END();
}
FUNC_BEGIN();
if (!key) {
- DMSG_ERR("key is NULL");
+ DMSG_ERR("Key is NULL.");
return -1;
}
int value;
int ret = preference_get_int(key, &value) ;
if (PREFERENCE_ERROR_NONE != ret) {
- DMSG_ERR("get_preference_int Failed :%d", ret);
+ DMSG_ERR("Failed to get_preference_int: %d", ret);
return -1;
}
FUNC_BEGIN();
if (!key) {
- DMSG_ERR("key is NULL");
+ DMSG_ERR("Key is NULL.");
return false;
}
bool is_exist;
int ret = preference_is_existing(key, &is_exist) ;
if (PREFERENCE_ERROR_NONE != ret) {
- DMSG_ERR("is_preference_key_exist Failed :%d", ret);
+ DMSG_ERR("Failed to is_preference_key_exist: %d", ret);
return false;
}
/* Only one mmc slot is supported
ad->storage_id is mapper node id */
- DMSG("Storage is removed");
+ DMSG("Storage is removed.");
ui_app_exit();
FUNC_END();
ret = storage_set_changed_cb(STORAGE_TYPE_EXTERNAL, storage_removed_cb, ad);
if (ret != STORAGE_ERROR_NONE)
- DMSG_ERR("Failed to register signal handler for extended internal storage");
+ DMSG_ERR("Failed to register signal handler for extended internal storage.");
len = strlen(SETUP_EXTENDED) + 1;
app_control_get_extra_data(app_control, SDCARD_SETUP_TYPE, &type);
if (!type) {
- DMSG("No setup type");
+ DMSG("No setup type.");
create_home_page_base_layout(ad);
} else if (!strncmp(type, SETUP_EXTENDED, len)) {
- DMSG("selected USE_AS_INTERNAL_STORAGE");
+ DMSG("Selected USE_AS_INTERNAL_STORAGE.");
create_internal_storage_page_base_layout(ad);
} else if (!strncmp(type, SETUP_EXTERNAL, len)) {
- DMSG("selected USE_AS_PORTABLE_STORAGE");
+ DMSG("Selected USE_AS_PORTABLE_STORAGE.");
create_portable_storage_page_base_layout(ad);
} else
create_home_page_base_layout(ad);
output = dbus_handle_method_sync_with_reply_var(STORAGED_BUS_NAME,
STORAGED_PATH_BLOCK_MANAGER, STORAGED_INTERFACE_BLOCK_MANAGER, "GetMmcPrimary", NULL);
if (!output) {
- DMSG("Failed to get storage information");
+ DMSG("Failed to get storage information.");
return;
}
g_variant_get(output, "(issssssisibii)", NULL, &devpath, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &id);
- DMSG("Get Primary MMC: %d %s", id, devpath);
+ DMSG("Get Primary MMC=%d devpath=%s", id, devpath);
ad->storage_id = id;
ad->devpath = strdup(devpath);
ret = app_event_get_language(event_info, &language);
if (ret != APP_ERROR_NONE) {
- DMSG_ERR("app_event_get_language() failed. Err = %d", ret);
+ DMSG_ERR("Failed to app_event_get_language(): %d", ret);
return;
}
ret = ui_app_main(argc, argv, &event_callback, &ad);
if (ret != APP_ERROR_NONE)
- DMSG_ERR("ui_app_main() is failed. err = %d", ret);
+ DMSG_ERR("Failed to ui_app_main(): %d", ret);
return ret;
}
method, param, timeout);
if (!msg) {
- _E("fail (%s): no reply", method);
+ _E("Failed to call dbus method(%s): no reply", method);
return ret;
}
if (!dh_get_param_from_var(msg, "(i)", &val))
- _E("fail (%s): no message", method);
+ _E("Failed to call dbus method(%s): no message", method);
else {
if ((val == -ENOTSUP) || (val == -ENOSYS)) {
- _I("Not supported feature! (%s): %d", method, val);
+ _I("Not supported feature. %s:%d", method, val);
ret = TRUE;
} else if (val == -ENODEV) {
- _E("fail (%s): device open fail (%d)", method, val);
+ _E("Failed to call %s. Device open fail: %d", method, val);
} else if (val < 0) {
- _E("fail (%s): returned fail (%d)", method, val);
+ _E("Failed to call %s. Returned fail: %d", method, val);
} else {
- _I("success (%s): %d", method, val);
+ _I("Success. %s:%d", method, val);
ret = TRUE;
}
}
NULL);
if (!msg) {
- _E("fail (%s): no reply", METHOD_BLOCK_GETMMCPRIMARY);
+ _E("Failed to call dbus method(%s): no reply", METHOD_BLOCK_GETMMCPRIMARY);
return ret;
}
if (!dh_get_param_from_var(msg, "(issssssisibii)",
NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, &val))
- _E("fail (%s): no message", METHOD_BLOCK_GETMMCPRIMARY);
+ _E("Failed to call %s: no message", METHOD_BLOCK_GETMMCPRIMARY);
else
ret = val;
- _D("id: %d", ret);
+ _D("Get id: %d", ret);
g_variant_unref(msg);
return ret;
}
NULL);
if (!msg) {
- _E("fail (%s): no reply", METHOD_BLOCK_SHOWDEVICELIST);
+ _E("Failed to call dbus method(%s): no reply", METHOD_BLOCK_SHOWDEVICELIST);
return ret;
}
- _I("success (%s)", METHOD_BLOCK_SHOWDEVICELIST);
+ _I("Success. %s", METHOD_BLOCK_SHOWDEVICELIST);
g_variant_unref(msg);
return TRUE;
}
g_variant_new("(s)", type));
if (!msg) {
- _E("fail (%s): no reply", METHOD_BLOCK_GETMMCPRIMARY);
+ _E("Failed to call dbus method(%s): no reply", METHOD_BLOCK_GETMMCPRIMARY);
return ret;
}
while (g_variant_iter_loop(iter, "(issssssisibii)",
NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, &val)) {
- _D("id: %d", val);
+ _D("Device id=%d", val);
ret = TRUE;
}
- _I("success (%s): %d", METHOD_BLOCK_GETDEVICELIST, ret);
+ _I("Success. (%s): %d", METHOD_BLOCK_GETDEVICELIST, ret);
return ret;
}
g_variant_new("(s)", type));
if (!msg) {
- _E("fail (%s): no reply", METHOD_BLOCK_GETMMCPRIMARY);
+ _E("Failed to call dbus method(%s): no reply", METHOD_BLOCK_GETMMCPRIMARY);
return ret;
}
while (g_variant_iter_loop(iter, "(issssssisibi)",
NULL, &val, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL)) {
- _D("devnode: %s", val);
+ _D("Devnode=%s", val);
ret = TRUE;
}
- _I("success (%s): %d", METHOD_BLOCK_GETDEVICELIST2, ret);
+ _I("Success. %s: %d", METHOD_BLOCK_GETDEVICELIST2, ret);
return ret;
}
g_variant_new("(i)", id));
if (!msg) {
- _E("fail (%s): no reply", METHOD_BLOCK_GETMMCPRIMARY);
+ _E("Failed to call dbus method(%s): no reply", METHOD_BLOCK_GETMMCPRIMARY);
return ret;
}
if (!dh_get_param_from_var(msg, "(issssssisibii)",
NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, &val))
- _E("fail (%s): no message", METHOD_BLOCK_GETMMCPRIMARY);
+ _E("Failed to call %s: no message", METHOD_BLOCK_GETMMCPRIMARY);
else
ret = TRUE;
if (val != id) {
ret = FALSE;
- _E("fail (%s)", METHOD_BLOCK_GETMMCPRIMARY);
+ _E("Fail to call %s.", METHOD_BLOCK_GETMMCPRIMARY);
}
- _I("success (%s): %d", METHOD_BLOCK_GETDEVICEINFO, ret);
+ _I("Success. %s: %d", METHOD_BLOCK_GETDEVICEINFO, ret);
return ret;
}
NULL);
if (!msg) {
- _E("fail (%s): no reply", METHOD_BLOCK_GETMMCPRIMARY);
+ _E("Failed to call dbus method(%s): no reply", METHOD_BLOCK_GETMMCPRIMARY);
return ret;
}
if (!dh_get_param_from_var(msg, "(issssssisibii)",
NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, &val))
- _E("fail (%s): no message", METHOD_BLOCK_GETMMCPRIMARY);
+ _E("Failed to call %s: no message", METHOD_BLOCK_GETMMCPRIMARY);
else
ret = TRUE;
- _D("id: %d", val);
- _I("success (%s): %d", METHOD_BLOCK_GETMMCPRIMARY, ret);
+ _D("Id=%d", val);
+ _I("Success. %s: %d", METHOD_BLOCK_GETMMCPRIMARY, ret);
return ret;
}
int success = 0;
int fail = 0;
- _I("start test");
+ _I("Start test.");
block_test_all(&success, &fail);
- _I("Total: %d, Success: %d, Fail: %d", success+fail, success, fail);
+ _I("Total=%d Success=%d Fail=%d", success+fail, success, fail);
}
static void block_exit(void *data)
{
- _I("end test");
+ _I("End test.");
}
static int block_unit(int argc, char **argv)
int success = 0;
int fail = 0;
- _I("start test");
+ _I("Start test.");
block_test_all(&success, &fail);
- _I("Total: %d, Success: %d, Fail: %d", success+fail, success, fail);
+ _I("Total=%d Success=%d Fail=%d", success+fail, success, fail);
} else if (0 == strcasecmp(argv[2], METHOD_BLOCK_SHOWDEVICELIST)) {
block_showdevicelist();
} else if (0 == strcasecmp(argv[2], METHOD_BLOCK_GETDEVICELIST)) {
} else if (0 == strcasecmp(argv[2], METHOD_BLOCK_GETCONTROL)) {
block_getcontrol();
} else {
- _E("Unknown test case!!!");
+ _E("Unknown test case.");
}
_D("----------------------------------------------------------------------------------");
static void test_main(int argc, char **argv)
{
- _I("auto test all");
+ _I("Auto test all.");
test_init((void *)NULL);
test_exit((void *)NULL);
}
ops = find_test(argv[1]);
if (!ops) {
- _E("there is no test ops : %s", argv[1]);
+ _E("There is no test ops(%s).", argv[1]);
return;
}
ops->unit(argc, argv);
method, param);
if (!msg) {
- _E("fail (%s): no reply", method);
+ _E("Failed to call dbus method(%s): no reply", method);
return ret;
}
if (!dh_get_param_from_var(msg, "(tt)", &val1, &val2))
- _E("fail (%s): no message", method);
+ _E("Failed to call method(%s): no message", method);
else {
if (val1 <= 0) {
- _E("fail (%s): returned total storage (%4.0llu)", method, val1);
+ _E("Failed to call method(%s): returned total storage (%4.0llu)", method, val1);
} else {
- _I("success (%s): Total: %4.0llu Avail: %4.0llu", method, val1, val2);
+ _I("Success. %s: Total=%4.0llu Avail=%4.0llu", method, val1, val2);
ret = TRUE;
}
}
int success = 0;
int fail = 0;
- _I("start test");
+ _I("Start test.");
storage_test_all(&success, &fail);
- _I("Total: %d, Success: %d, Fail: %d", success+fail, success, fail);
+ _I("Total=%d Success=%d Fail=%d", success+fail, success, fail);
}
static void storage_exit(void *data)
{
- _I("end test");
+ _I("End test.");
}
static int storage_unit(int argc, char **argv)
int success = 0;
int fail = 0;
- _I("start test");
+ _I("Start test.");
storage_test_all(&success, &fail);
- _I("Total: %d, Success: %d, Fail: %d", success+fail, success, fail);
+ _I("Total=%d Success=%d Fail=%d", success+fail, success, fail);
} else if (0 == strcasecmp(argv[2], METHOD_STORAGE_GETSTORAGE)) {
storage_getstorage();
} else if (0 == strcasecmp(argv[2], METHOD_STORAGE_GETSTATUS)) {
storage_getstatus(argv[3]);
} else {
- _E("Unknown test case!!!");
+ _E("Unknown test case.");
}
_D("----------------------------------------------------------------------------------");
dd_list *elem;
const struct test_ops *d;
- _D("test module count(%d)", DD_LIST_LENGTH(dd_head));
+ _D("Test module count(%d).", DD_LIST_LENGTH(dd_head));
DD_LIST_FOREACH(dd_head, elem, d) {
- _D("[%s] initialize", d->name);
+ _D("%s initialize.", d->name);
if (d->init)
d->init(data);
}
const struct test_ops *d;
DD_LIST_FOREACH(dd_head, elem, d) {
- _D("[%s] deinitialize", d->name);
+ _D("%s deinitialize.", d->name);
if (d->exit)
d->exit(data);
}
ret = remove(file_name);
if (ret < 0)
- _E("Fail to remove %s. errno: %d", file_name, errno);
+ _E("Failed to remove '%s': %d", file_name, errno);
}
static void create_file(int id, char *mount_point, bool extendedsd)
fprintf(fp, "%s", mount_point);
fclose(fp);
} else
- _E("Fail to open %s", file_name);
+ _E("Failed to open '%s'.", file_name);
}
static void signal_device_blocked(struct block_device *bdev)
case BLOCK_EXTENDEDSD_DEV:
return strdup(EXTENDEDSD_MOUNT_PATH);
default:
- _E("Invalid block type (%d)", data->block_type);
+ _E("Invalid block type(%d).", data->block_type);
return NULL;
}
if (ret < 0)
return strdup(str);
out:
- _E("Invalid devnode (%s)", data->devnode ? data->devnode : "NULL");
+ _E("Invalid devnode(%s).", data->devnode ? data->devnode : "NULL");
return NULL;
}
return NULL;
if (!fs_type)
- _I("Unknown fs type");
+ _I("Unknown fs type.");
data = calloc(1, sizeof(struct block_data));
if (!data) {
- _E("calloc() failed");
+ _E("Failed to calloc().");
return NULL;
}
return "LUKS CLOSE";
}
- _E("invalid operation (%d)", op);
+ _E("Invalid operation(%d).", op);
return "unknown";
}
for (i = 0; i < DIR_NUM; ++i) {
snprintf(mmc_path, sizeof(mmc_path), "%s/%s", mount_path, mmc_default_path[i]);
if (!g_file_test(mmc_path, G_FILE_TEST_IS_DIR)) {
- _D("%s path did not exist", mmc_path);
+ _D("Path(%s) did not exist.", mmc_path);
ret = mkdir(mmc_path, 0777);
if (ret != 0)
- _E("mkdir failed: %d", errno);
+ _E("Failed to mkdir: %d", errno);
/*this fuction for emulator*/
/*at the first time, the directroies are made permission 755*/
ret = chmod(mmc_path, 0777);
if (ret != 0)
- _E("chmod failed: %d", errno);
+ _E("Failed to chmod: %d", errno);
ret = chown(mmc_path, 0, 10001);
if (ret != 0)
- _E("chown failed: %d", errno);
+ _E("Failed to chown: %d", errno);
}
}
}
ret = dbus_handle_method_async(PKGDIR_BUS_NAME, PKGDIR_PATH,
PKGDIR_INTERFACE, "CreateExternalDirsForAllPkgs", NULL, NULL);
if (ret)
- _E("Fail to create external directory");
+ _E("Failed to create external directory.");
}
static int pipe_trigger(enum block_dev_operation op,
struct pipe_data pdata = { op, bdev, result };
int n;
- _D("op : %s, bdev : %p, result : %d",
+ _D("op=%s bdev=%p result=%d",
get_operation_char(pdata.op),
pdata.bdev, pdata.result);
n = read(fd, &pdata, sizeof(pdata));
if (n != sizeof(pdata) || !pdata.bdev) {
- _E("fail to read struct pipe data");
+ _E("Failed to read struct pipe data.");
goto out;
}
- _I("op : %s, bdev : %p, result : %d",
+ _I("op=%s bdev=%p result=%d",
get_operation_char(pdata.op),
pdata.bdev, pdata.result);
MMC_POPUP_NOTI,
g_variant_new("(s)", MMC_INSERTED));
if (ret != 0)
- _E("Popup failed: %d", ret);
+ _E("Failed to popup: %d", ret);
}
if (pdata.op == BLOCK_DEV_UNMOUNT) {
/* Remove file for block device /run/xxxxxx/id */
MMC_POPUP_NOTI,
g_variant_new("(s)", MMC_REMOVED));
if (ret != 0)
- _E("Popup failed: %d", ret);
+ _E("Failed to popup: %d", ret);
}
}
else if (pdata.bdev->on_private_op == REQ_PRIVATE) {
if (pdata.op == BLOCK_DEV_UNMOUNT) {
pdata.bdev->on_private_op = REQ_NORMAL;
- _D("Private operation state: %d", pdata.bdev->on_private_op);
+ _D("Private operation state(%d).", pdata.bdev->on_private_op);
}
} else {
if (pdata.op == BLOCK_DEV_MOUNT) {
pdata.bdev->on_private_op = REQ_PRIVATE;
- _D("Private operation state: %d", pdata.bdev->on_private_op);
+ _D("Private operation state(%d).", pdata.bdev->on_private_op);
}
}
ret = add_fd_read_handler(pfds[0], pipe_cb,
NULL, NULL, &phandler);
if (ret < 0) {
- _E("Failed to add pipe handler (%d)", ret);
+ _E("Failed to add pipe handler: %d", ret);
return ret;
}
for (wait = 0; wait < 10; wait++) {
udev = udev_new();
if (!udev) {
- _E("fail to create udev library context");
+ _E("Failed to create udev library context.");
return -EPERM;
}
dev = udev_device_new_from_syspath(udev, data->syspath);
if (!dev) {
- _E("fail to create new udev device");
+ _E("Failed to create new udev device.");
udev_unref(udev);
return -EPERM;
}
udev_device_get_sysattr_value(dev, "ro"),
mount_point_updated);
if (r < 0)
- _E("fail to update block data for %s", data->devnode);
+ _E("Failed to update block data for %s.", data->devnode);
udev_device_unref(dev);
udev_unref(udev);
}
if (!data->fs_type) {
- _E("There is no file system");
+ _E("There is no file system.");
BLOCK_FLAG_SET(data, FS_EMPTY);
r = -ENODATA;
goto out;
}
if (!fs) {
- _E("Not supported file system (%s)", data->fs_type);
+ _E("Not supported file system(%s).", data->fs_type);
BLOCK_FLAG_SET(data, FS_NOT_SUPPORTED);
r = -ENOTSUP;
goto out;
assert(bdev->data);
data = bdev->data;
- _I("Mount Start : (%s -> %s)",
+ _I("Mount Start (%s -> %s).",
data->devnode, data->mount_point);
/* mount operation */
r = block_mount(data);
if (r != -EROFS && r < 0) {
- _E("fail to mount %s device : %d", data->devnode, r);
+ _E("Failed to mount device(%s): %d", data->devnode, r);
goto out;
}
/* app2ext_migrate_legacy_all has dbus method call to deviced */
ret = app2ext_migrate_legacy_all();
if (ret < 0)
- _E("app2ext failed");
+ _E("Failed to app2ext.");
}
out:
if (r < 0 && r != -EROFS)
data->state = BLOCK_UNMOUNT;
- _I("%s result : %s, %d", __func__, data->devnode, r);
+ _I("%s result=%s: %d", __func__, data->devnode, r);
if (pipe_trigger(BLOCK_DEV_MOUNT, bdev, r) < 0)
- _E("fail to trigger pipe");
+ _E("Failed to trigger pipe.");
return r;
}
data = bdev->data;
if (data->state == BLOCK_MOUNT) {
- _I("%s is already mounted", data->devnode);
+ _I("%s is already mounted.", data->devnode);
return 0;
}
if (!block_conf[data->block_type].multimount &&
!data->primary) {
- _I("Not support multi mount by config info");
+ _I("Not support multi mount by config info.");
return 0;
}
r = mount_start(bdev);
if (r < 0) {
- _E("Failed to mount (%s)", data->devnode);
+ _E("Failed to mount %s.", data->devnode);
return r;
}
if (!r)
goto out;
if (option == UNMOUNT_NORMAL) {
- _I("Failed to unmount with normal option : %d", r);
+ _I("Failed to unmount with normal option: %d", r);
return r;
}
- _I("Execute force unmount!");
+ _I("Execute force unmount.");
/* Force Unmount Scenario */
while (1) {
switch (retry++) {
data->primary) {
/* At first, notify to other app
* who already access sdcard */
- _I("Notify to other app who already access sdcard");
+ _I("Notify to other app who already access sdcard.");
vconf_set_int(VCONFKEY_SYSMAN_MMC_STATUS,
VCONFKEY_SYSMAN_MMC_INSERTED_NOT_MOUNTED);
}
break;
case 1:
/* Second, kill app with SIGTERM */
- _I("Kill app with SIGTERM");
+ _I("Kill app with SIGTERM.");
terminate_process(data->mount_point, false);
break;
case 2:
/* Last time, kill app with SIGKILL */
- _I("Kill app with SIGKILL");
+ _I("Kill app with SIGKILL.");
terminate_process(data->mount_point, true);
break;
default:
if (umount2(data->mount_point, MNT_DETACH) != 0) {
- _I("Failed to unmount with lazy option : %d",
+ _I("Failed to unmount with lazy option: %d",
errno);
return -errno;
}
r = mmc_check_and_unmount(data->mount_point);
if (!r) {
- _D("Success to unmount (%s)", data->mount_point);
+ _D("Success to unmount '%s'.", data->mount_point);
break;
}
}
data->state = BLOCK_UNMOUNT;
if (rmdir(data->mount_point) < 0)
- _E("fail to remove %s directory", data->mount_point);
+ _E("Failed to remove '%s' directory.", data->mount_point);
return r;
}
data = bdev->data;
if (data->state == BLOCK_UNMOUNT) {
- _I("%s is already unmounted", data->devnode);
+ _I("%s is already unmounted.", data->devnode);
r = mmc_check_and_unmount(data->mount_point);
if (r < 0)
- _E("The path was existed, but could not delete it(%s)",
+ _E("The path was existed, but could not delete it(%s).",
data->mount_point);
return 0;
}
- _I("Unmount Start : (%s -> %s)",
+ _I("Unmount Start. '%s' -> '%s'.",
data->devnode, data->mount_point);
r = block_unmount(bdev, option);
if (r < 0) {
- _E("fail to unmount %s device : %d", data->devnode, r);
+ _E("Failed to unmount %s device: %d", data->devnode, r);
goto out;
}
BLOCK_FLAG_MOUNT_CLEAR(data);
out:
- _I("%s result : %s, %d", __func__, data->devnode, r);
+ _I("%s result=%s: %d", __func__, data->devnode, r);
if (pipe_trigger(BLOCK_DEV_UNMOUNT, bdev, r) < 0)
- _E("fail to trigger pipe");
+ _E("Failed to trigger pipe.");
return r;
}
if (!fs) {
BLOCK_FLAG_SET(data, FS_NOT_SUPPORTED);
- _E("not supported file system(%s)", fstype);
+ _E("Not supported file system(%s).", fstype);
return -ENOTSUP;
}
- _I("format path : %s", data->devnode);
+ _I("Format path=%s", data->devnode);
fs->check(data->devnode);
r = fs->format(data->devnode);
if (r < 0) {
- _E("fail to format block data for %s", data->devnode);
+ _E("Failed to format block data for %s.", data->devnode);
goto out;
}
data = bdev->data;
- _I("Format Start : (%s -> %s)",
+ _I("Format Start. '%s' -> '%s'.",
data->devnode, data->mount_point);
if (data->state == BLOCK_MOUNT) {
r = block_unmount(bdev, option);
if (r < 0) {
- _E("fail to unmount %s device : %d", data->devnode, r);
+ _E("Failed to unmount %s device: %d", data->devnode, r);
goto out;
}
}
r = block_format(data, fs_type, bdev->mount_point_updated);
if (r < 0)
- _E("fail to format %s device : %d", data->devnode, r);
+ _E("Failed to format %s device: %d", data->devnode, r);
out:
- _I("%s result : %s, %d", __func__, data->devnode, r);
+ _I("%s result=%s: %d", __func__, data->devnode, r);
r = pipe_trigger(BLOCK_DEV_FORMAT, bdev, r);
if (r < 0)
- _E("fail to trigger pipe");
+ _E("Failed to trigger pipe.");
return r;
}
fdata = (struct format_data *)malloc(sizeof(struct format_data));
if (!fdata) {
- _E("fail to allocate format data");
+ _E("Failed to allocate format data.");
return NULL;
}
l = DD_LIST_FIND(th_manager[thread_id].block_dev_list, bdev);
pthread_mutex_unlock(&(th_manager[thread_id].mutex));
if (!l) {
- _E("(%s) does not exist in the device list", bdev->data->devnode);
+ _E("'%s' does not exist in the device list.", bdev->data->devnode);
return -ENOENT;
}
/* mount automatically */
ret = mount_block_device(bdev);
if (ret < 0)
- _E("fail to mount block device for %s", bdev->data->devnode);
+ _E("Failed to mount block device for %s.", bdev->data->devnode);
return ret;
}
l = DD_LIST_FIND(th_manager[thread_id].block_dev_list, bdev);
pthread_mutex_unlock(&(th_manager[thread_id].mutex));
if (!l) {
- _E("(%s) does not exist in the device list", bdev->data->devnode);
+ _E("'%s' does not exist in the device list.", bdev->data->devnode);
ret = -ENOENT;
goto out;
}
ret = format_block_device(bdev, fdata->fs_type, fdata->option);
if (ret < 0)
- _E("fail to format block device for %s", bdev->data->devnode);
+ _E("Failed to format block device for %s.", bdev->data->devnode);
out:
release_format_data(fdata);
ret = unmount_block_device(bdev, option);
if (ret < 0) {
- _E("Failed to unmount block device (%s)", bdev->data->devnode);
+ _E("Failed to unmount block device(%s).", bdev->data->devnode);
return ret;
}
DD_LIST_FOREACH_SAFE(bdev->op_queue, l, next, op) {
if (op->done) {
- _D("Remove operation (%s, %s)",
+ _D("Remove operation(%s, %s).",
get_operation_char(op->op),
bdev->data->devnode);
DD_LIST_FOREACH(*queue, l, temp) {
if (temp->op == BLOCK_DEV_UNMOUNT) {
unmounted = true;
- _D("Operation queue has unmount operation");
+ _D("Operation queue has unmount operation.");
break;
}
}
operation = op->op;
- _D("Thread id %d Trigger operation (%s, %s)", thread_id,
+ _D("Thread id(%d) Trigger operation(%s, %s)", thread_id,
get_operation_char(operation), devnode);
unmounted = false;
if (operation == BLOCK_DEV_INSERT && bdev->removed) {
check_removed(bdev, &queue, &op);
operation = op->op;
- _D("Trigger operation again (%s, %s)",
+ _D("Trigger operation again(%s, %s).",
get_operation_char(operation), devnode);
}
if (operation == BLOCK_DEV_MOUNT) {
unmounted = check_unmount(bdev, &queue, &op);
if (unmounted) {
operation = op->op;
- _D("Trigger operation again (%s, %s)",
+ _D("Trigger operation again(%s, %s).",
get_operation_char(operation), devnode);
}
}
break;
case BLOCK_DEV_MOUNT:
ret = block_mount_device(bdev, op->data);
- _D("Mount (%s) result:(%d)", devnode, ret);
+ _D("Mount '%s': %d", devnode, ret);
break;
case BLOCK_DEV_FORMAT:
ret = block_format_device(bdev, op->data);
- _D("Format (%s) result:(%d)", devnode, ret);
+ _D("Format '%s': %d", devnode, ret);
break;
case BLOCK_DEV_UNMOUNT:
ret = block_unmount_device(bdev, op->data);
- _D("Unmount (%s) result:(%d)", devnode, ret);
+ _D("Unmount '%s': %d", devnode, ret);
break;
case BLOCK_DEV_REMOVE:
/* Do nothing */
case BLOCK_LUKS_CLOSE:
ret = ode_luks_close_sync(EXTENDEDSD_NAME);
if (ret < 0)
- _E("Failed on ode_luks_close(%s)", EXTENDEDSD_NAME);
+ _E("Failed on ode_luks_close(%s).", EXTENDEDSD_NAME);
break;
default:
- _E("Operation type is invalid (%d)", op->op);
+ _E("Operation type(%d) is invalid.", op->op);
ret = -EINVAL;
break;
}
if (operation == BLOCK_DEV_INSERT || operation == BLOCK_DEV_REMOVE || operation == BLOCK_LUKS_CLOSE) {
if (pipe_trigger(operation, bdev, 0) < 0)
- _E("fail to trigger pipe");
+ _E("Failed to trigger pipe.");
}
} while (true);
thread_id = th->thread_id;
if (thread_id < 0 || thread_id >= THREAD_MAX) {
- _E("Thread Number: %d", th->thread_id);
+ _E("Thread Number=%d.", th->thread_id);
return NULL;
}
do {
pthread_mutex_lock(&(th_manager[thread_id].mutex));
if (th_manager[thread_id].op_len == 0) {
- _D("Operation queue of thread is empty");
+ _D("Operation queue of thread is empty.");
pthread_cond_wait(&(th_manager[thread_id].cond), &(th_manager[thread_id].mutex));
- _D("Wake up %d", thread_id);
+ _D("Wake up thread=%d.", thread_id);
}
DD_LIST_FOREACH(th_manager[thread_id].block_dev_list, elem, temp) {
do {
op = DD_LIST_NTH(queue, 0);
if (!op) {
- _D("Operation queue for device %s is Empty", temp->data->devnode);
+ _D("Operation queue for device %s is Empty.", temp->data->devnode);
break;
}
if (op->done) {
return min;
}
- _E("Finding thread is failed");
+ _E("Failed to find thread.");
DD_LIST_APPEND(th_manager[0].th_node_list, th_node);
return 0;
}
return -EINVAL;
- _I("Add operation (%s, %s)",
+ _I("Add operation(%s, %s).",
get_operation_char(operation),
bdev->data->devnode);
thread_id = bdev->thread_id;
if (thread_id < 0 || thread_id >= THREAD_MAX) {
- _E("Fail to find thread to add");
+ _E("Failed to find thread to add.");
return -EPERM;
}
op = (struct operation_queue *)malloc(sizeof(struct operation_queue));
if (!op) {
- _E("malloc failed");
+ _E("Failed to malloc.");
return -ENOMEM;
}
bdev->data->block_type == BLOCK_MMC_DEV &&
bdev->data->primary)
if (app2ext_disable_all_external_pkgs() < 0)
- _E("app2ext_disable_all_external_pkgs() failed");
+ _E("Failed to app2ext_disable_all_external_pkgs().");
/* LOCK
* during adding queue and checking the queue length */
/* UNLOCK */
if (!start_th) {
- _D("Start New thread for block device");
+ _D("Start new thread for block device.");
th_manager[thread_id].start_th = true;
ret = pthread_create(&(th_manager[thread_id].th), NULL, block_th_start, &th_manager[thread_id]);
if (ret != 0) {
- _E("fail to create thread for %s", bdev->data->devnode);
+ _E("Failed to create thread for %s.", bdev->data->devnode);
return -EPERM;
}
dp = opendir(syspath);
if (!dp) {
- _E("fail to open %s", syspath);
+ _E("Failed to open '%s'.", syspath);
goto out;
}
partition = check_partition(dev);
if (partition) {
/* if there is a partition, skip this request */
- _I("%s device has partitions, skip this time", devnode);
+ _I("%s device has partitions, skip this time.", devnode);
return 0;
}
}
if (!data) {
- _E("fail to make block data for %s", devnode);
+ _E("Failed to make block data for %s.", devnode);
return -EPERM;
}
if (!block_conf[data->block_type].multimount && !data->primary &&
data->fs_usage && !strcmp(data->fs_usage, FILESYSTEM_NAME)) {
- _D("Not support multi mount by config info");
+ _D("Not support multi mount by config info.");
free_block_data(data);
return -EPERM;
}
if (!block_control) {
if (!mapper && strncmp(data->fs_type, LUKS_NAME, strlen(LUKS_NAME))) {
- _D("Block module is disabled");
+ _D("Block module is disabled.");
free_block_data(data);
return -EPERM;
}
bdev = make_block_device(data);
if (!bdev) {
- _E("fail to make block device for %s", devnode);
+ _E("Failed to make block device for %s.", devnode);
free_block_data(data);
return -EPERM;
}
thread_id = find_thread(bdev->data->devnode);
if (thread_id < 0 || thread_id >= THREAD_MAX) {
- _E("Fail to find thread to add");
+ _E("Failed to find thread to add.");
free_block_device(bdev);
return -EPERM;
}
fdata = get_format_data(NULL, UNMOUNT_FORCE);
if (!fdata) {
- _E("Failed to get format data");
+ _E("Failed to get format data.");
return -ENOMEM;
}
ret = add_operation(bdev, BLOCK_DEV_FORMAT, NULL, (void *)fdata);
if (ret < 0) {
- _E("Failed to add operation (format %s)", bdev->data->devnode);
+ _E("Failed to add operation(format, %s).", bdev->data->devnode);
release_format_data(fdata);
}
}
if (!bdev->data->fs_type) {
- _E("Unformatted Storage");
+ _E("Unformatted Storage.");
free_block_device(bdev);
return -EPERM;
} else if (!strncmp(bdev->data->fs_type, LUKS_NAME, strlen(LUKS_NAME))) {
// bdev->data->block_type = BLOCK_EXTENDEDSD_DEV;
bdev->data->primary = true;
- _D("Need to unlock encrypted sdcard");
+ _D("Need to unlock encrypted sdcard.");
// ---- ODE UI launch ----
ret = launch_system_app(POPUP_DEFAULT
, 8
, MAPPING_NODE_KEY
, EXTENDEDSD_NAME);
if (ret < 0)
- _E("Failed to launch popup");
+ _E("Failed to launch popup.");
ret = add_operation(bdev, BLOCK_DEV_INSERT, NULL, (void *)data);
if (ret < 0) {
- _E("Failed to add operation (insert %s)", devnode);
+ _E("Failed to add operation(insert, %s).", devnode);
free_block_device(bdev);
return ret;
}
ret = add_operation(bdev, BLOCK_DEV_INSERT, NULL, (void *)data);
if (ret < 0) {
- _E("Failed to add operation (insert %s)", devnode);
+ _E("Failed to add operation(insert, %s).", devnode);
free_block_device(bdev);
return ret;
}
// Not a regular filesystem -> skip mounting
if (!bdev->data->fs_usage || strcmp(bdev->data->fs_usage, FILESYSTEM_NAME)) {
- _I("Not a filesystem. Not mounting");
+ _I("Not a filesystem. Not mounting.");
return 0;
}
create_file(bdev->data->id, bdev->data->mount_point, bdev->data->block_type == BLOCK_EXTENDEDSD_DEV);
ret = add_operation(bdev, BLOCK_DEV_MOUNT, NULL, NULL);
if (ret < 0) {
- _E("Failed to add operation (mount %s)", devnode);
+ _E("Failed to add operation(mount, %s).", devnode);
return ret;
}
return 0;
bdev = find_block_device(devnode);
if (!bdev) {
- _E("fail to find block data for %s", devnode);
+ _E("Failed to find block data for %s.", devnode);
return -ENODEV;
}
bdev->removed = true;
if (bdev->on_private_op != REQ_NORMAL) {
bdev->on_private_op = REQ_NORMAL;
- _D("Private operation state: %d", bdev->on_private_op);
+ _D("Private operation state(%d).", bdev->on_private_op);
}
if (!strncmp(bdev->data->fs_type, LUKS_NAME, strlen(LUKS_NAME))) {
bdev_extended->removed = true;
if (bdev_extended->on_private_op != REQ_NORMAL) {
bdev_extended->on_private_op = REQ_NORMAL;
- _D("Private operation state: %d", bdev_extended->on_private_op);
+ _D("Private operation state(%d).", bdev_extended->on_private_op);
}
ret = add_operation(bdev_extended, BLOCK_DEV_UNMOUNT, NULL, (void *)UNMOUNT_FORCE);
if (ret < 0) {
- _E("Failed to add operation (unmount %s)", devnode);
+ _E("Failed to add operation(unmount, %s).", devnode);
return ret;
}
ret = add_operation(bdev_extended, BLOCK_LUKS_CLOSE, NULL, NULL);
if (ret < 0) {
- _E("Failed to add operation (luks_close %s)", devnode);
+ _E("Failed to add operation(luks_close, %s).", devnode);
return ret;
}
ret = add_operation(bdev_extended, BLOCK_DEV_REMOVE, NULL, NULL);
if (ret < 0) {
- _E("Failed to add operation (remove %s)", devnode);
+ _E("Failed to add operation(remove, %s).", devnode);
return ret;
}
} else
- _E("fail to find block data for extended sd card");
+ _E("Failed to find block data for extended sd card.");
}
ret = add_operation(bdev, BLOCK_DEV_UNMOUNT, NULL, (void *)UNMOUNT_FORCE);
if (ret < 0) {
- _E("Failed to add operation (unmount %s)", devnode);
+ _E("Failed to add operation(unmount, %s).", devnode);
return ret;
}
ret = add_operation(bdev, BLOCK_DEV_REMOVE, NULL, NULL);
if (ret < 0) {
- _E("Failed to add operation (remove %s)", devnode);
+ _E("Failed to add operation(remove, %s).", devnode);
return ret;
}
if (!fnmatch(MMC_PATH, devnode, 0)) {
sscanf(name, "mmcblk%d", &dev_num);
if (dev_internal == dev_num) {
- _D("%s is internal storage", devnode);
+ _D("%s is internal storage.", devnode);
return 0;
}
} else if (!fnmatch(SCSI_PATH, devnode, 0)) {
sscanf(name, "sd%c", &dev_scsi);
if (dev_internal_scsi == dev_scsi) {
- _D("%s is internal storage", devnode);
+ _D("%s is internal storage.", devnode);
return 0;
}
}
if (!fnmatch(MMC_LINK_PATH, devnode, 0)) {
sscanf(name, "vd%c%d", &emul, &dev_temp);
if (dev_internal_emul == emul) {
- _D("%s is internal storage", devnode);
+ _D("%s is internal storage.", devnode);
return 0;
}
}
udev = udev_new();
if (!udev) {
- _E("fail to create udev library context");
+ _E("Failed to create udev library context.");
return -EPERM;
}
/* create a list of the devices in the 'usb' subsystem */
enumerate = udev_enumerate_new(udev);
if (!enumerate) {
- _E("fail to create an enumeration context");
+ _E("Failed to create an enumeration context.");
return -EPERM;
}
r = check_already_handled(devnode);
if (r < 0) {
- _I("%s is already handled", devnode);
+ _I("%s is already handled.", devnode);
udev_device_unref(dev);
continue;
}
- _I("%s device add", devnode);
+ _I("%s device add.", devnode);
add_block_device(dev, devnode, false);
udev_device_unref(dev);
if (bdev->removed)
continue;
_D("%s:", data->devnode);
- _D("\tSyspath: %s", data->syspath);
- _D("\tBlock type: %d", data->block_type);
- _D("\tFs type: %s", data->fs_type);
- _D("\tFs usage: %s", data->fs_usage);
- _D("\tFs version: %s", data->fs_version);
- _D("\tFs uuid enc: %s", data->fs_uuid_enc);
- _D("\tReadonly: %s",
+ _D("\tSyspath=%s", data->syspath);
+ _D("\tBlock type=%d", data->block_type);
+ _D("\tFs type=%s", data->fs_type);
+ _D("\tFs usage=%s", data->fs_usage);
+ _D("\tFs version=%s", data->fs_version);
+ _D("\tFs uuid enc=%s", data->fs_uuid_enc);
+ _D("\tReadonly=%s",
(data->readonly ? "true" : "false"));
- _D("\tMount point: %s", data->mount_point);
- _D("\tMount state: %s",
+ _D("\tMount point=%s", data->mount_point);
+ _D("\tMount state=%s",
(data->state == BLOCK_MOUNT ?
"mount" : "unmount"));
- _D("\tPrimary: %s",
+ _D("\tPrimary=%s",
(data->primary ? "true" : "false"));
- _D("\tID: %d", data->id);
+ _D("\tID=%d", data->id);
}
pthread_mutex_unlock(&(th_manager[i].mutex));
}
bdev->removed = true;
r = add_operation(bdev, BLOCK_DEV_UNMOUNT, NULL, (void *)UNMOUNT_FORCE);
if (r < 0)
- _E("Failed to add operation (unmount %s)", bdev->data->devnode);
+ _E("Failed to add operation(unmount, %s).", bdev->data->devnode);
r = add_operation(bdev, BLOCK_DEV_REMOVE, NULL, NULL);
if (r < 0)
- _E("Failed to add operation (remove %s)", bdev->data->devnode);
+ _E("Failed to add operation(remove, %s).", bdev->data->devnode);
} else
break;
} while (true);
if (done > 0)
return;
done = 1;
- _I("Booting done");
+ _I("Booting done.");
/* register mmc uevent control routine */
ret = register_udev_uevent_control(&uh);
if (ret < 0)
- _E("fail to register block uevent : %d", ret);
+ _E("Failed to register block uevent: %d", ret);
block_control = true;
/* if there is the attached device, try to mount */
if (status > 0)
return;
status = 1;
- _I("Power off");
+ _I("Power off.");
/* unregister mmc uevent control routine */
unregister_udev_uevent_control(&uh);
remove_whole_block_device();
if (!action)
return;
- _I("%s device %s", devnode, action);
+ _I("%s device %s.", devnode, action);
if (!strncmp(action, UDEV_ADD, sizeof(UDEV_ADD)) ||
(mapper && !strcmp(action, UDEV_CHANGE))) {
r = check_already_handled(devnode);
if (r < 0) {
- _I("%s is already handled", devnode);
+ _I("%s is already handled.", devnode);
return;
}
struct block_device *bdev;
bdev = find_block_device(devnode);
if (!bdev) {
- _E("fail to find block data for %s", devnode);
+ _E("Failed to find block data for %s.", devnode);
return;
}
if (!udev_device_get_property_value(dev, "ID_FS_TYPE"))
udev_device_get_sysattr_value(dev, "ro"),
false);
if (r < 0)
- _E("fail to update block data for %s", bdev->data->devnode);
+ _E("Failed to update block data for %s.", bdev->data->devnode);
if (!strncmp(bdev->data->fs_type, LUKS_NAME, strlen(LUKS_NAME)))
- _I("filesystem type is updated: crypto_LUKS");
+ _I("Filesystem type(crypto_LUKS) is updated.");
if (bdev->data->fs_usage)
- _I("fs_usage: %s", bdev->data->fs_usage);
+ _I("fs_usage=%s", bdev->data->fs_usage);
}
}
int ret = -EBADMSG;
if (!block_control) {
- _D("Block module is disabled");
+ _D("Block module is disabled.");
ret = -EPERM;
goto out;
}
bdev = find_block_device_by_id(id);
if (!bdev) {
- _E("Failed to find (%d) in the device list", id);
+ _E("Failed to find (%d) in the device list.", id);
ret = -ENOENT;
goto out;
}
if (bdev->data->block_type == BLOCK_EXTENDEDSD_DEV ||
!strncmp(bdev->data->fs_type, LUKS_NAME, strlen(LUKS_NAME))) {
- _D("Mount dbus request for extended internal storage is blocked");
+ _D("Mount dbus request for extended internal storage is blocked.");
ret = -EPERM;
goto out;
}
}
if (bdev->data->state == BLOCK_MOUNT) {
- _I("%s is already mounted", bdev->data->devnode);
+ _I("%s is already mounted.", bdev->data->devnode);
ret = -EALREADY;
goto out;
}
if (onprivate) {
bdev->on_private_op = REQ_PRIVATE;
bdev->private_pid = dbus_handle_get_sender_pid(NULL, sender);
- _D("Private operation state: %d pid: %d", bdev->on_private_op, bdev->private_pid);
+ _D("Private operation state(%d). pid=%d.", bdev->on_private_op, bdev->private_pid);
} else {
if (bdev->on_private_op != REQ_NORMAL) {
- _E("Failed to process mount operation");
+ _E("Failed to process mount operation.");
ret = -EPERM;
goto out;
}
ret = add_operation(bdev, BLOCK_DEV_MOUNT, invocation, NULL);
if (ret < 0) {
- _E("Failed to add operation (mount %s)", bdev->data->devnode);
+ _E("Failed to add operation(mount, %s).", bdev->data->devnode);
goto out;
}
int ret = -EBADMSG;
if (!block_control) {
- _D("Block module is disabled");
+ _D("Block module is disabled.");
ret = -EPERM;
goto out;
}
bdev = find_block_device_by_id(id);
if (!bdev) {
- _E("Failed to find (%d) in the device list", id);
+ _E("Failed to find (%d) in the device list.", id);
ret = -ENOENT;
goto out;
}
/* Unmount dbus call is needed when app proceeds extended internal -> portable storage */
if (!strncmp(bdev->data->fs_type, LUKS_NAME, strlen(LUKS_NAME))) {
- _D("Unmount dbus request for extended internal storage is blocked");
+ _D("Unmount dbus request for extended internal storage is blocked.");
ret = -EPERM;
goto out;
}
if (onprivate) {
pid = dbus_handle_get_sender_pid(NULL, sender);
if (bdev->on_private_op == REQ_NORMAL || (bdev->on_private_op != REQ_NORMAL && pid != bdev->private_pid)) {
- _E("Failed to process private unmount operation pid: %d private_pid: %d", pid, bdev->private_pid);
+ _E("Failed to process private unmount operation pid=%d private_pid=%d.", pid, bdev->private_pid);
ret = -EPERM;
goto out;
}
} else {
if (bdev->on_private_op != REQ_NORMAL) {
- _E("Failed to process unmount operation");
+ _E("Failed to process unmount operation.");
ret = -EPERM;
goto out;
}
ret = add_operation(bdev, BLOCK_DEV_UNMOUNT, invocation, (void *)option);
if (ret < 0) {
- _E("Failed to add operation (unmount %s)", bdev->data->devnode);
+ _E("Failed to add operation(unmount, %s).", bdev->data->devnode);
goto out;
}
if (bdev->data->block_type == BLOCK_EXTENDEDSD_DEV) {
ret = add_operation(bdev, BLOCK_LUKS_CLOSE, NULL, NULL);
if (ret < 0)
- _E("Failed to add operation (luks_close %s)", bdev->data->devnode);
+ _E("Failed to add operation(luks_close, %s).", bdev->data->devnode);
}
return NULL;
int prev_state;
if (!block_control) {
- _D("Block module is disabled");
+ _D("Block module is disabled.");
ret = -EPERM;
goto out;
}
bdev = find_block_device_by_id(id);
if (!bdev) {
- _E("Failed to find (%d) in the device list", id);
+ _E("Failed to find (%d) in the device list.", id);
goto out;
}
if (bdev->data->block_type == BLOCK_EXTENDEDSD_DEV ||
!strncmp(bdev->data->fs_type, LUKS_NAME, strlen(LUKS_NAME))) {
- _D("Format dbus request for extended internal storage is blocked");
+ _D("Format dbus request for extended internal storage is blocked.");
ret = -EPERM;
goto out;
}
pid = dbus_handle_get_sender_pid(NULL, sender);
if (bdev->on_private_op != REQ_NORMAL && pid != bdev->private_pid) {
- _E("Failed to format on private state");
+ _E("Failed to format on private state.");
ret = -EPERM;
goto out;
}
fdata = get_format_data(NULL, option);
if (!fdata) {
- _E("Failed to get format data");
+ _E("Failed to get format data.");
goto out;
}
if (prev_state == BLOCK_MOUNT) {
if (bdev->on_private_op == REQ_PRIVATE) {
bdev->on_private_op = REQ_PRIVATE_FORMAT;
- _D("Private operation state: %d", bdev->on_private_op);
+ _D("Private operation state(%d)", bdev->on_private_op);
}
ret = add_operation(bdev, BLOCK_DEV_UNMOUNT, NULL, (void *)UNMOUNT_FORCE);
if (ret < 0) {
- _E("Failed to add operation (unmount %s)", bdev->data->devnode);
+ _E("Failed to add operation(unmount, %s).", bdev->data->devnode);
release_format_data(fdata);
goto out;
}
ret = add_operation(bdev, BLOCK_DEV_FORMAT, invocation, (void *)fdata);
if (ret < 0) {
- _E("Failed to add operation (format %s)", bdev->data->devnode);
+ _E("Failed to add operation(format, %s).", bdev->data->devnode);
release_format_data(fdata);
}
/* Maintain previous state of mount/unmount */
if (prev_state == BLOCK_MOUNT) {
if (add_operation(bdev, BLOCK_DEV_MOUNT, NULL, NULL) < 0) {
- _E("Failed to add operation (mount %s)", bdev->data->devnode);
+ _E("Failed to add operation(mount, %s).", bdev->data->devnode);
goto out;
}
}
int prev_state;
if (!block_control) {
- _D("Block module is disabled");
+ _D("Block module is disabled.");
ret = -EPERM;
goto out;
}
bdev = find_block_device_by_id(id);
if (!bdev) {
- _E("Failed to find (%d) in the device list", id);
+ _E("Failed to find (%d) in the device list.", id);
goto out;
}
/* FormatwithType dbus call is needed when app proceeds extended internal -> portable storage */
if (bdev->data->block_type == BLOCK_EXTENDEDSD_DEV) {
- _D("FormatwithType dbus request for extended internal storage is blocked");
+ _D("FormatwithType dbus request for extended internal storage is blocked.");
ret = -EPERM;
goto out;
}
pid = dbus_handle_get_sender_pid(NULL, sender);
if (bdev->on_private_op != REQ_NORMAL && pid != bdev->private_pid) {
- _E("Failed to format on private state");
+ _E("Failed to format on private state.");
ret = -EPERM;
goto out;
}
fdata = get_format_data(type, option);
if (!fdata) {
- _E("Failed to get format data");
+ _E("Failed to get format data.");
goto out;
}
if (prev_state == BLOCK_MOUNT) {
if (bdev->on_private_op == REQ_PRIVATE) {
bdev->on_private_op = REQ_PRIVATE_FORMAT;
- _D("Private operation state: %d", bdev->on_private_op);
+ _D("Private operation state(%d).", bdev->on_private_op);
}
ret = add_operation(bdev, BLOCK_DEV_UNMOUNT, NULL, (void *)UNMOUNT_FORCE);
if (ret < 0) {
- _E("Failed to add operation (unmount %s)", bdev->data->devnode);
+ _E("Failed to add operation(unmount, %s).", bdev->data->devnode);
release_format_data(fdata);
goto out;
}
ret = add_operation(bdev, BLOCK_DEV_FORMAT, invocation, (void *)fdata);
if (ret < 0) {
- _E("Failed to add operation (format %s)", bdev->data->devnode);
+ _E("Failed to add operation(format, %s).", bdev->data->devnode);
release_format_data(fdata);
}
/* Maintain previous state of mount/unmount */
if (prev_state == BLOCK_MOUNT) {
if (add_operation(bdev, BLOCK_DEV_MOUNT, NULL, NULL) < 0) {
- _E("Failed to add operation (mount %s)", bdev->data->devnode);
+ _E("Failed to add operation(mount, %s).", bdev->data->devnode);
goto out;
}
}
g_variant_get(param, "(s)", &type);
if (!type) {
- _E("Delivered type is NULL");
+ _E("Delivered type is NULL.");
goto out;
}
- _D("Block (%s) device list is requested", type);
+ _D("Block (%s) device list is requested.", type);
if (!strncmp(type, BLOCK_TYPE_SCSI, sizeof(BLOCK_TYPE_SCSI)))
block_type = BLOCK_SCSI_DEV;
else if (!strncmp(type, BLOCK_TYPE_ALL, sizeof(BLOCK_TYPE_ALL)))
block_type = -1;
else {
- _E("Invalid type (%s) is requested", type);
+ _E("Invalid type (%s) is requested.", type);
goto out;
}
g_variant_get(param, "(s)", &type);
if (!type) {
- _E("Delivered type is NULL");
+ _E("Delivered type is NULL.");
goto out;
}
- _D("Block (%s) device list is requested", type);
+ _D("Block (%s) device list is requested.", type);
if (!strncmp(type, BLOCK_TYPE_SCSI, sizeof(BLOCK_TYPE_SCSI)))
block_type = BLOCK_SCSI_DEV;
else if (!strncmp(type, BLOCK_TYPE_ALL, sizeof(BLOCK_TYPE_ALL)))
block_type = -1;
else {
- _E("Invalid type (%s) is requested", type);
+ _E("Invalid type (%s) is requested.", type);
goto out;
}
goto out;
}
- _D("speed check: %s", data->devnode);
+ _D("Speed check %s.", data->devnode);
fd = open(data->devnode, O_RDONLY | O_DIRECT);
if (fd < 0) {
- _E("failed to open fd(%s) : %d", data->devnode, errno);
+ _E("Failed to open fd(%s): %d", data->devnode, errno);
result = -1;
goto out;
}
ret = posix_memalign((void**)&buf, 4096, SPEEDCHECK_SIZE << 20);
if (ret) {
- _E("posix_memalign() failed");
+ _E("Failed to posix_memalign().");
result = -1;
goto out_close;
}
clock_gettime(CLOCK_REALTIME, &start_time);
- _I("start time: %lu.%lu", start_time.tv_sec, start_time.tv_nsec);
+ _I("Start time=%lu.%lu", start_time.tv_sec, start_time.tv_nsec);
ret = read(fd, buf, SPEEDCHECK_SIZE << 20);
clock_gettime(CLOCK_REALTIME, &end_time);
- _I("end time %lu.%lu", end_time.tv_sec, end_time.tv_nsec);
+ _I("End time=%lu.%lu", end_time.tv_sec, end_time.tv_nsec);
free(buf);
if (ret < 0) {
- _E("read() failed %d", errno);
+ _E("Failed to read(): %d", errno);
result = -1;
goto out_close;
}
switch (enable) {
case 0:
- _I("control block Disable");
+ _I("Control block disable.");
result = 0;
block_stop(NULL);
break;
case 1:
- _I("control block Enable");
+ _I("Control block enable.");
result = 0;
block_start(NULL);
break;
default:
- _E("control block : Wrong request by client");
+ _E("Control block. Wrong request by client.");
result = 1;
break;
}
{
int result;
- _I("getcontrol block");
+ _I("Get control block.");
result = block_control;
ret = mount("tmpfs", root, "tmpfs", 0, "smackfsroot=System::Shared");
if (ret < 0) {
ret = -errno;
- _E("tmpfs mount failed (%d)", ret);
+ _E("Failed to mount tmpfs: %d", ret);
return ret;
}
/* load config */
ret = config_parse(BLOCK_CONF_FILE, load_config, NULL);
if (ret < 0)
- _E("fail to load %s, Use default value", BLOCK_CONF_FILE);
+ _E("Failed to load '%s'. Use default value.", BLOCK_CONF_FILE);
ret = mount_root_path_tmpfs();
if (ret < 0)
- _E("Failed to mount tmpfs to root mount path (%d)", ret);
+ _E("Failed to mount tmpfs to root mount path: %d", ret);
/* register block manager object and interface */
ret = dbus_handle_register_dbus_object(NULL, STORAGED_PATH_BLOCK_MANAGER, &block_interface);
if (ret < 0)
- _E("Failed to register block interface and methods (%d)", ret);
+ _E("Failed to register block interface and methods: %d", ret);
/* init pipe */
ret = pipe_init();
if (ret < 0)
- _E("fail to init pipe");
+ _E("Failed to init pipe.");
/* System Session is loaded completely */
id_booting_done = subscribe_dbus_signal(NULL, SYSTEMD_DBUS_PATH,
ret = remove_directory(EXTERNAL_STORAGE_PATH);
if (ret < 0)
- _E("Failed to remove directory");
+ _E("Failed to remove directory.");
ret = mkdir(EXTERNAL_STORAGE_PATH, 0755);
if (ret < 0)
_E("Failed to make directory: %d", errno);
ret = remove_directory(EXTENDED_INTERNAL_PATH);
if (ret < 0)
- _E("Failed to remove directory");
+ _E("Failed to remove directory.");
ret = mkdir(EXTENDED_INTERNAL_PATH, 0755);
if (ret < 0)
_E("Failed to make directory: %d", errno);
ret = get_internal_storage_number();
if (ret < 0)
- _E("Failed to get internal storage number");
+ _E("Failed to get internal storage number.");
}
static void block_exit(void *data)
/* unregister mmc uevent control routine */
ret = unregister_udev_uevent_control(&uh);
if (ret < 0)
- _E("fail to unregister block uevent : %d", ret);
+ _E("Failed to unregister block uevent: %d", ret);
/* remove remaining blocks */
remove_whole_block_device();
static int block_start(void *data)
{
if (!block_boot) {
- _E("Cannot be started. Booting is not ready");
+ _E("Cannot be started. Booting is not ready.");
return -ENODEV;
}
if (block_control) {
- _I("Already started");
+ _I("Already started.");
return 0;
}
block_init_from_udev_enumerate();
- _I("start");
+ _I("Start.");
return 0;
}
static int block_stop(void *data)
{
if (!block_boot) {
- _E("Cannot be stopped. Booting is not ready");
+ _E("Cannot be stopped. Booting is not ready.");
return -ENODEV;
}
if (!block_control) {
- _I("Already stopped");
+ _I("Already stopped.");
return 0;
}
block_control = false;
- _I("stop");
+ _I("Stop.");
return 0;
}
fd = open(devpath, O_RDONLY);
if (fd < 0) {
- _E("failed to open fd(%s) : %d", devpath, errno);
+ _E("Failed to open fd(%s): %d", devpath, errno);
return false;
}
if (r < 0)
goto error;
- _I("ext4 search magic : 0x%2x, 0x%2x", buf[0], buf[1]);
+ _I("Ext4 search magic=0x%2x, 0x%2x", buf[0], buf[1]);
if (memcmp(buf, ext4_info.magic, ext4_info.magic_sz))
goto error;
close(fd);
- _I("Storage type : %s", ext4_info.name);
+ _I("Storage type(%s)", ext4_info.name);
return true;
error:
close(fd);
- _E("failed to match with ext4(%s)", devpath);
+ _E("Failed to match with ext4(%s).", devpath);
return false;
}
do {
r = mount(devpath, mount_point, "ext4", mountflags, NULL);
if (!r) {
- _I("Storage Mounted[ext4]");
+ _I("Storage Mounted(ext4).");
if (smack) {
check_smack_popup();
mmc_check_smack(mount_point);
}
return 0;
}
- _I("mount fail : r = %d, err = %d", r, errno);
+ _I("Failed to mount. return=%d: %d", r, errno);
time.tv_nsec = 100 * NANO_SECOND_MULTIPLIER;
nanosleep(&time, NULL);
if (r < 0 && errno == EROFS)
r = setxattr(data->mount_point, "security.SMACK64TRANSMUTE",
"TRUE", strlen("TRUE"), 0);
if (r < 0)
- _E("setxattr error : %d", errno);
+ _E("Failed to setxattr: %d", errno);
if (extended)
mmc_update_state(VCONFKEY_SYSMAN_MMC_EXTENDEDINTERNAL_MOUNTED);
dp = opendir("/proc");
if (!dp) {
- _E("FAIL: open /proc");
+ _E("Failed to open /proc.");
return -1;
}
continue;
if (strncmp(buf2, mount_point, len) == 0)
- _D("Process %s : Opened files - %s", cmdline, buf2);
+ _D("Process(%s) opened files(%s).", cmdline, buf2);
}
closedir(dp_child);
}
switch (retry++) {
case 0:
/* Second, kill app with SIGTERM */
- _I("Kill app with SIGTERM");
+ _I("Kill app with SIGTERM.");
terminate_process(path, false);
time.tv_nsec = 500 * NANO_SECOND_MULTIPLIER;
nanosleep(&time, NULL);
break;
case 1:
/* Last time, kill app with SIGKILL */
- _I("Kill app with SIGKILL");
+ _I("Kill app with SIGKILL.");
terminate_process(path, true);
time.tv_nsec = 200 * NANO_SECOND_MULTIPLIER;
nanosleep(&time, NULL);
ret = umount2(path, 0);
break;
}
- _I("ret %d retry %d", ret, retry);
+ _I("ret=%d retry=%d", ret, retry);
}
if (ret) {
if (force)
ret = umount2(path, 0);
}
if (ret)
- _I("Failed to unmount %s", path);
+ _I("Failed to unmount '%s'.", path);
else
- _I("%s unmounted successfully", path);
+ _I("'%s' unmounted successfully.", path);
return ret;
}
switch (r) {
case 0:
- _I("filesystem check completed OK");
+ _I("Filesystem check completed OK.");
return 0;
case 2:
- _I("file system check failed (not a FAT filesystem)");
+ _I("Failed to check file system(not a FAT filesystem).");
errno = ENODATA;
return -1;
case 4:
if (pass++ <= 2) {
- _I("filesystem modified - rechecking (pass : %d)", pass);
+ _I("Filesystem modified. Rechecking(pass=%d).", pass);
continue;
}
- _I("failing check after rechecks, but file system modified");
+ _I("Failed to check after rechecks. But file system modified.");
errno = EIO;
return -1;
default:
- _I("filesystem check failed (unknown exit code %d)", r);
+ _I("Failed to check filesystem: %d", r);
errno = EIO;
return -1;
}
r = vfat_check(devpath);
if (r < 0) {
- _E("failed to match with vfat(%s)", devpath);
+ _E("Failed to match with vfat(%s).", devpath);
return false;
}
- _I("Storage type : %s", vfat_info.name);
+ _I("Storage type(%s).", vfat_info.name);
return true;
}
do {
r = mount(devpath, mount_point, "vfat", mountflags, options);
if (!r) {
- _I("Storage Mounted [vfat]");
+ _I("Storage Mounted vfat.");
return 0;
}
- _I("mount fail : r = %d, err = %d", r, errno);
+ _I("Failed to mount return=%d: %d", r, errno);
time.tv_nsec = 100 * NANO_SECOND_MULTIPLIER;
nanosleep(&time, NULL);
if (r < 0 && errno == EROFS)
&err);
if (ret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) {
if (dbus_error_is_set(&err)) {
- _E("Failed to request dbus name (%s, %s, %s)", bus, err.name, err.message);
+ _E("Failed to request dbus name(%s err.name=%s err.message=%s).", bus, err.name, err.message);
dbus_error_free(&err);
} else
- _E("Failed to request dbus name (%s)", bus);
+ _E("Failed to request dbus name(%s).", bus);
return -ECOMM;
}
}
static void sig_quit(int signo)
{
- _D("received SIGTERM signal %d", signo);
+ _D("Received SIGTERM signal(%d).", signo);
g_main_loop_quit(loop);
}
static void sig_usr1(int signo)
{
- _D("received SIGUSR1 signal %d, storaged'll be finished!", signo);
+ _D("Received SIGUSR1 signal %d. Storaged'll be finished.", signo);
g_main_loop_quit(loop);
}
{
int ret = aw_notify();
if (ret < 0)
- _E("aw_notify failed(%d)", ret);
+ _E("Failed to aw_notify:%d", ret);
}
static gboolean watchdog_cb(gpointer data)
ret = remove_directory(STORAGED_DIR_PATH);
if (ret < 0)
- _E("Failed to remove directory");
+ _E("Failed to remove directory.");
ret = mkdir(STORAGED_DIR_PATH, 0644);
if (ret < 0)
_E("Failed to make directory: %d", errno);
loop = g_main_loop_new(NULL, TRUE);
if (!loop) {
- _E("Failed to make main loop");
+ _E("Failed to make main loop.");
return -ENOMEM;
}
handle = dbus_handle_get_connection(G_BUS_TYPE_SYSTEM, FALSE);
if (!handle)
- _E("Fail to get dbus connection");;
+ _E("Failed to get dbus connection.");;
dir_init();
modules_init(NULL);
ret = dbus_handle_request_bus_name(handle, STORAGED_BUS_NAME, dbus_name_acquired, NULL);
if (ret <= 0) {
- _E("Fail to request bus name");
+ _E("Failed to request bus name.");
dbus_handle_check_owner_name(NULL, STORAGED_BUS_NAME);
}
if (timer > 0) {
ret = aw_register(WATCHDOG_TIMEOUT * 6);
if (ret < 0)
- _E("aw_register failed");
+ _E("Failed to aw_register.");
}
g_main_loop_run(loop);
return -EINVAL;
if (access(name, F_OK) != 0) {
- _E("(%s) module does not exist !", name);
+ _E("Module(%s) does not exist.", name);
return -ENOENT;
}
handle = dlopen(name, RTLD_NOW);
if (!handle) {
- _E("dlopen (%s) failed (%s)", name, dlerror());
+ _E("Failed to dlopen(%s): %s", name, dlerror());
ret = -EPERM;
goto out;
}
get_interface = dlsym(handle, "storaged_get_module_interface");
if (!get_interface) {
- _E("dlsym failed(%s)", dlerror());
+ _E("Failed to dlsym: %s", dlerror());
ret = -EPERM;
goto out;
}
plugin = get_interface();
if (!plugin) {
- _E("invalid plugin function");
+ _E("Invalid plugin function.");
ret = -EINVAL;
goto out;
}
dp = opendir(PLUGIN_PATH);
if (!dp) {
ret = -errno;
- _E("Failed to open plugin path %s (%d)", PLUGIN_PATH, ret);
+ _E("Failed to open plugin path(%s): %d", PLUGIN_PATH, ret);
return ret;
}
snprintf(path, sizeof(path), "%s/%s", PLUGIN_PATH, dir->d_name);
ret = storaged_open_module(path, &plugin);
if (ret < 0) {
- _E("Failed to open module (%s: %d)", path, ret);
+ _E("Failed to open module(%s): %d", path, ret);
continue;
}
- _I("%s opened", path);
+ _I("'%s' opened", path);
module = calloc(1, sizeof(struct storaged_module));
if (!module) {
- _E("Failed to allocate memory");
+ _E("Failed to allocate memory.");
if (dp)
closedir(dp);
return -ENOMEM;
int ret;
if (!var) {
- _E("no message [%s]", err->message);
+ _E("no message: %s", err->message);
return;
}
if (!dh_get_param_from_var(var, "(i)", &ret)) {
- _E("no message [%s]", g_variant_get_type_string(var));
+ _E("no message: %s", g_variant_get_type_string(var));
goto out;
}
- _D("reply value : %d", ret);
+ _D("Reply value: %d", ret);
out:
g_variant_unref(var);
break;
}
if (match < 0) {
- _E("Failed to find app matched (%s)", app_type);
+ _E("Failed to find app matched type(%s).", app_type);
return -EINVAL;
}
ret = device_display_change_state(DISPLAY_STATE_NORMAL);
if (ret != DEVICE_ERROR_NONE)
- _E("Failed to change display state");
+ _E("Failed to change display state.");
return ret;
}
ret = system_info_get_platform_string(MODEL_NAME, &model_name);
if (ret < 0) {
- _E("Cannot get model name(%d)", ret);
+ _E("Cannot get model name: %d", ret);
return emul;
}
if (waitpid(pid, &status, 0) != -1) {
/* terminated normally */
if (WIFEXITED(status)) {
- _I("%d terminated by exit(%d)", pid, WEXITSTATUS(status));
+ _I("Process(%d) terminated by exit(%d).", pid, WEXITSTATUS(status));
return WEXITSTATUS(status);
} else if (WIFSIGNALED(status))
- _I("%d terminated by signal %d", pid, WTERMSIG(status));
+ _I("Process(%d) terminated by signal %d.", pid, WTERMSIG(status));
else if (WIFSTOPPED(status))
- _I("%d stopped by signal %d", pid, WSTOPSIG(status));
+ _I("Process(%d) stopped by signal %d.", pid, WSTOPSIG(status));
} else
- _I("%d waitpid() failed : %d", pid, errno);
+ _I("Failed to waitpid(%d): %d", pid, errno);
return -EAGAIN;
}
fp = fopen(argv[0], "r");
if (fp == NULL) {
- _E("fail %s (%d)", argv[0], errno);
+ _E("Failed to %s: %d", argv[0], errno);
return -errno;
}
fclose(fp);
pid = fork();
if (pid < 0) {
- _E("failed to fork");
+ _E("Failed to fork.");
r = -errno;
} else if (pid == 0) {
child(argc, argv);
r = parent(pid);
if (sigaction(SIGCHLD, &oldact, NULL) < 0)
- _E("failed to restore sigaction");
+ _E("Failed to restore sigaction.");
return r;
}
/* open conf file */
f = fopen(file_name, "r");
if (!f) {
- _E("Failed to open file %s", file_name);
+ _E("Failed to open file '%s'.", file_name);
ret = -EIO;
goto error;
}
}
}
}
- _D("Success to load %s", file_name);
+ _D("Success to load '%s'.", file_name);
fclose(f);
return 0;
error:
if (f)
fclose(f);
- _E("Failed to read %s:%d!", file_name, lineno);
+ _E("Failed to read '%s': %d", file_name, lineno);
return ret;
}
if (condition & G_IO_ERR)
- _E("udev_monitor_set_receive_buffer_size overflow");
+ _E("udev_monitor_set_receive_buffer_size overflow.");
if (!(condition & G_IO_IN)) {
- _D("udev have a bad behavior");
+ _D("udev have a bad behavior.");
return TRUE;
}
ch = g_io_channel_unix_new(fd);
if (!ch) {
- _E("Failed to create GIOChannel");
+ _E("Failed to create GIOChannel.");
free(h);
return -ENOMEM;
}
id = g_io_add_watch(ch, G_IO_IN | G_IO_ERR,
channel_changed, h);
if (id == 0) {
- _E("Failed to add watch for GIOChannel");
+ _E("Failed to add watch for GIOChannel.");
free(h);
g_io_channel_unref(ch);
return -ENOMEM;
return -EINVAL;
if (info->mon) {
- _E("%s uevent control routine is alreay started", type);
+ _E("uevent(%s) control routine is alreay started.", type);
return -EINVAL;
}
if (!udev) {
udev = udev_new();
if (!udev) {
- _E("error create udev");
+ _E("Failed to create udev.");
return -EINVAL;
}
} else
info->mon = udev_monitor_new_from_netlink(udev, type);
if (info->mon == NULL) {
- _E("error udev_monitor create");
+ _E("Failed to create udev_monitor.");
goto stop;
}
- _I("Set udev monitor buffer size %d", UDEV_MONITOR_SIZE);
+ _I("Set udev monitor buffer size %d.", UDEV_MONITOR_SIZE);
ret = udev_monitor_set_receive_buffer_size(info->mon,
UDEV_MONITOR_SIZE);
if (ret != 0) {
- _E("fail to set receive buffer size");
+ _E("Failed to set receive buffer size.");
goto stop;
}
info->mon,
l->subsystem, NULL);
if (ret < 0) {
- _E("error apply subsystem filter");
+ _E("Failed to apply subsystem filter.");
goto stop;
}
}
ret = udev_monitor_filter_update(info->mon);
if (ret < 0)
- _E("error udev_monitor_filter_update");
+ _E("Failed to udev_monitor_filter_update.");
fd = udev_monitor_get_fd(info->mon);
if (fd == -1) {
- _E("error udev_monitor_get_fd");
+ _E("Failed to udev_monitor_get_fd.");
goto stop;
}
ret = add_fd_read_handler(fd, uevent_control_cb, info, NULL, &(info->handler));
if (ret < 0) {
- _E("Failed to add fd handler (%d)", ret);
+ _E("Failed to add fd handler: %d", ret);
goto stop;
}
if (udev_monitor_enable_receiving(info->mon) < 0) {
- _E("error unable to subscribe to udev events");
+ _E("Failed to unable to subscribe to udev events.");
goto stop;
}
r = udev_monitor_filter_add_match_subsystem_devtype(info->mon,
uh->subsystem, NULL);
if (r < 0) {
- _E("fail to add %s subsystem : %d", uh->subsystem, r);
+ _E("Failed to add %s subsystem: %d", uh->subsystem, r);
return -EPERM;
}
}
r = udev_monitor_filter_update(info->mon);
if (r < 0)
- _E("fail to update udev monitor filter : %d", r);
+ _E("Failed to update udev monitor filter: %d", r);
add_list:
DD_LIST_APPEND(info->event_list, uh);
if (status > 0)
return;
status = 1;
- _I("Power off");
+ _I("Power off.");
uevent_control_stop(&kevent);
uevent_control_stop(&uevent);
}
NULL, NULL);
if (uevent_control_start(KERNEL, &kevent) != 0)
- _E("fail uevent kernel control init");
+ _E("Failed to init uevent kernel control.");
if (uevent_control_start(UDEV, &uevent) != 0)
- _E("fail uevent udev control init");
+ _E("Failed to init uevent udev control.");
}
void udev_exit(void *data)
fprintf(fp, "needcleanup\n");
fclose(fp);
} else
- _E("Fail to open %s", NEED_CLEANUP_FILE_PATH);
+ _E("Failed to open '%s'.", NEED_CLEANUP_FILE_PATH);
}
static void memcleanup_send_broadcast(struct storage_config_info *info, enum memnoti_level level, enum memnoti_level prev_level)
t = time(NULL);
if (localtime_r(&t, &timeinfo) == NULL) {
- _E("Failed to localtime_r");
+ _E("Failed to localtime_r.");
goto out;
}
strftime(buf, sizeof(buf), "%b %d %T", &timeinfo);
- _D("time: %s path: %d level: %s", buf, path, value);
+ _D("time=%s path=%d level=%s", buf, path, value);
out:
dbus_handle_broadcast_dbus_signal_var(STORAGED_PATH_LOWMEM, STORAGED_INTERFACE_LOWMEM,
int ret;
if (!var) {
- _E("no message [%s]", err->message);
+ _E("No message: %s", err->message);
return;
}
if (!dh_get_param_from_var(var, "(i)", &ret)) {
- _E("no message [%s]", g_variant_get_type_string(var));
+ _E("No message: %s", g_variant_get_type_string(var));
goto out;
}
- _D("reply value : %d", ret);
+ _D("Reply value: %d", ret);
out:
g_variant_unref(var);
int ret;
if (!var) {
- _E("no message [%s]", err->message);
+ _E("No message: %s", err->message);
return;
}
if (!dh_get_param_from_var(var, "(i)", &ret)) {
- _E("no message [%s]", g_variant_get_type_string(var));
+ _E("No message: %s", g_variant_get_type_string(var));
goto out;
}
noti_id = ret;
- _D("reply value : %d", ret);
+ _D("Reply value: %d", ret);
out:
g_variant_unref(var);
"i",
param);
if (ret < 0)
- _E("Fail to remove noti : %d", noti_id);
+ _E("Failed to remove noti(%d).", noti_id);
return ret;
}
-1,
NULL);
if (ret < 0)
- _E("Fail to create noti");
+ _E("Failed to create noti.");
return ret;
}
ret = remove_notification();
} else
- _E("Invalid noti type : %s", type);
+ _E("Invalid noti type(%s).", type);
return ret;
}
char *noti_value = NULL;
if (level < 0 || level > MEMNOTI_LEVEL_NORMAL) {
- _E("level check error : %d", level);
+ _E("Failed to check level(%d).", level);
return 0;
}
return -1;
if (!popup_value && !noti_value) {
- _E("Invalid memnoti level : %d", level);
+ _E("Invalid memnoti level(%d).", level);
return 0;
}
ret = launch_memory_popup(2, "_SYSPOPUP_CONTENT_", popup_value);
if (ret < 0)
- _E("Fail to launch momory popup : %d", ret);
+ _E("Failed to launch momory popup: %d", ret);
ret = launch_memory_notification(noti_value);
if (ret < 0)
- _E("Fail to launch momory notification : %d", ret);
+ _E("Failed to launch momory notification: %d", ret);
return ret;
}
memcleanup_send_broadcast(info, info->current_noti_level, prev_noti_level);
- _I("%d current level %4.4lf w:%4.4lf c:%4.4lf f:%4.4lf",
+ _I("Id=%d current level=%4.4lf warning=%4.4lf critical=%4.4lf full=%4.4lf",
info->mem_id, level, info->warning_level, info->critical_level, info->full_level);
return;
}
memcleanup_send_broadcast(info, info->current_noti_level, prev_noti_level);
- _I("%d current level %4.4lf w:%4.4lf c:%4.4lf f:%4.4lf",
+ _I("Id=%d current level=%4.4lf warning=%4.4lf critical=%4.4lf full=:%4.4lf",
info->mem_id, level, info->warning_level, info->critical_level, info->full_level);
return;
}
if (level <= info->warning_level) {
info->current_noti_level = MEMNOTI_LEVEL_WARNING;
- _I("%d current level %4.4lf w:%4.4lf c:%4.4lf f:%4.4lf",
+ _I("Id=%d current level=%4.4lf warning=%4.4lf critical=%4.4lf full=%4.4lf",
info->mem_id, level, info->warning_level, info->critical_level, info->full_level);
memcleanup_send_broadcast(info, info->current_noti_level, prev_noti_level);
int ret;
if (!path) {
- _E("input param error");
+ _E("Input param error.");
return -EINVAL;
}
ret = statvfs(path, s);
if (ret) {
- _E("fail to get storage size");
+ _E("Failed to get storage size.");
return -errno;
}
info->full_level += (MEMORY_MEGABYTE_VALUE/dTotal)*100;
- _I("%s t: %4.0lf a: %4.0lf(%4.2lf) w:%4.4lf c:%4.4lf f:%4.4lf",
+ _I("'%s' t=%4.0lf a=%4.0lf(%4.2lf) w=%4.4lf c=%4.4lf f=%4.4lf",
path, dTotal, dAvail, (dAvail*100/dTotal), info->warning_level, info->critical_level, info->full_level);
}
memnoti_timer = g_timeout_add(MEMNOTI_TIMER_INTERVAL,
check_storage_status, NULL);
if (memnoti_timer == 0)
- _E("fail mem available noti timer add");
+ _E("Failed mem available noti timer add.");
return 0;
}
pid = dbus_handle_get_sender_pid(NULL, sender);
- _D("[request %d] path %s total %4.0llu avail %4.0llu", pid, str_path, dTotal, dAvail);
+ _D("PID=%d path='%s' total=%4.0llu avail=%4.0llu", pid, str_path, dTotal, dAvail);
g_free(str_path);
return g_variant_new("(tt)", dTotal, dAvail);
pid = dbus_handle_get_sender_pid(NULL, sender);
- _D("[request %d] path %s", pid, str_path);
+ _D("PID=%d path='%s'", pid, str_path);
g_free(str_path);
if (done > 0)
return;
done = 1;
- _I("booting done");
+ _I("Booting done.");
if (init_storage_config_info_all() == -1)
- _E("fail remain mem noti control fd init");
+ _E("Failed remain mem noti control fd init.");
}
static void storage_poweroff(GDBusConnection *conn,
ret = config_parse(STORAGE_CONF_FILE, load_config, info);
if (ret < 0)
- _E("Failed to load %s, %d Use default value!", STORAGE_CONF_FILE, ret);
+ _E("Failed to load %s, %d Use default value.", STORAGE_CONF_FILE, ret);
}
static void storage_init(void *data)
ret = dbus_handle_register_dbus_object(NULL, STORAGED_PATH_STORAGE,
&storage_interface);
if (ret < 0)
- _E("Failed to register dbus interface and methods(%d)", ret);
+ _E("Failed to register dbus interface and methods: %d", ret);
ret = remove_directory(NEED_CLEANUP_DIR_PATH);
if (ret < 0)
- _E("Failed to remove directory");
+ _E("Failed to remove directory.");
ret = mkdir(NEED_CLEANUP_DIR_PATH, 0644);
if (ret < 0)
_E("Failed to make directory: %d", errno);