public SimpleLogPageFTL(IErasableDevice device,
            uint blockCount, uint mapListSize, int wearLevelingThreshold)
            : base(device)
        {
            this.blockCount = blockCount;
            this.mapListSize = mapListSize;
            this.wearLevelingThreshold = wearLevelingThreshold;

            // initialize the lba-pba map lists
            mapList = new BlockPageId[mapListSize];
            for (int i = 0; i < mapList.Length; i++)
                mapList[i] = new BlockPageId(uint.MaxValue, ushort.MaxValue);

            reverseMapList = new uint[device.PageCountPerBlock * blockCount];
            for (int i = 0; i < reverseMapList.Length; i++)
                reverseMapList[i] = uint.MaxValue;

            mapListPoint = 0;

            // initialize free/dirty block lists
            for (uint i = 0; i < blockCount - 1; i++)
                freeList.Add(i);

            reserved = blockCount - 1;	// set the last block as the reserved block

            // initialize block state array
            blockStates = new BlockState[blockCount];
            for (int i = 0; i < blockStates.Length; i++)
                blockStates[i] = new BlockState(dev.PageCountPerBlock);
        }
Beispiel #2
0
 // 子类要实现的
 // (无)
 // 可供使用的
 // (无)
 // 已实现的
 public FTLBase(IErasableDevice device)
 {
     dev = device;
     PageSize = device.PageSize;
 }
Beispiel #3
0
 public TrivalFTL(IErasableDevice device)
     : base(device)
 {
 }