Skip to content

Commit

Permalink
Revert "Add NTFS support in vold"
Browse files Browse the repository at this point in the history
This reverts commit 564f6c6.

Reason for revert: Un-backporting.

Note: This is not a direct revert. We should keep the minor refactoring
in PublicVolume.cpp; no point making the code worse.

Test: Revert.
Change-Id: Ic03ed25ad15a2da974921542a20cd27224347f68
  • Loading branch information
alpiccioni committed Feb 2, 2023
1 parent c9579dc commit fc4934f
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 194 deletions.
1 change: 0 additions & 1 deletion Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ cc_library_static {
"fs/Ext4.cpp",
"fs/F2fs.cpp",
"fs/Vfat.cpp",
"fs/Ntfs.cpp",
"model/Disk.cpp",
"model/EmulatedVolume.cpp",
"model/ObbVolume.cpp",
Expand Down
134 changes: 0 additions & 134 deletions fs/Ntfs.cpp

This file was deleted.

39 changes: 0 additions & 39 deletions fs/Ntfs.h

This file was deleted.

3 changes: 1 addition & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ int main(int argc, char** argv) {
LOG(DEBUG) << "Detected support for:"
<< (android::vold::IsFilesystemSupported("ext4") ? " ext4" : "")
<< (android::vold::IsFilesystemSupported("f2fs") ? " f2fs" : "")
<< (android::vold::IsFilesystemSupported("vfat") ? " vfat" : "")
<< (android::vold::IsFilesystemSupported("ntfs3") ? " ntfs3" : "");
<< (android::vold::IsFilesystemSupported("vfat") ? " vfat" : "");

VolumeManager* vm;
NetlinkManager* nm;
Expand Down
19 changes: 1 addition & 18 deletions model/PublicVolume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "Utils.h"
#include "VolumeManager.h"
#include "fs/Exfat.h"
#include "fs/Ntfs.h"
#include "fs/Vfat.h"

#include <android-base/logging.h>
Expand Down Expand Up @@ -111,11 +110,6 @@ status_t PublicVolume::doMount() {
LOG(ERROR) << getId() << " failed filesystem check";
return -EIO;
}
} else if (mFsType == "ntfs" && ntfs::IsSupported()) {
if (ntfs::Check(mDevPath)) {
LOG(ERROR) << getId() << " failed filesystem check";
return -EIO;
}
} else {
LOG(ERROR) << getId() << " unsupported filesystem " << mFsType;
return -EIO;
Expand Down Expand Up @@ -158,12 +152,6 @@ status_t PublicVolume::doMount() {
PLOG(ERROR) << getId() << " failed to mount " << mDevPath;
return -EIO;
}
} else if (mFsType == "ntfs") {
if (ntfs::Mount(mDevPath, mRawPath, false, false, false, AID_ROOT,
(isVisible ? AID_MEDIA_RW : AID_EXTERNAL_STORAGE), 0007)) {
PLOG(ERROR) << getId() << " failed to mount " << mDevPath;
return -EIO;
}
}

if (getMountFlags() & MountFlags::kPrimary) {
Expand Down Expand Up @@ -322,10 +310,9 @@ status_t PublicVolume::doUnmount() {
status_t PublicVolume::doFormat(const std::string& fsType) {
bool isVfatSup = vfat::IsSupported();
bool isExfatSup = exfat::IsSupported();
bool isNtfsSup = ntfs::IsSupported();
status_t res = OK;

enum { NONE, VFAT, EXFAT, NTFS } fsPick = NONE;
enum { NONE, VFAT, EXFAT } fsPick = NONE;

// Resolve auto requests
if (fsType == "auto" && isVfatSup && isExfatSup) {
Expand Down Expand Up @@ -354,8 +341,6 @@ status_t PublicVolume::doFormat(const std::string& fsType) {
fsPick = VFAT;
} else if (fsType == "exfat" && isExfatSup) {
fsPick = EXFAT;
} else if (fsType == "ntfs" && isNtfsSup) {
fsPick = NTFS;
}

if (WipeBlockDevice(mDevPath) != OK) {
Expand All @@ -366,8 +351,6 @@ status_t PublicVolume::doFormat(const std::string& fsType) {
res = vfat::Format(mDevPath, 0);
} else if (fsPick == EXFAT) {
res = exfat::Format(mDevPath);
} else if (fsPick == NTFS) {
res = ntfs::Format(mDevPath, 0);
} else {
LOG(ERROR) << "Unsupported filesystem " << fsType;
return -EINVAL;
Expand Down

0 comments on commit fc4934f

Please sign in to comment.