From: pr.jung Date: Mon, 25 Sep 2017 07:32:20 +0000 (+0900) Subject: block: Need to set VCONFKEY_SYSMAN_MMC_EXTENDEDINTERNAL_MOUNTED for extended internal... X-Git-Tag: accepted/tizen/4.0/unified/20170927.045809~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F65%2F152165%2F1;p=platform%2Fcore%2Fsystem%2Fstoraged.git block: Need to set VCONFKEY_SYSMAN_MMC_EXTENDEDINTERNAL_MOUNTED for extended internal sdcard Change-Id: If4b596e97f0605d52113b185225ffdadda3a3ad6 Signed-off-by: pr.jung --- diff --git a/src/block/block.c b/src/block/block.c index 4e5d6f1..346812a 100644 --- a/src/block/block.c +++ b/src/block/block.c @@ -263,13 +263,22 @@ static void broadcast_block_info(enum block_dev_operation op, if (ops->block_type != data->block_type) continue; // TODO What happend on extended internal storage case? - if (op == BLOCK_DEV_MOUNT) - ops->mounted(data, result); - else if (op == BLOCK_DEV_UNMOUNT) - ops->unmounted(data, result); - else if (op == BLOCK_DEV_FORMAT) - ops->formatted(data, result); - else if (op == BLOCK_DEV_INSERT) + if (op == BLOCK_DEV_MOUNT) { + if (data->block_type == BLOCK_MMC_EXTENDED_INTERNAL_DEV) + ops->mounted(data, result, true); + else + ops->mounted(data, result, false); + } else if (op == BLOCK_DEV_UNMOUNT) { + if (data->block_type == BLOCK_MMC_EXTENDED_INTERNAL_DEV) + ops->unmounted(data, result, true); + else + ops->unmounted(data, result, false); + } else if (op == BLOCK_DEV_FORMAT) { + if (data->block_type == BLOCK_MMC_EXTENDED_INTERNAL_DEV) + ops->formatted(data, result, true); + else + ops->formatted(data, result, false); + } else if (op == BLOCK_DEV_INSERT) ops->inserted(data); else if (op == BLOCK_DEV_REMOVE) ops->removed(data); diff --git a/src/block/block.h b/src/block/block.h index 597204f..57b02b5 100644 --- a/src/block/block.h +++ b/src/block/block.h @@ -87,9 +87,9 @@ struct block_data { struct block_dev_ops { const char *name; enum block_device_type block_type; - void (*mounted) (struct block_data *data, int result); - void (*unmounted) (struct block_data *data, int result); - void (*formatted) (struct block_data *data, int result); + void (*mounted) (struct block_data *data, int result, bool extended); + void (*unmounted) (struct block_data *data, int result, bool extended); + void (*formatted) (struct block_data *data, int result, bool extended); void (*inserted) (struct block_data *data); void (*removed) (struct block_data *data); }; diff --git a/src/block/mmc.c b/src/block/mmc.c index 674cdcc..80ec367 100644 --- a/src/block/mmc.c +++ b/src/block/mmc.c @@ -48,7 +48,7 @@ static void mmc_update_mount_state(int state) old = state; } -static void mmc_mount(struct block_data *data, int result) +static void mmc_mount(struct block_data *data, int result, bool extended) { int r; @@ -68,11 +68,14 @@ static void mmc_mount(struct block_data *data, int result) if (r < 0) _E("setxattr error : %d", errno); - mmc_update_state(VCONFKEY_SYSMAN_MMC_MOUNTED); + if (extended) + mmc_update_state(VCONFKEY_SYSMAN_MMC_EXTENDEDINTERNAL_MOUNTED); + else + mmc_update_state(VCONFKEY_SYSMAN_MMC_MOUNTED); mmc_update_mount_state(VCONFKEY_SYSMAN_MMC_MOUNT_COMPLETED); } -static void mmc_unmount(struct block_data *data, int result) +static void mmc_unmount(struct block_data *data, int result, bool extended) { /* Only the primary partition is valid. */ if (!data || !data->primary) @@ -80,18 +83,26 @@ static void mmc_unmount(struct block_data *data, int result) if (result == 0) mmc_update_state(VCONFKEY_SYSMAN_MMC_INSERTED_NOT_MOUNTED); - else - mmc_update_state(VCONFKEY_SYSMAN_MMC_MOUNTED); + else { + if (extended) + mmc_update_state(VCONFKEY_SYSMAN_MMC_EXTENDEDINTERNAL_MOUNTED); + else + mmc_update_state(VCONFKEY_SYSMAN_MMC_MOUNTED); + } } -static void mmc_format(struct block_data *data, int result) +static void mmc_format(struct block_data *data, int result, bool extended) { /* Only the primary partition is valid. */ if (!data || !data->primary) return; if (data->state == BLOCK_MOUNT) { - mmc_update_state(VCONFKEY_SYSMAN_MMC_MOUNTED); + if (extended) + mmc_update_state(VCONFKEY_SYSMAN_MMC_EXTENDEDINTERNAL_MOUNTED); + else + mmc_update_state(VCONFKEY_SYSMAN_MMC_MOUNTED); + mmc_update_mount_state(VCONFKEY_SYSMAN_MMC_MOUNT_COMPLETED); } }