Signed-off-by: xuerunlong <xuerunlong1@huawei.com>
This commit is contained in:
xuerunlong 2024-06-05 16:03:58 +08:00
parent 91d2dc2fe3
commit 46edf30831
5 changed files with 11 additions and 4 deletions

View File

@ -124,6 +124,7 @@ public:
this->env_ = listener.env_;
this->cbOnRef_ = listener.cbOnRef_;
this->cbOffRef_ = listener.cbOffRef_;
this->observers_ = listener.observers_;
}
ChangeListenerNapi &operator=(const ChangeListenerNapi &listener)
@ -131,6 +132,7 @@ public:
this->env_ = listener.env_;
this->cbOnRef_ = listener.cbOnRef_;
this->cbOffRef_ = listener.cbOffRef_;
this->observers_ = listener.observers_;
return *this;
}

View File

@ -941,8 +941,8 @@ int32_t CloudDiskRdbStore::Rename(const std::string &oldParentCloudId, const std
return ret;
}
ValuesBucket rename;
CacheNode newNode = {.fileName = newFileName, .parentCloudId = newParentCloudId};
CacheNode oldNode = {.fileName = oldFileName, .parentCloudId = oldParentCloudId};
CacheNode newNode = {.parentCloudId = newParentCloudId, .fileName = newFileName};
CacheNode oldNode = {.parentCloudId = oldParentCloudId, .fileName = oldFileName};
HandleRenameValue(rename, metaBase.position, oldNode, newNode);
vector<ValueObject> bindArgs;
bindArgs.emplace_back(metaBase.cloudId);

View File

@ -934,7 +934,7 @@ string GetLocation(fuse_req_t req, shared_ptr<CloudDiskInode> inoPtr)
LOGE("parent inode not found");
return "null";
}
CacheNode newNode = {.fileName = inoPtr->fileName, .parentCloudId = parentInode->cloudId};
CacheNode newNode = {.parentCloudId = parentInode->cloudId, .fileName = inoPtr->fileName};
int res = rdbStore->GetXAttr(inoPtr->cloudId, CLOUD_FILE_LOCATION, location, newNode);
if (res != 0) {
LOGE("local file get location fail");

View File

@ -557,7 +557,7 @@ static uint32_t GetMaxLevel(int32_t fd)
if (fstat(fd, &st) == -1) {
return MAX_BUCKET_LEVEL;
}
uint32_t blkNum = st.st_size / DENTRYGROUP_SIZE + 1;
uint32_t blkNum = static_cast<uint32_t>(st.st_size) / DENTRYGROUP_SIZE + 1;
uint32_t maxLevel = 0;
blkNum >>= 1;
while (blkNum > 1) {

View File

@ -62,6 +62,11 @@ void PluginLoader::LoadCloudKitPlugin(bool isSupportCloudSync)
for (auto &pluginFileName : pluginFileNames) {
auto pluginFilePath = GetPluginPath(pluginFileName);
if (!pluginFilePath.empty()) {
char resolvedPath[PATH_MAX] = {'\0'};
if (realpath(pluginFilePath.c_str(), resolvedPath) == nullptr) {
LOGE("realpath failed in line path: %s", pluginFilePath.c_str());
reutrn;
}
cloudKitPulginHandle_ = dlopen(pluginFilePath.c_str(), RTLD_LAZY);
if (cloudKitPulginHandle_ == nullptr) {
LOGE("dlopen failed, path:%{public}s", pluginFilePath.c_str());