Merge branch 'master' of gitee.com:Zshengyu26/filemanagement_user_file_service

This commit is contained in:
张晟钰 2024-04-17 20:47:32 +08:00
commit e0a8da397e
2 changed files with 4 additions and 4 deletions

View File

@ -23,8 +23,8 @@
namespace OHOS {
namespace FileAccessFwk {
const int64_t FILEFILTER_DEFAULT_COUNTS = 2000;
const int64_t FILEFILTER_MAX_COUNTS = 20000;
const uint64_t FILEFILTER_DEFAULT_COUNTS = 2000;
const uint64_t FILEFILTER_MAX_COUNTS = 20000;
std::shared_ptr<FileAccessExtAbility> FileAccessExtStubImpl::GetOwner()
{
return extension_;
@ -149,7 +149,7 @@ int FileAccessExtStubImpl::ListFile(const FileInfo &fileInfo, const int64_t offs
memInfo.isOver = false;
int64_t currentOffset = offset;
while (true) {
int64_t maxCounts =
uint64_t maxCounts =
memInfo.memSize > DEFAULT_CAPACITY_200KB ? FILEFILTER_MAX_COUNTS : FILEFILTER_DEFAULT_COUNTS;
fileInfoVec.clear();
ret = extension_->ListFile(fileInfo, currentOffset, maxCounts, filter, fileInfoVec);

View File

@ -211,7 +211,7 @@ public:
static bool CalculateMemSize(uint64_t &memSize, SharedMemoryInfo &memInfo)
{
uint64_t allocSize = ((memInfo.leftDataCounts + memInfo.totalDataCounts - 1) / memInfo.totalDataCounts + 1)
int64_t allocSize = ((memInfo.leftDataCounts + memInfo.totalDataCounts - 1) / memInfo.totalDataCounts + 1)
* DEFAULT_CAPACITY_200KB;
if (allocSize >= MAX_CAPACITY_2MB && memInfo.memSize < MAX_CAPACITY_2MB) {