Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/mfs/mfs.h

    r062d900 rfd7dbbb  
    4444#include <errno.h>
    4545#include <assert.h>
     46#include <stdbool.h>
    4647#include "../../vfs/vfs.h"
    4748
     
    5758#define mfsdebug(...)
    5859#endif
     60
     61#define MFS_BMAP_START_BLOCK(sbi, bid) \
     62    ((bid) == BMAP_ZONE ? 2 + (sbi)->ibmap_blocks : 2)
     63
     64#define MFS_BMAP_SIZE_BITS(sbi, bid) \
     65    ((bid) == BMAP_ZONE ? (sbi)->nzones - (sbi)->firstdatazone - 1 : \
     66    (sbi)->ninodes - 1)
     67
     68#define MFS_BMAP_SIZE_BLOCKS(sbi, bid) \
     69    ((bid) == BMAP_ZONE ? (sbi)->zbmap_blocks : (sbi)->ibmap_blocks)
    5970
    6071typedef uint32_t bitchunk_t;
     
    95106        unsigned isearch;
    96107        unsigned zsearch;
     108
     109        /* Indicates wether if the cached number of free zones
     110         * is to be considered valid or not.
     111         */
     112        bool nfree_zones_valid;
     113        /* Cached number of free zones, used to avoid to scan
     114         * the whole bitmap every time the mfs_free_block_count()
     115         * is invoked.
     116         */
     117        unsigned nfree_zones;
    97118};
    98119
     
    201222mfs_free_zone(struct mfs_instance *inst, uint32_t zone);
    202223
     224extern int
     225mfs_count_free_zones(struct mfs_instance *inst, uint32_t *zones);
     226
     227extern int
     228mfs_count_free_inodes(struct mfs_instance *inst, uint32_t *inodes);
     229
     230
    203231/* mfs_utils.c */
    204232extern uint16_t
Note: See TracChangeset for help on using the changeset viewer.