我要评分
获取效率
正确性
完整性
易理解

BioAllocCacheSpace

Function Definition

Applies for cache space. This interface is used together with copy-free write.

Implementation

CResult BioAllocCacheSpace(uint64_t tenantId, uint64_t objectId, uint64_t length, CacheSpaceDesc *space)

Parameters

Table 1 Parameters

Parameter

Data Type

Input/Output

Description

tenantId

uint64_t

Input

Tenant ID.

objectId

uint64_t

Input

Object ID.

length

uint64_t

Input

Length of the cache space to be applied for. The maximum value is 4,194,304 bytes (4 MB).

space

CacheSpaceDesc*

Output

Cache space information description:

  • uint8_t allocLoc;

    Application flag.

  • uint16_t addressNum;

    Number of addresses.

  • uint16_t descriptorSize;

    Length of the cache space descriptor.

  • ObjLocation loc;

    Cache space location.

  • CacheAddress address[CACHE_SPACE_ADDRESS_SIZE];

    Cache space address:

    • uint64_t address;

    Cache address.

    • uint32_t size;

    Cache length.

  • char descriptorInfo[CACHE_SPACE_DEC_SIZE];

    Cache space descriptor information.

Return Values

Table 2 Return values

Return Value

Description

RET_CACHE_OK

The operation is successful.

RET_CACHE_NOT_FOUND

The cache instance is not found.

RET_CACHE_NOT_READY

The BoostIO service is not ready.

RET_CACHE_NEED_RETRY

A retry is required.

RET_CACHE_PT_FAULT

The object location cannot be written due to a partition error.

RET_CACHE_ERROR

The operation failed.