1 /*
2 * Copyright (c) 2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #include "meta_file.h"
17
18 #include <ctime>
19 #include <fcntl.h>
20 #include <iomanip>
21 #include <sstream>
22 #include <sys/stat.h>
23
24 #include "cloud_file_utils.h"
25 #include "dfs_error.h"
26 #include "file_utils.h"
27 #include "securec.h"
28 #include "string_ex.h"
29 #include "sys/xattr.h"
30 #include "utils_directory.h"
31 #include "utils_log.h"
32
33 namespace OHOS {
34 namespace FileManagement {
35 constexpr uint32_t DENTRYGROUP_SIZE = 4096;
36 constexpr uint32_t DENTRY_NAME_LEN = 8;
37 constexpr uint32_t DENTRY_RESERVED_LENGTH = 4;
38 constexpr uint32_t DENTRY_PER_GROUP = 52;
39 constexpr uint32_t DENTRY_BITMAP_LENGTH = 7;
40 constexpr uint32_t DENTRY_GROUP_RESERVED = 32;
41 constexpr uint32_t CLOUD_RECORD_ID_LEN = 33;
42 constexpr uint32_t DENTRYGROUP_HEADER = 4096;
43 constexpr uint32_t MAX_BUCKET_LEVEL = 63;
44 constexpr uint32_t BUCKET_BLOCKS = 2;
45 constexpr uint32_t BITS_PER_BYTE = 8;
46 constexpr uint32_t HMDFS_SLOT_LEN_BITS = 3;
47 constexpr uint64_t DELTA = 0x9E3779B9; /* Hashing code copied from f2fs */
48 constexpr uint64_t HMDFS_HASH_COL_BIT = (0x1ULL) << 63;
49 constexpr uint32_t FILE_TYPE_OFFSET = 2;
50
51 #pragma pack(push, 1)
52 struct HmdfsDentry {
53 uint32_t hash{0};
54 uint16_t mode{0};
55 uint16_t namelen{0};
56 uint64_t size{0};
57 uint64_t mtime{0};
58 uint64_t atime{0};
59 uint8_t recordId[CLOUD_RECORD_ID_LEN]{0};
60 };
61
62 struct HmdfsDentryGroup {
63 uint8_t dentryVersion;
64 uint8_t bitmap[DENTRY_BITMAP_LENGTH];
65 struct HmdfsDentry nsl[DENTRY_PER_GROUP];
66 uint8_t fileName[DENTRY_PER_GROUP][DENTRY_NAME_LEN];
67 uint8_t reserved[DENTRY_GROUP_RESERVED];
68 };
69 #pragma pack(pop)
70
SetFileType(struct HmdfsDentry * de,uint8_t fileType)71 void MetaHelper::SetFileType(struct HmdfsDentry *de, uint8_t fileType)
72 {
73 }
74
SetPosition(struct HmdfsDentry * de,uint8_t position)75 void MetaHelper::SetPosition(struct HmdfsDentry *de, uint8_t position)
76 {
77 }
78
GetFileType(const struct HmdfsDentry * de)79 uint8_t MetaHelper::GetFileType(const struct HmdfsDentry *de)
80 {
81 return 0;
82 }
83
GetPosition(const struct HmdfsDentry * de)84 uint8_t MetaHelper::GetPosition(const struct HmdfsDentry *de)
85 {
86 return 0;
87 }
88
GetCloudDiskDentryFileByPath(uint32_t userId,const std::string & bundleName,const std::string & cloudId)89 static std::string GetCloudDiskDentryFileByPath(uint32_t userId, const std::string &bundleName,
90 const std::string &cloudId)
91 {
92 std::string cacheDir =
93 "/data/service/el2/" + std::to_string(userId) +
94 "/hmdfs/cloud/data/" + bundleName + "/" +
95 std::to_string(CloudDisk::CloudFileUtils::GetBucketId(cloudId)) + "/";
96 std::string dentryFileName = MetaFileMgr::GetInstance().CloudIdToRecordId(cloudId);
97 Storage::DistributedFile::Utils::ForceCreateDirectory(cacheDir, STAT_MODE_DIR);
98 return cacheDir + dentryFileName;
99 }
100
CloudDiskMetaFile(uint32_t userId,const std::string & bundleName,const std::string & cloudId)101 CloudDiskMetaFile::CloudDiskMetaFile(uint32_t userId, const std::string &bundleName, const std::string &cloudId)
102 {
103 }
104
GetDentryFilePath()105 std::string CloudDiskMetaFile::GetDentryFilePath()
106 {
107 return cacheFile_;
108 }
109
DoLookupAndUpdate(const std::string & name,CloudDiskMetaFileCallBack callback)110 int32_t CloudDiskMetaFile::DoLookupAndUpdate(const std::string &name, CloudDiskMetaFileCallBack callback)
111 {
112 if (name == "mock") {
113 return E_RDB;
114 }
115 return E_OK;
116 }
117
DoLookupAndCreate(const std::string & name,CloudDiskMetaFileCallBack metaFileCallBack)118 int32_t CloudDiskMetaFile::DoLookupAndCreate(const std::string &name, CloudDiskMetaFileCallBack metaFileCallBack)
119 {
120 if (name == "mock") {
121 return E_RDB;
122 }
123 return E_OK;
124 }
125
DoChildUpdate(const std::string & name,CloudDiskMetaFileCallBack callback)126 int32_t CloudDiskMetaFile::DoChildUpdate(const std::string &name, CloudDiskMetaFileCallBack callback)
127 {
128 if (name == "mock") {
129 return E_RDB;
130 }
131 return E_OK;
132 }
133
DoLookupAndRemove(MetaBase & metaBase)134 int32_t CloudDiskMetaFile::DoLookupAndRemove(MetaBase &metaBase)
135 {
136 /* lookup and remove in parent */
137 int32_t ret = DoLookup(metaBase);
138 if (ret == E_OK) {
139 ret = DoRemove(metaBase);
140 if (ret != E_OK) {
141 LOGE("remove dentry file failed, ret %{public}d", ret);
142 return ret;
143 }
144 return E_OK;
145 }
146 return E_OK;
147 }
148
~CloudDiskMetaFile()149 CloudDiskMetaFile::~CloudDiskMetaFile()
150 {
151 }
152
IsDotDotdot(const std::string & name)153 static bool IsDotDotdot(const std::string &name)
154 {
155 return name == "." || name == "..";
156 }
157
Str2HashBuf(const char * msg,size_t len,uint32_t * buf,int num)158 static void Str2HashBuf(const char *msg, size_t len, uint32_t *buf, int num)
159 {
160 uint32_t pad = static_cast<uint32_t>(len) | (static_cast<uint32_t>(len) << 8);
161 pad |= pad << 16; /* hash pad length 16 */
162
163 uint32_t val = pad;
164 len = std::min(len, static_cast<size_t>(num * sizeof(int)));
165 for (uint32_t i = 0; i < len; i++) {
166 if ((i % sizeof(int)) == 0) {
167 val = pad;
168 }
169 uint8_t c = static_cast<uint8_t>(tolower(msg[i]));
170 val = c + (val << 8); /* hash shift size 8 */
171 if ((i % 4) == 3) { /* msg size 4, shift when 3 */
172 *buf++ = val;
173 val = pad;
174 num--;
175 }
176 }
177 if (--num >= 0) {
178 *buf++ = val;
179 }
180 while (--num >= 0) {
181 *buf++ = pad;
182 }
183 }
184
TeaTransform(uint32_t buf[4],uint32_t const in[])185 static void TeaTransform(uint32_t buf[4], uint32_t const in[]) __attribute__((no_sanitize("unsigned-integer-overflow")))
186 {
187 int n = 16; /* transform total rounds 16 */
188 uint32_t a = in[0]; /* transform input pos 0 */
189 uint32_t b = in[1]; /* transform input pos 1 */
190 uint32_t c = in[2]; /* transform input pos 2 */
191 uint32_t d = in[3]; /* transform input pos 3 */
192 uint32_t b0 = buf[0]; /* buf pos 0 */
193 uint32_t b1 = buf[1]; /* buf pos 1 */
194 uint32_t sum = 0;
195
196 do {
197 sum += DELTA;
198 b0 += ((b1 << 4) + a) ^ (b1 + sum) ^ ((b1 >> 5) + b); /* tea transform width 4 and 5 */
199 b1 += ((b0 << 4) + c) ^ (b0 + sum) ^ ((b0 >> 5) + d); /* tea transform width 4 and 5 */
200 } while (--n);
201
202 buf[0] += b0;
203 buf[1] += b1;
204 }
205
DentryHash(const std::string & name)206 static uint32_t DentryHash(const std::string &name)
207 {
208 if (IsDotDotdot(name)) {
209 return 0;
210 }
211
212 constexpr int inLen = 8; /* hash input buf size 8 */
213 constexpr int bufLen = 4; /* hash output buf size 4 */
214 uint32_t in[inLen];
215 uint32_t buf[bufLen];
216 auto len = name.length();
217 constexpr decltype(len) hashWidth = 16; /* hash operation width 4 */
218 const char *p = name.c_str();
219
220 buf[0] = 0x67452301; /* hash magic 1 */
221 buf[1] = 0xefcdab89; /* hash magic 2 */
222 buf[2] = 0x98badcfe; /* hash magic 3 */
223 buf[3] = 0x10325476; /* hash magic 4 */
224
225 bool loopFlag = true;
226 while (loopFlag) {
227 Str2HashBuf(p, len, in, bufLen);
228 TeaTransform(buf, in);
229
230 if (len <= hashWidth) {
231 break;
232 }
233
234 p += hashWidth;
235 len -= hashWidth;
236 };
237 uint32_t hash = buf[0];
238 uint32_t hmdfsHash = hash & ~HMDFS_HASH_COL_BIT;
239
240 return hmdfsHash;
241 }
242
GetDentrySlots(size_t nameLen)243 static inline uint32_t GetDentrySlots(size_t nameLen)
244 {
245 return static_cast<uint32_t>((nameLen + BITS_PER_BYTE - 1) >> HMDFS_SLOT_LEN_BITS);
246 }
247
GetDentryGroupPos(size_t bidx)248 static inline off_t GetDentryGroupPos(size_t bidx)
249 {
250 return bidx * DENTRYGROUP_SIZE + DENTRYGROUP_HEADER;
251 }
252
GetDentryGroupCnt(uint64_t size)253 static inline uint64_t GetDentryGroupCnt(uint64_t size)
254 {
255 return (size >= DENTRYGROUP_HEADER) ? ((size - DENTRYGROUP_HEADER) / DENTRYGROUP_SIZE) : 0;
256 }
257
GetOverallBucket(uint32_t level)258 static uint32_t GetOverallBucket(uint32_t level)
259 {
260 if (level >= MAX_BUCKET_LEVEL) {
261 LOGD("level = %{public}d overflow", level);
262 return 0;
263 }
264 uint64_t buckets = (1ULL << (level + 1)) - 1;
265 return static_cast<uint32_t>(buckets);
266 }
267
GetDcacheFileSize(uint32_t level)268 static size_t GetDcacheFileSize(uint32_t level)
269 {
270 size_t buckets = GetOverallBucket(level);
271 return buckets * DENTRYGROUP_SIZE * BUCKET_BLOCKS + DENTRYGROUP_HEADER;
272 }
273
GetBucketaddr(uint32_t level,uint32_t buckoffset)274 static uint32_t GetBucketaddr(uint32_t level, uint32_t buckoffset)
275 {
276 if (level >= MAX_BUCKET_LEVEL) {
277 return 0;
278 }
279
280 uint64_t curLevelMaxBucks = (1ULL << level);
281 if (buckoffset >= curLevelMaxBucks) {
282 return 0;
283 }
284
285 return static_cast<uint32_t>(curLevelMaxBucks) + buckoffset - 1;
286 }
287
GetBucketByLevel(uint32_t level)288 static uint32_t GetBucketByLevel(uint32_t level)
289 {
290 if (level >= MAX_BUCKET_LEVEL) {
291 LOGD("level = %{public}d overflow", level);
292 return 0;
293 }
294
295 uint64_t buckets = (1ULL << level);
296 return static_cast<uint32_t>(buckets);
297 }
298
RoomForFilename(const uint8_t bitmap[],size_t slots,uint32_t maxSlots)299 static uint32_t RoomForFilename(const uint8_t bitmap[], size_t slots, uint32_t maxSlots)
300 {
301 uint32_t bitStart = 0;
302 bool loopFlag = true;
303 while (loopFlag) {
304 uint32_t zeroStart = BitOps::FindNextZeroBit(bitmap, maxSlots, bitStart);
305 if (zeroStart >= maxSlots) {
306 return maxSlots;
307 }
308
309 uint32_t zeroEnd = BitOps::FindNextBit(bitmap, maxSlots, zeroStart);
310 if (zeroEnd - zeroStart >= slots) {
311 return zeroStart;
312 }
313
314 bitStart = zeroEnd + 1;
315 if (zeroEnd + 1 >= maxSlots) {
316 return maxSlots;
317 }
318 }
319 return 0;
320 }
321
UpdateDentry(HmdfsDentryGroup & d,const MetaBase & base,uint32_t nameHash,uint32_t bitPos)322 static void UpdateDentry(HmdfsDentryGroup &d, const MetaBase &base, uint32_t nameHash, uint32_t bitPos)
323 {
324 HmdfsDentry *de;
325 const std::string name = base.name;
326 uint32_t slots = GetDentrySlots(name.length());
327
328 de = &d.nsl[bitPos];
329 de->hash = nameHash;
330 de->namelen = name.length();
331 auto ret = memcpy_s(d.fileName[bitPos], slots * DENTRY_NAME_LEN, name.c_str(), name.length());
332 if (ret != 0) {
333 LOGE("memcpy_s failed, dstLen = %{public}d, srcLen = %{public}zu", slots * DENTRY_NAME_LEN, name.length());
334 }
335 de->atime = base.atime;
336 de->mtime = base.mtime;
337 de->size = base.size;
338 de->mode = base.mode;
339 MetaHelper::SetPosition(de, base.position);
340 MetaHelper::SetFileType(de, base.fileType);
341 (void) memset_s(de->recordId, CLOUD_RECORD_ID_LEN, 0, CLOUD_RECORD_ID_LEN);
342 ret = memcpy_s(de->recordId, CLOUD_RECORD_ID_LEN, base.cloudId.c_str(), base.cloudId.length());
343 if (ret != 0) {
344 LOGE("memcpy_s failed, dstLen = %{public}d, srcLen = %{public}zu", CLOUD_RECORD_ID_LEN, base.cloudId.length());
345 }
346
347 for (uint32_t i = 0; i < slots; i++) {
348 BitOps::SetBit(bitPos + i, d.bitmap);
349 if (i) {
350 (de + i)->namelen = 0;
351 }
352 }
353 }
354
HandleFileByFd(unsigned long & endBlock,uint32_t & level)355 int32_t CloudDiskMetaFile::HandleFileByFd(unsigned long &endBlock, uint32_t &level)
356 {
357 return E_OK;
358 }
359
GetBidxFromLevel(uint32_t level,uint32_t namehash)360 static unsigned long GetBidxFromLevel(uint32_t level, uint32_t namehash)
361 {
362 uint32_t bucket = GetBucketByLevel(level);
363 if (bucket == 0) {
364 return 0;
365 }
366 return BUCKET_BLOCKS * GetBucketaddr(level, namehash % bucket);
367 }
368
DoCreate(const MetaBase & base)369 int32_t CloudDiskMetaFile::DoCreate(const MetaBase &base)
370 {
371 return E_OK;
372 }
373
374 struct DcacheLookupCtx {
375 int fd{-1};
376 std::string name{};
377 uint32_t hash{0};
378 uint32_t bidx{0};
379 std::unique_ptr<HmdfsDentryGroup> page{nullptr};
380 };
381
InitDcacheLookupCtx(DcacheLookupCtx * ctx,const MetaBase & base,int fd)382 static void InitDcacheLookupCtx(DcacheLookupCtx *ctx, const MetaBase &base, int fd)
383 {
384 ctx->fd = fd;
385 ctx->name = base.name;
386 ctx->bidx = 0;
387 ctx->page = nullptr;
388 ctx->hash = DentryHash(ctx->name);
389 }
390
FindDentryPage(uint64_t index,DcacheLookupCtx * ctx)391 static std::unique_ptr<HmdfsDentryGroup> FindDentryPage(uint64_t index, DcacheLookupCtx *ctx)
392 {
393 auto dentryBlk = std::make_unique<HmdfsDentryGroup>();
394
395 off_t pos = GetDentryGroupPos(index);
396 ssize_t size = FileUtils::ReadFile(ctx->fd, pos, DENTRYGROUP_SIZE, dentryBlk.get());
397 if (size != DENTRYGROUP_SIZE) {
398 return nullptr;
399 }
400 return dentryBlk;
401 }
402
FindInBlock(HmdfsDentryGroup & dentryBlk,uint32_t namehash,const std::string & name)403 static HmdfsDentry *FindInBlock(HmdfsDentryGroup &dentryBlk, uint32_t namehash, const std::string &name)
404 {
405 int maxLen = 0;
406 uint32_t bitPos = 0;
407 HmdfsDentry *de = nullptr;
408
409 while (bitPos < DENTRY_PER_GROUP) {
410 if (!BitOps::TestBit(bitPos, dentryBlk.bitmap)) {
411 bitPos++;
412 maxLen++;
413 continue;
414 }
415 de = &dentryBlk.nsl[bitPos];
416 if (!de->namelen) {
417 bitPos++;
418 continue;
419 }
420
421 if (de->hash == namehash && de->namelen == name.length() &&
422 !memcmp(name.c_str(), dentryBlk.fileName[bitPos], de->namelen)) {
423 return de;
424 }
425 maxLen = 0;
426 bitPos += GetDentrySlots(de->namelen);
427 }
428
429 return nullptr;
430 }
431
InLevel(uint32_t level,DcacheLookupCtx * ctx)432 static HmdfsDentry *InLevel(uint32_t level, DcacheLookupCtx *ctx)
433 __attribute__((no_sanitize("unsigned-integer-overflow")))
434 {
435 HmdfsDentry *de = nullptr;
436
437 uint32_t nbucket = GetBucketByLevel(level);
438 if (nbucket == 0) {
439 return de;
440 }
441
442 uint32_t bidx = GetBucketaddr(level, ctx->hash % nbucket) * BUCKET_BLOCKS;
443 uint32_t endBlock = bidx + BUCKET_BLOCKS;
444
445 for (; bidx < endBlock; bidx++) {
446 auto dentryBlk = FindDentryPage(bidx, ctx);
447 if (dentryBlk == nullptr) {
448 break;
449 }
450
451 de = FindInBlock(*dentryBlk, ctx->hash, ctx->name);
452 if (de != nullptr) {
453 ctx->page = std::move(dentryBlk);
454 break;
455 }
456 }
457 ctx->bidx = bidx;
458 return de;
459 }
460
FindDentry(DcacheLookupCtx * ctx)461 static HmdfsDentry *FindDentry(DcacheLookupCtx *ctx)
462 {
463 for (uint32_t level = 0; level < MAX_BUCKET_LEVEL; level++) {
464 HmdfsDentry *de = InLevel(level, ctx);
465 if (de != nullptr) {
466 return de;
467 }
468 }
469 return nullptr;
470 }
471
DoRemove(const MetaBase & base)472 int32_t CloudDiskMetaFile::DoRemove(const MetaBase &base)
473 {
474 return E_OK;
475 }
476
DoLookup(MetaBase & base)477 int32_t CloudDiskMetaFile::DoLookup(MetaBase &base)
478 {
479 if (base.name == "mock") {
480 return EINVAL;
481 }
482 return E_OK;
483 }
484
DoUpdate(const MetaBase & base)485 int32_t CloudDiskMetaFile::DoUpdate(const MetaBase &base)
486 {
487 return E_OK;
488 }
489
DoRename(MetaBase & metaBase,const std::string & newName,std::shared_ptr<CloudDiskMetaFile> newMetaFile)490 int32_t CloudDiskMetaFile::DoRename(MetaBase &metaBase, const std::string &newName,
491 std::shared_ptr<CloudDiskMetaFile> newMetaFile)
492 {
493 if (newName == "mock") {
494 return EINVAL;
495 }
496 return E_OK;
497 }
498
DecodeDentrys(const HmdfsDentryGroup & dentryGroup,std::vector<MetaBase> & bases)499 static int32_t DecodeDentrys(const HmdfsDentryGroup &dentryGroup, std::vector<MetaBase> &bases)
500 {
501 return 0;
502 }
503
LoadChildren(std::vector<MetaBase> & bases)504 int32_t CloudDiskMetaFile::LoadChildren(std::vector<MetaBase> &bases)
505 {
506 return E_OK;
507 }
508
Clear(uint32_t userId,const std::string & bundleName,const std::string & cloudId)509 void MetaFileMgr::Clear(uint32_t userId, const std::string &bundleName,
510 const std::string &cloudId)
511 {
512 std::lock_guard<std::mutex> lock(cloudDiskMutex_);
513 MetaFileKey key(userId, cloudId + bundleName);
514 cloudDiskMetaFile_.erase(key);
515 cloudDiskMetaFileList_.remove_if([key](CloudDiskMetaFileListEle &item) { return item.first == key; });
516 }
517
CloudDiskClearAll()518 void MetaFileMgr::CloudDiskClearAll()
519 {
520 std::lock_guard<std::mutex> lock(cloudDiskMutex_);
521 cloudDiskMetaFile_.clear();
522 cloudDiskMetaFileList_.clear();
523 }
524
GetCloudDiskMetaFile(uint32_t userId,const std::string & bundleName,const std::string & cloudId)525 std::shared_ptr<CloudDiskMetaFile> MetaFileMgr::GetCloudDiskMetaFile(uint32_t userId, const std::string &bundleName,
526 const std::string &cloudId)
527 {
528 std::shared_ptr<CloudDiskMetaFile> mFile = nullptr;
529 std::lock_guard<std::mutex> lock(cloudDiskMutex_);
530 MetaFileKey key(userId, cloudId + bundleName);
531 auto it = cloudDiskMetaFile_.find(key);
532 if (it != cloudDiskMetaFile_.end()) {
533 cloudDiskMetaFileList_.splice(cloudDiskMetaFileList_.begin(), cloudDiskMetaFileList_, it->second);
534 mFile = it->second->second;
535 } else {
536 if (cloudDiskMetaFile_.size() == MAX_META_FILE_NUM) {
537 auto deleteKey = cloudDiskMetaFileList_.back().first;
538 cloudDiskMetaFile_.erase(deleteKey);
539 cloudDiskMetaFileList_.pop_back();
540 }
541 mFile = std::make_shared<CloudDiskMetaFile>(userId, bundleName, cloudId);
542 cloudDiskMetaFileList_.emplace_front(key, mFile);
543 cloudDiskMetaFile_[key] = cloudDiskMetaFileList_.begin();
544 }
545 return mFile;
546 }
547
CreateRecycleDentry(uint32_t userId,const std::string & bundleName)548 int32_t MetaFileMgr::CreateRecycleDentry(uint32_t userId, const std::string &bundleName)
549 {
550 if (bundleName != "com.ohos.photos") {
551 return EINVAL;
552 }
553 return E_OK;
554 }
555
MoveIntoRecycleDentryfile(uint32_t userId,const std::string & bundleName,const struct RestoreInfo & restoreInfo)556 int32_t MetaFileMgr::MoveIntoRecycleDentryfile(uint32_t userId, const std::string &bundleName,
557 const struct RestoreInfo &restoreInfo)
558 {
559 if (restoreInfo.parentCloudId == "mock") {
560 return E_RDB;
561 }
562 return E_OK;
563 }
564
RemoveFromRecycleDentryfile(uint32_t userId,const std::string & bundleName,const struct RestoreInfo & restoreInfo)565 int32_t MetaFileMgr::RemoveFromRecycleDentryfile(uint32_t userId, const std::string &bundleName,
566 const struct RestoreInfo &restoreInfo)
567 {
568 if (restoreInfo.parentCloudId == "mock") {
569 return E_RDB;
570 }
571 return E_OK;
572 }
573
GetNewName(std::shared_ptr<CloudDiskMetaFile> metaFile,const std::string & oldName,std::string & newName)574 int32_t MetaFileMgr::GetNewName(std::shared_ptr<CloudDiskMetaFile> metaFile, const std::string &oldName,
575 std::string &newName)
576 {
577 return E_OK;
578 }
579 } // namespace FileManagement
580 } // namespace OHOS