RTEMS  5.0.0
Functions

RTEMS File Systems Group RoutinesThese functions open and close a group as well as manage bit allocations within a group. More...

#include <inttypes.h>
#include <string.h>
#include <rtems/rfs/rtems-rfs-file-system.h>
#include <rtems/rfs/rtems-rfs-group.h>

Functions

int rtems_rfs_group_open (rtems_rfs_file_system *fs, rtems_rfs_buffer_block base, size_t size, size_t inodes, rtems_rfs_group *group)
 Open a group. More...
 
int rtems_rfs_group_close (rtems_rfs_file_system *fs, rtems_rfs_group *group)
 Close a group. More...
 
int rtems_rfs_group_bitmap_alloc (rtems_rfs_file_system *fs, rtems_rfs_bitmap_bit goal, bool inode, rtems_rfs_bitmap_bit *result)
 Allocate an inode or block. More...
 
int rtems_rfs_group_bitmap_free (rtems_rfs_file_system *fs, bool inode, rtems_rfs_bitmap_bit no)
 Free the group allocated bit. More...
 
int rtems_rfs_group_bitmap_test (rtems_rfs_file_system *fs, bool inode, rtems_rfs_bitmap_bit no, bool *state)
 Test the group allocated bit. More...
 
int rtems_rfs_group_usage (rtems_rfs_file_system *fs, size_t *blocks, size_t *inodes)
 Determine the number of blocks and inodes used. More...
 

Detailed Description

RTEMS File Systems Group Routines

These functions open and close a group as well as manage bit allocations within a group.

Function Documentation

◆ rtems_rfs_group_bitmap_alloc()

int rtems_rfs_group_bitmap_alloc ( rtems_rfs_file_system fs,
rtems_rfs_bitmap_bit  goal,
bool  inode,
rtems_rfs_bitmap_bit result 
)

Allocate an inode or block.

The groups are searched to find the next available inode or block.

Parameters
fsThe file system data.
goalThe goal to seed the bitmap search.
inodeIf true allocate an inode else allocate a block.
resultThe allocated bit in the bitmap.
Return values
intThe error number (errno). No error if 0.

◆ rtems_rfs_group_bitmap_free()

int rtems_rfs_group_bitmap_free ( rtems_rfs_file_system fs,
bool  inode,
rtems_rfs_bitmap_bit  no 
)

Free the group allocated bit.

Parameters
fsThe file system data.
inodeIf true the number to free is an inode else it is a block.
blockThe inode or block number to free.
Return values
intThe error number (errno). No error if 0.

◆ rtems_rfs_group_bitmap_test()

int rtems_rfs_group_bitmap_test ( rtems_rfs_file_system fs,
bool  inode,
rtems_rfs_bitmap_bit  no,
bool *  state 
)

Test the group allocated bit.

Parameters
fsThe file system data.
inodeIf true the number to free is an inode else it is a block.
blockThe inode or block number to free.
stateReturn the state of the bit.
Return values
intThe error number (errno). No error if 0.

◆ rtems_rfs_group_close()

int rtems_rfs_group_close ( rtems_rfs_file_system fs,
rtems_rfs_group group 
)

Close a group.

Release all resources the group holds.

Parameters
fsThe file system.
groupThe group to close.
Return values
intThe error number (errno). No error if 0.

◆ rtems_rfs_group_open()

int rtems_rfs_group_open ( rtems_rfs_file_system fs,
rtems_rfs_buffer_block  base,
size_t  size,
size_t  inodes,
rtems_rfs_group group 
)

Open a group.

Allocate all the resources including the bitmaps.

Parameters
fsThe file system.
baseThe base block number.
sizeThe number of blocks in the group.
groupReference to the group to open.
Return values
intThe error number (errno). No error if 0.

◆ rtems_rfs_group_usage()

int rtems_rfs_group_usage ( rtems_rfs_file_system fs,
size_t *  blocks,
size_t *  inodes 
)

Determine the number of blocks and inodes used.

Parameters
fsThe file system data.
blocksThe number of blocks used.
inodesThe number of inodes used.
Return values
intThe error number (errno). No error if 0.