Lines Matching refs:base
278 static bool UpdateDentry(HmdfsDentryGroup &d, const MetaBase &base, uint32_t nameHash, uint32_t bitPos)
281 const std::string name = base.name;
292 de->mtime = base.mtime;
293 de->fileType = base.fileType;
294 de->size = base.size;
295 de->mode = base.mode;
296 ret = memcpy_s(de->recordId, CLOUD_RECORD_ID_LEN, base.cloudId.c_str(), base.cloudId.length());
298 LOGE("memcpy_s failed, dstLen = %{public}d, srcLen = %{public}zu", CLOUD_RECORD_ID_LEN, base.cloudId.length());
325 int32_t MetaFile::DoCreate(const MetaBase &base)
340 uint32_t namehash = CloudDisk::CloudFileUtils::DentryHash(base.name);
360 bitPos = RoomForFilename(dentryBlk.bitmap, GetDentrySlots(base.name.length()), DENTRY_PER_GROUP);
370 if (!UpdateDentry(dentryBlk, base, namehash, bitPos)) {
391 static void InitDcacheLookupCtx(DcacheLookupCtx *ctx, const MetaBase &base, int fd)
394 ctx->name = base.name;
498 int32_t MetaFile::DoRemove(const MetaBase &base)
508 InitDcacheLookupCtx(&ctx, base, fd_);
531 int32_t MetaFile::DoLookup(MetaBase &base)
541 InitDcacheLookupCtx(&ctx, base, fd_);
548 base.size = de->size;
549 base.mtime = de->mtime;
550 base.mode = de->mode;
551 base.fileType = de->fileType;
552 base.cloudId = std::string(reinterpret_cast<const char *>(de->recordId), CLOUD_RECORD_ID_LEN - 1);
557 int32_t MetaFile::DoUpdate(const MetaBase &base)
567 InitDcacheLookupCtx(&ctx, base, fd_);
574 de->mtime = base.mtime;
575 de->size = base.size;
576 de->mode = base.mode;
577 de->fileType = base.fileType;
578 if (memcpy_s(de->recordId, CLOUD_RECORD_ID_LEN, base.cloudId.c_str(), base.cloudId.length())) {
579 LOGE("memcpy_s failed, dstLen = %{public}d, srcLen = %{public}zu", CLOUD_RECORD_ID_LEN, base.cloudId.length());
593 MetaBase base{oldBase.name};
594 int32_t ret = DoLookup(base);
596 LOGE("ret = %{public}d, lookup %s failed", ret, base.name.c_str());
600 base.name = newName;
601 ret = DoCreate(base);
603 LOGE("ret = %{public}d, create %s failed", ret, base.name.c_str());
607 base.name = oldBase.name;
611 base.name = newName;
612 (void)DoRemove(base);
629 MetaBase base(name);
630 base.mode = dentryGroup.nsl[i].mode;
631 base.mtime = dentryGroup.nsl[i].mtime;
632 base.size = dentryGroup.nsl[i].size;
633 base.fileType = dentryGroup.nsl[i].fileType;
634 base.cloudId = std::string(reinterpret_cast<const char *>(dentryGroup.nsl[i].recordId), CLOUD_RECORD_ID_LEN);
635 bases.emplace_back(base);