示例#1
0
        public DuplexStorage(IStorage dataA, IStorage dataB, IStorage bitmap, int blockSize)
        {
            DataA         = dataA;
            DataB         = dataB;
            BitmapStorage = bitmap;
            BlockSize     = blockSize;

            Bitmap  = new DuplexBitmap(BitmapStorage, (int)(bitmap.GetSize() * 8));
            _length = DataA.GetSize();
        }
示例#2
0
        public void FsTrim()
        {
            // todo replace with a bitmap reader class when added
            BitArray bitmap = new DuplexBitmap(Map.GetFreeBlocksStorage(),
                                               Map.Header.JournalBlockCount + Map.Header.MainDataBlockCount).Bitmap;

            for (int i = 0; i < bitmap.Length; i++)
            {
                if (!bitmap[i])
                {
                    continue;
                }

                BaseStorage.Fill(SaveDataFileSystem.TrimFillValue, i * BlockSize, BlockSize);
            }

            Map.FsTrim();
        }