RTEMS: cpukit/include/rtems/rfs/rtems-rfs-group.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
rtems-rfs-group.h
Go to the documentation of this file.
1
13/*
14 * COPYRIGHT (c) 2010 Chris Johns <chrisj@rtems.org>
15 *
16 * The license and distribution terms for this file may be
17 * found in the file LICENSE in this distribution or at
18 * http://www.rtems.org/license/LICENSE.
19 */
20
21
22#if !defined (_RTEMS_RFS_GROUP_H_)
23#define _RTEMS_RFS_GROUP_H_
24
32#include <rtems/rfs/rtems-rfs-trace.h>
33#include <rtems/rfs/rtems-rfs-bitmaps.h>
34#include <rtems/rfs/rtems-rfs-buffer.h>
35
39#define RTEMS_RFS_GROUP_BLOCK_BITMAP_BLOCK (0)
40#define RTEMS_RFS_GROUP_INODE_BITMAP_BLOCK (1)
41#define RTEMS_RFS_GROUP_INODE_BLOCK (2)
42
51 typedef struct _rtems_rfs_group
52{
56 rtems_rfs_buffer_block base;
57
61 size_t size;
62
66 rtems_rfs_bitmap_control block_bitmap;
67
71 rtems_rfs_buffer_handle block_bitmap_buffer;
72
76 rtems_rfs_bitmap_control inode_bitmap;
77
81 rtems_rfs_buffer_handle inode_bitmap_buffer;
82
83} rtems_rfs_group;
84
88#define rtems_rfs_group_block(_g, _b) (((_g)->base) + (_b))
89
93#define rtems_rfs_group_inode(_f, _g, _i) \
94 (((_f)->group_inodes * (_g)) + (_i) + RTEMS_RFS_ROOT_INO)
95
107int rtems_rfs_group_open (rtems_rfs_file_system* fs,
108 rtems_rfs_buffer_block base,
109 size_t size,
110 size_t inodes,
111 rtems_rfs_group* group);
112
122int rtems_rfs_group_close (rtems_rfs_file_system* fs,
123 rtems_rfs_group* group);
124
137int rtems_rfs_group_bitmap_alloc (rtems_rfs_file_system* fs,
138 rtems_rfs_bitmap_bit goal,
139 bool inode,
140 rtems_rfs_bitmap_bit* result);
141
150int rtems_rfs_group_bitmap_free (rtems_rfs_file_system* fs,
151 bool inode,
152 rtems_rfs_bitmap_bit no);
153
163int rtems_rfs_group_bitmap_test (rtems_rfs_file_system* fs,
164 bool inode,
165 rtems_rfs_bitmap_bit no,
166 bool* state);
167
176int rtems_rfs_group_usage (rtems_rfs_file_system* fs,
177 size_t* blocks,
178 size_t* inodes);
179
181#endif
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.
Definition: rtems-rfs-group.c:273
rtems_rfs_group
struct _rtems_rfs_group rtems_rfs_group
Creates bit allocator for blocks in the group simpler.
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.
Definition: rtems-rfs-group.c:153
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.
Definition: rtems-rfs-group.c:314
rtems_rfs_group_close
int rtems_rfs_group_close(rtems_rfs_file_system *fs, rtems_rfs_group *group)
Close a group.
Definition: rtems-rfs-group.c:123
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.
Definition: rtems-rfs-group.c:360
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.
Definition: rtems-rfs-group.c:32
rtems-rfs-bitmaps.h
RTEMS File Systems Bitmap Routines.
rtems_rfs_bitmap_bit
int32_t rtems_rfs_bitmap_bit
Definition: rtems-rfs-bitmaps.h:84
rtems-rfs-buffer.h
Maps Blocks to the Media Interface Layers.
rtems_rfs_buffer_block
uint32_t rtems_rfs_buffer_block
Definition: rtems-rfs-buffer.h:62
rtems-rfs-trace.h
Manages the Trace and Debugging Features of the RTEMS RFS File System.
_rtems_rfs_file_system
Definition: rtems-rfs-file-system.h:116
_rtems_rfs_group
Creates bit allocator for blocks in the group simpler.
Definition: rtems-rfs-group.h:52
_rtems_rfs_group::base
rtems_rfs_buffer_block base
Definition: rtems-rfs-group.h:56
_rtems_rfs_group::size
size_t size
Definition: rtems-rfs-group.h:61
_rtems_rfs_group::inode_bitmap_buffer
rtems_rfs_buffer_handle inode_bitmap_buffer
Definition: rtems-rfs-group.h:81
_rtems_rfs_group::block_bitmap_buffer
rtems_rfs_buffer_handle block_bitmap_buffer
Definition: rtems-rfs-group.h:71
_rtems_rfs_group::block_bitmap
rtems_rfs_bitmap_control block_bitmap
Definition: rtems-rfs-group.h:66
_rtems_rfs_group::inode_bitmap
rtems_rfs_bitmap_control inode_bitmap
Definition: rtems-rfs-group.h:76
rtems_rfs_bitmap_control_s
Definition: rtems-rfs-bitmaps.h:105
rtems_rfs_buffer_handle_t
Definition: rtems-rfs-buffer.h:92