46#define ALIGN_LIB(x) (((x) + (HALARC_ALIGNMENT - 1)) & ~(HALARC_ALIGNMENT - 1))
47#define ALIGN_DISP(x) (HALARC_ALIGNMENT - ((x) & (HALARC_ALIGNMENT - 1)))
48#define BCACHE_PREREAD_PRIO 12
49#define UNSIGNED_INTEGER_BITS 32
50#define UNINT_MAX_SHIFT_BITS 31
51#define UNINT_LOG2_SHIFT 5
52#define PREREAD_BLOCK_NUM 2
55#define PREREAD_EVENT_MASK 0xf
57#if CONFIG_FS_FAT_SECTOR_PER_BLOCK < UNSIGNED_INTEGER_BITS
60#define BCACHE_BLOCK_FLAGS (CONFIG_FS_FAT_SECTOR_PER_BLOCK / UNSIGNED_INTEGER_BITS)
66 struct rb_node rbNode;
114#ifdef LOSCFG_FS_FAT_CACHE_SYNC_THREAD
259#ifdef LOSCFG_FS_FAT_CACHE_SYNC_THREAD
VOID ResumeAsyncPreread(OsBcache *arg1, const OsBcacheBlock *arg2)
VOID(* BcachePrereadFun)(struct tagOsBcache *, const OsBcacheBlock *)
OsBcache * BlockCacheInit(struct Vnode *devNode, UINT32 sectorSize, UINT32 sectorPerBlock, UINT32 blockNum, UINT64 blockCount)
VOID BlockCacheDeinit(OsBcache *bc)
INT32 BcacheClearCache(OsBcache *bc)
INT32 BlockCacheRead(OsBcache *bc, UINT8 *buf, UINT32 *len, UINT64 pos, BOOL useRead)
读块设备缓存
INT32 BlockCacheSync(OsBcache *bc)
块缓存同步
VOID BcacheSyncThreadInit(OsBcache *bc, INT32 id)
块缓存同步任务初始化,开了个内核任务.
INT32 BlockCacheWrite(OsBcache *bc, const UINT8 *buf, UINT32 *len, UINT64 pos)
写块设备缓存
INT32(* BcacheWriteFun)(struct Vnode *, const UINT8 *, UINT32, UINT64)
UINT32 BcacheAsyncPrereadInit(OsBcache *bc)
VOID BcacheSyncThreadDeinit(const OsBcache *bc)
struct tagOsBcache OsBcache
UINT32 BcacheAsyncPrereadDeinit(OsBcache *bc)
INT32(* BcacheReadFun)(struct Vnode *, UINT8 *, UINT32, UINT64)
双向链表由内联函数实现 http://weharmonyos.com/openharmony/zh-cn/device-dev/kernel/kernel-small-apx-dll....
vnode并不包含文件名,因为 vnode和文件名是 1:N 的关系
pthread_mutex_t bcacheMutex
BcachePrereadFun prereadFun