bitmap_rb.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright 2012 Institute of Communication and Computer Systems (ICCS)
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. *
  16. */
  17. /**
  18. * @file bitmap_rb.h
  19. * @author Ioannis Koutras (joko@microlab.ntua.gr)
  20. * @date September 2012
  21. * @brief Bitmap-organized raw block structure and creation function.
  22. */
  23. #ifndef BITMAP_RB_H
  24. #define BITMAP_RB_H
  25. #include "dmm_config.h"
  26. #include <inttypes.h>
  27. #include <stddef.h> /* for size_t */
  28. #define BMAP_EL_TYPE uint64_t
  29. #define BMAP_EL_SIZE_BITS (sizeof(BMAP_EL_TYPE) * 8)
  30. #define BMAP_INDEX_NUM 20
  31. /** Bitmap-organized raw block header data structure */
  32. typedef struct bitmap_rb_s {
  33. BMAP_EL_TYPE bmap_array[BMAP_INDEX_NUM];
  34. size_t bytes_per_cell; /* FIXME - As long as the bitmap arrays are
  35. fixed-sized, this is also fixed */
  36. } bitmap_rb_t;
  37. /** Chunk header data structure */
  38. typedef struct chunk_header_s {
  39. size_t num_of_cells; /**< The number of occupied cells. */
  40. } chunk_header_t;
  41. #endif /* BITMAP_RB_H */