RTEMS: cpukit/libfs/src/rfs/rtems-rfs-group.c File Reference

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
Functions
rtems-rfs-group.c File Reference
IO Library » File System Types and Mount » RTEMS File System Group Management

RTEMS File Systems Group Routines. 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.
int | rtems_rfs_group_close (rtems_rfs_file_system *fs, rtems_rfs_group *group)
| Close a group.
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.
int | rtems_rfs_group_bitmap_free (rtems_rfs_file_system *fs, bool inode, rtems_rfs_bitmap_bit no)
| Free the group allocated bit.
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.
int | rtems_rfs_group_usage (rtems_rfs_file_system *fs, size_t *blocks, size_t *inodes)
| Determine the number of blocks and inodes used.

## 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

  fs | The file system data.
  goal | The goal to seed the bitmap search.
  inode | If true allocate an inode else allocate a block.
  result | The allocated bit in the bitmap.

Return values

  int | The 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

  fs | The file system data.
  inode | If true the number to free is an inode else it is a block.
  block | The inode or block number to free.

Return values

  int | The 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

  fs | The file system data.
  inode | If true the number to free is an inode else it is a block.
  block | The inode or block number to free.
  state | Return the state of the bit.

Return values

  int | The 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

  fs | The file system.
  group | The group to close.

Return values

  int | The 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

  fs | The file system.
  base | The base block number.
  size | The number of blocks in the group.
  group | Reference to the group to open.

Return values

  int | The 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

  fs | The file system data.
  blocks | The number of blocks used.
  inodes | The number of inodes used.

Return values

  int | The error number (errno). No error if 0.