/* * Copyright 2012 Institute of Communication and Computer Systems (ICCS) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ /** * @file bitmap_rb.h * @author Ioannis Koutras (joko@microlab.ntua.gr) * @date September 2012 * @brief Bitmap-organized raw block structure and creation function. */ #ifndef BITMAP_RB_H #define BITMAP_RB_H #include "dmm_config.h" #include #include /* for size_t */ #define BMAP_EL_TYPE uint64_t #define BMAP_EL_SIZE_BITS (sizeof(BMAP_EL_TYPE) * 8) #define BMAP_INDEX_NUM 20 /** Bitmap-organized raw block header data structure */ typedef struct bitmap_rb_s { BMAP_EL_TYPE bmap_array[BMAP_INDEX_NUM]; BMAP_EL_TYPE bmap_array2[BMAP_INDEX_NUM]; BMAP_EL_TYPE bmap_array3[BMAP_INDEX_NUM]; size_t bytes_per_cell; /* FIXME - As long as the bitmap arrays are fixed-sized, this is also fixed */ } bitmap_rb_t; /** Chunk header data structure */ typedef struct chunk_header_s { size_t num_of_cells; /**< The number of occupied cells. */ } chunk_header_t; #endif /* BITMAP_RB_H */