• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/core


Commit MetaInfo

Revisão4a4c9f6f98055918f1ebff06b3cc1ed622c058fe (tree)
Hora2009-01-22 17:16:17
AutorThe Android Open Source Project <initial-contribution@andr...>
CommiterThe Android Open Source Project

Mensagem de Log

Merge branch 'cupcake'

Mudança Sumário

Diff

--- a/init/devices.c
+++ b/init/devices.c
@@ -98,7 +98,6 @@ static struct perms_ devperms[] = {
9898 /* these should not be world writable */
9999 { "/dev/android_adb", 0660, AID_ADB, AID_ADB, 0 },
100100 { "/dev/android_adb_enable", 0660, AID_ADB, AID_ADB, 0 },
101- /* TODO: remove legacy ttyMSM0 */
102101 { "/dev/ttyMSM0", 0600, AID_BLUETOOTH, AID_BLUETOOTH, 0 },
103102 { "/dev/ttyHS0", 0600, AID_BLUETOOTH, AID_BLUETOOTH, 0 },
104103 { "/dev/uinput", 0600, AID_BLUETOOTH, AID_BLUETOOTH, 0 },
--- a/vold/volmgr.c
+++ b/vold/volmgr.c
@@ -78,9 +78,9 @@ static void volume_setstate(volume_t *vol, volume_state_t state);
7878 static char *conv_volstate_to_eventstr(volume_state_t state);
7979 static char *conv_volstate_to_propstr(volume_state_t state);
8080 static int volume_send_state(volume_t *vol);
81-static void _cb_volstopped_for_ums_enable(volume_t *v);
81+static void _cb_volstopped_for_ums_enable(volume_t *v, void *arg);
8282 static int _volmgr_enable_ums(volume_t *);
83-static int volmgr_shutdown_volume(volume_t *v, void (* cb) (volume_t *));
83+static int volmgr_shutdown_volume(volume_t *v, void (* cb) (volume_t *, void *arg));
8484 static int volmgr_stop_volume(volume_t *v, void (*cb) (volume_t *, void *), void *arg, int emit_statechange);
8585 static void _cb_volume_stopped_for_eject(volume_t *v, void *arg);
8686 static void _cb_volume_stopped_for_shutdown(volume_t *v, void *arg);
@@ -171,7 +171,7 @@ int volmgr_stop_volume_by_mountpoint(char *mount_point)
171171 while(v) {
172172 if (!strcmp(v->mount_point, mount_point)) {
173173 pthread_mutex_lock(&v->lock);
174- if (volmgr_shutdown_volume(v, _cb_volstopped_for_ums_enable) < 0)
174+ if (volmgr_shutdown_volume(v, NULL) < 0)
175175 LOGE("unable to shutdown volume '%s'\n", v->mount_point);
176176 pthread_mutex_unlock(&v->lock);
177177 return 0;
@@ -229,13 +229,14 @@ int volmgr_enable_ums(boolean enable)
229229 if (v->ums_path) {
230230 int rc;
231231
232- pthread_mutex_lock(&v->lock);
233232 if (enable) {
233+ pthread_mutex_lock(&v->lock);
234234 // Stop the volume, and enable UMS in the callback
235235 if ((rc = volmgr_shutdown_volume(v, _cb_volstopped_for_ums_enable)) < 0)
236236 LOGE("unable to shutdown volume '%s'\n", v->mount_point);
237237 } else {
238238 // Disable UMS
239+ pthread_mutex_lock(&v->lock);
239240 if ((rc = ums_disable(v->ums_path)) < 0) {
240241 LOGE("unable to disable ums on '%s'\n", v->mount_point);
241242 pthread_mutex_unlock(&v->lock);
@@ -248,8 +249,8 @@ int volmgr_enable_ums(boolean enable)
248249 if ((rc = _volmgr_consider_disk_and_vol(v, v->dev->disk)) < 0) {
249250 LOGE("volmgr failed to consider disk '%s'\n", v->dev->disk->dev_fspath);
250251 }
252+ pthread_mutex_unlock(&v->lock);
251253 }
252- pthread_mutex_unlock(&v->lock);
253254 }
254255 v = v->next;
255256 }
@@ -269,7 +270,9 @@ static int _volmgr_consider_disk_and_vol(volume_t *vol, blkdev_t *dev)
269270 LOG_VOL("volmgr_consider_disk_and_vol(%s, %s):\n", vol->mount_point, dev->dev_fspath);
270271 #endif
271272
272- if (vol->state != volstate_nomedia && vol->state != volstate_unmounted) {
273+ if (vol->state != volstate_nomedia &&
274+ vol->state != volstate_unmounted &&
275+ vol->state != volstate_badremoval) {
273276 LOGE("Volume manager is already handling volume '%s' (currently in state %d)\n", vol->mount_point, vol->state);
274277 return -EADDRINUSE;
275278 }
@@ -467,9 +470,9 @@ static int volmgr_stop_volume(volume_t *v, void (*cb) (volume_t *, void *), void
467470 /*
468471 * Gracefully stop a volume
469472 */
470-static int volmgr_shutdown_volume(volume_t *v, void (* cb) (volume_t *))
473+static int volmgr_shutdown_volume(volume_t *v, void (* cb) (volume_t *, void *))
471474 {
472- return volmgr_stop_volume(v, NULL, cb, true);
475+ return volmgr_stop_volume(v, cb, NULL, true);
473476 }
474477
475478 static void _cb_volume_stopped_for_shutdown(volume_t *v, void *arg)
@@ -483,15 +486,17 @@ static void _cb_volume_stopped_for_shutdown(volume_t *v, void *arg)
483486 /*
484487 * Called when a volume is sucessfully unmounted for UMS enable
485488 */
486-static void _cb_volstopped_for_ums_enable(volume_t *v)
489+static void _cb_volstopped_for_ums_enable(volume_t *v, void *arg)
487490 {
488491 int rc;
489492
490- if ((rc = ums_enable(v->dev->dev_fspath, v->ums_path)) < 0) {
493+ LOG_VOL("_cb_volstopped_for_ums_enable(%s):\n", v->dev->dev_fspath);
494+ if ((rc = ums_enable(v->dev->disk->dev_fspath, v->ums_path)) < 0) {
491495 LOGE("Error enabling ums (%d)\n", rc);
492496 return;
493497 }
494498 volume_setstate(v, volstate_ums);
499+ pthread_mutex_unlock(&v->lock);
495500 }
496501
497502 static int volmgr_readconfig(char *cfg_path)