Index: components/drive/file_cache.cc |
diff --git a/components/drive/file_cache.cc b/components/drive/file_cache.cc |
index c9ceb105f7133c5eac0ad7f6863756be339c0ebe..73d28d41064dc77d66a82bd227994b750e96d1b0 100644 |
--- a/components/drive/file_cache.cc |
+++ b/components/drive/file_cache.cc |
@@ -3,8 +3,6 @@ |
// found in the LICENSE file. |
#include "components/drive/file_cache.h" |
- |
-#include <unistd.h> |
#include <queue> |
#include <vector> |
@@ -683,8 +681,7 @@ |
// static |
bool FileCache::MigrateCacheFiles(const base::FilePath& from, |
- const base::FilePath& to_files, |
- const base::FilePath& to_links, |
+ const base::FilePath& to, |
ResourceMetadataStorage* metadata_storage) { |
scoped_ptr<ResourceMetadataStorage::Iterator> it = |
metadata_storage->GetIterator(); |
@@ -694,31 +691,17 @@ |
continue; |
} |
- // Ignore missing cache file case since it never succeeds. |
- // TODO(yawano): handle this case at metadata validation in FileCache. |
const base::FilePath move_from = GetPathForId(from, entry.local_id()); |
if (!base::PathExists(move_from)) { |
continue; |
} |
- // Create hard link to cache file if it's pinned or dirty. cryptohome will |
- // not delete a cache file if there is a hard link to it. |
- const FileCacheEntry& file_cache_entry = |
- entry.file_specific_info().cache_state(); |
- if (file_cache_entry.is_pinned() || file_cache_entry.is_dirty()) { |
- const base::FilePath link_path = GetPathForId(to_links, entry.local_id()); |
- int link_result = link(move_from.AsUTF8Unsafe().c_str(), |
- link_path.AsUTF8Unsafe().c_str()); |
- if (link_result != 0 && errno != EEXIST) { |
- return false; |
- } |
- } |
- |
- // Move cache file. |
- const base::FilePath move_to = GetPathForId(to_files, entry.local_id()); |
+ const base::FilePath move_to = GetPathForId(to, entry.local_id()); |
if (!base::Move(move_from, move_to)) { |
return false; |
} |
+ |
+ // TODO(yawano): create hard link if entry is marked as pinned or dirty. |
} |
return true; |