am 2dfe297e: Fixes for devices with internal FAT file system:

Merge commit '2dfe297ec47559dbe2297a72bea71cf515c03797' into gingerbread-plus-aosp

* commit '2dfe297ec47559dbe2297a72bea71cf515c03797':
  Fixes for devices with internal FAT file system:
gugelfrei
Mike Lockwood 14 years ago committed by Android Git Automerger
commit 3374b41f1f

@ -65,6 +65,14 @@ dev_t DirectVolume::getDiskDevice() {
return MKDEV(mDiskMajor, mDiskMinor);
}
dev_t DirectVolume::getShareDevice() {
if (mPartIdx != -1) {
return MKDEV(mDiskMajor, mPartIdx);
} else {
return MKDEV(mDiskMajor, mDiskMinor);
}
}
void DirectVolume::handleVolumeShared() {
setState(Volume::State_Shared);
}

@ -45,6 +45,7 @@ public:
int handleBlockEvent(NetlinkEvent *evt);
dev_t getDiskDevice();
dev_t getShareDevice();
void handleVolumeShared();
void handleVolumeUnshared();

@ -144,6 +144,10 @@ dev_t Volume::getDiskDevice() {
return MKDEV(0, 0);
};
dev_t Volume::getShareDevice() {
return getDiskDevice();
}
void Volume::handleVolumeShared() {
}
@ -220,7 +224,9 @@ int Volume::formatVol() {
if (initializeMbr(devicePath)) {
SLOGE("Failed to initialize MBR (%s)", strerror(errno));
goto err;
// goto err;
// don't treat this as a fatal error
// lets continue on and format the partition
}
sprintf(devicePath, "/dev/block/vold/%d:%d",

@ -71,6 +71,7 @@ public:
virtual int handleBlockEvent(NetlinkEvent *evt);
virtual dev_t getDiskDevice();
virtual dev_t getShareDevice();
virtual void handleVolumeShared();
virtual void handleVolumeUnshared();

@ -1036,7 +1036,7 @@ int VolumeManager::shareVolume(const char *label, const char *method) {
return -1;
}
dev_t d = v->getDiskDevice();
dev_t d = v->getShareDevice();
if ((MAJOR(d) == 0) && (MINOR(d) == 0)) {
// This volume does not support raw disk access
errno = EINVAL;

Loading…
Cancel
Save