FSVol_CacheAssign()

void  FSVol_CacheAssign (CPU_CHAR          *name_vol,
                         FS_VOL_CACHE_API  *p_cache_api,
                         void              *p_cache_data,
                         CPU_INT32U         size,
                         CPU_INT08U         pct_mgmt,
                         CPU_INT08U         pct_dir,
                         FS_FLAGS           mode,
                         FS_ERR            *p_err)

File

Called from

Code enabled by

fs_vol.c

Application

FS_CFG_CACHE_EN

Assign cache to a volume.

Arguments

name_vol

Volume name.

p_cache_api

Pointer to: (a) cache API to use; OR (b) NULL, if default cache API should be used.

p_cache_data

Pointer to cache data.

size

Size, in bytes, of cache buffer.

pct_mgmt

Percent of cache buffer dedicated to management sectors.

pct_dir

Percent of cache buffer dedicated to directory sectors.

mode

Cache mode

FS_VOL_CACHE_MODE_WR_THROUGH

FS_VOL_CACHE_MODE_WR_BACK

FS_VOL_CACHE_MODE_RD

p_err

Pointer to variable that will receive return error code from this function:

FS_ERR_NONE

Cache created.

FS_ERR_NAME_NULL

name_vol’ passed a NULL pointer.

FS_ERR_VOL_NOT_OPEN

Volume not open.

FS_ERR_NULL_PTR

p_cache_data’ passed a NULL pointer.

FS_ERR_CACHE_INVALID_MODE

Mode specified invalid

FS_ERR_CACHE_INVALID_SEC_TYPE

Sector type sepecified invalid.

FS_ERR_CACHE_TOO_SMALL

Size specified too small for cache.

Returned Value

None.

Notes/Warnings

None.