diff options
author | Yifan Hong <elsk@google.com> | 2019-12-27 18:57:58 -0800 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-12-27 18:57:58 -0800 |
commit | 61051f6fcc5384ef0bb188c43d3ec079ca6ece3e (patch) | |
tree | e5defe1f681a112b0390bfa3c095d4bc5daab95a | |
parent | 6d46873127a32c0e9bf5a39d39d72d6385d9e2b0 (diff) | |
parent | d8a8988c6e02cdaa00d97c84df2114cca27b5d6f (diff) | |
download | core-61051f6fcc5384ef0bb188c43d3ec079ca6ece3e.tar.gz |
Merge "libfiemap: delete unuseful check"
am: d8a8988c6e
Change-Id: I0b714504d8576bdd7a991d613be31417734116c5
-rw-r--r-- | fs_mgr/libfiemap/fiemap_writer.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/fs_mgr/libfiemap/fiemap_writer.cpp b/fs_mgr/libfiemap/fiemap_writer.cpp index b5794d3a7..d34e0b860 100644 --- a/fs_mgr/libfiemap/fiemap_writer.cpp +++ b/fs_mgr/libfiemap/fiemap_writer.cpp @@ -233,8 +233,7 @@ static uint64_t GetFileSize(const std::string& file_path) { return sb.st_size; } -static bool PerformFileChecks(const std::string& file_path, uint64_t file_size, uint64_t* blocksz, - uint32_t* fs_type) { +static bool PerformFileChecks(const std::string& file_path, uint64_t* blocksz, uint32_t* fs_type) { struct statfs64 sfs; if (statfs64(file_path.c_str(), &sfs)) { PLOG(ERROR) << "Failed to read file system status at: " << file_path; @@ -258,12 +257,6 @@ static bool PerformFileChecks(const std::string& file_path, uint64_t file_size, return false; } - uint64_t available_bytes = sfs.f_bsize * sfs.f_bavail; - if (access(file_path.c_str(), F_OK) != 0 && available_bytes <= file_size) { - LOG(ERROR) << "Not enough free space in file system to create file of size : " << file_size; - return false; - } - *blocksz = sfs.f_bsize; *fs_type = sfs.f_type; return true; @@ -732,7 +725,7 @@ FiemapUniquePtr FiemapWriter::Open(const std::string& file_path, uint64_t file_s uint64_t blocksz; uint32_t fs_type; - if (!PerformFileChecks(abs_path, file_size, &blocksz, &fs_type)) { + if (!PerformFileChecks(abs_path, &blocksz, &fs_type)) { LOG(ERROR) << "Failed to validate file or file system for file:" << abs_path; cleanup(abs_path, create); return nullptr; |