📄 structuremanager.h
字号:
#ifndef __STRUCTUREMANAGER__H__
#define __STRUCTUREMANAGER__H__
#include "LLD.h"
#define MAX_ENTRY_CACHE 2
#define MAX_SECTOR_NUMBER 32
typedef struct P
{
UINT16 PhysicalBlockNumber;
UINT8 Sector[MAX_SECTOR_NUMBER];
INT16 OffsetValidation;
}SectorMap;
NFTL_Return CalculateLastWrite(UINT16 PhyBlockNumber, UINT8 *LastWrite);
NFTL_Return AddBlock(UINT16 PhysicalBlockNumber, UINT8 *SpareBuffer, void **Node,
UINT8 *Conflit, UINT16 *ConflitPhyBlockNum, UINT8 newblock);
NFTL_Return EraseLeafStructure(void **Node);
NFTL_Return ResolveConflict(void **Node, UINT16 ConflictPhyBlockNum);
NFTL_Return SM_ReadPage(UINT16 VirtualBlock, UINT8 Sector, UINT8 *Buffer, void *Node);
NFTL_Return SM_WritePage(UINT16 VirtualBlock, UINT8 Sector, UINT8 *Buffer_data,
void **Node);
UINT8 DimensionDataStructure(void *Node);
NFTL_Return GetValidPagePosition(void *Node, UINT16 *PhysicalBlockNumber,
UINT16 *PhysicalPage, UINT8 Sector, UINT8 *Position, UINT8 flag);
NFTL_Return EraseStructure(void *Root);
NFTL_Return EraseRAMStructure(void *Root);
NFTL_Return EraseSectorMapToCache(UINT16 PhyBlockNum);
NFTL_Return FindSectorMap(UINT16 PhyBlockNum, SectorMap *SectorM);
void UpdatePhysicalBlock(void *Node, UINT16 NewPhysicalBlockNumber);
NFTL_Return UpdateLastwrite(void *Node, UINT8 LastWrite);
void ListInvalidBlock(void *Node, UINT16 *InvalidBlocks);
void GetSectorNumber(UINT8 *SpareBuffer, UINT8 PhysicalPage, UINT8 *Sector);
NFTL_Return GetRootCounter(void *Node, UINT8 *RootCounter);
NFTL_Return IncrementWriteAddress(void *Node, UINT8 Sector, UINT8 PhysicalPage,
UINT8 *SpareBuffer, UINT16 *NewPhysicalBlockNumber, UINT16 *NewPhysicalPage);
NFTL_Return UpdatePhysicalBlockInTree(void *Node, UINT16 NewPhysicalBlockNumber,
UINT16 PhysicalBlockNumber);// FTL2,0 recoveryABt functionality
NFTL_Return GetNodeByPosition(void *Root, UINT16 *blockNumber);// FTL2,0 optimize Ram
NFTL_Return GetNodeByPhyBlockNumber(void *Root, UINT16 PhyBlockNum, void **Node);
NFTL_Return SetLastWriteByPosition(void *Root, UINT8 Position, UINT8 LastWrite);
NFTL_Return GetLastWriteByPosition(void *Root, UINT8 Position, UINT8 *LastWrite);
NFTL_Return AddNode(void **Root, UINT8 information, UINT8 LastWrite,
UINT16 PhyBlockNumber);
NFTL_Return CopyAndEraseSectorMapToCache(UINT16 PhyBlockNumToBeErased,
SectorMap *NewSectorMap);
void IncrementIndexCache(void);
NFTL_Return CopySectorMap(SectorMap Origin, int Destination);
void SetSMFreeCache(int j, UINT8 FC);
UINT8 GetSMFreeCache(int j);
int GetSMIndexCache(void);
void SetSMIndexCache(int j);
UINT16 GetSMCachePhysicalBlockNumber(int j);
void SetSMCachePhysicalBlockNumber(int j, UINT16 BN);
void ResetCache(void);
UINT16 GetSMUsedBlocks(void);
void SetSMUsedBlocks(UINT16 value);
UINT8 GetSMSectorElement(int i, int j);
void SetSMSectorElement(int i, int j, INT16 Elem);
INT16 GetSMOffsetValidation(int i);
void SetSMOffsetValidation(int i, INT16 OV);
int GetSMIndexCache(void);
void SetSMIndexCache(int j);
#endif //__STRUCTUREMANAGER__H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -