RTEMS 6.1-rc1
rtems-rfs-group.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
15/*
16 * COPYRIGHT (c) 2010 Chris Johns <chrisj@rtems.org>
17 *
18 * Redistribution and use in source and binary forms, with or without
19 * modification, are permitted provided that the following conditions
20 * are met:
21 * 1. Redistributions of source code must retain the above copyright
22 * notice, this list of conditions and the following disclaimer.
23 * 2. Redistributions in binary form must reproduce the above copyright
24 * notice, this list of conditions and the following disclaimer in the
25 * documentation and/or other materials provided with the distribution.
26 *
27 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
28 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
31 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 * POSSIBILITY OF SUCH DAMAGE.
38 */
39
40
41#if !defined (_RTEMS_RFS_GROUP_H_)
42#define _RTEMS_RFS_GROUP_H_
43
54
58#define RTEMS_RFS_GROUP_BLOCK_BITMAP_BLOCK (0)
59#define RTEMS_RFS_GROUP_INODE_BITMAP_BLOCK (1)
60#define RTEMS_RFS_GROUP_INODE_BLOCK (2)
61
70typedef struct _rtems_rfs_group
71{
76
80 size_t size;
81
86
91
96
101
103
107#define rtems_rfs_group_block(_g, _b) (((_g)->base) + (_b))
108
112#define rtems_rfs_group_inode(_f, _g, _i) \
113 (((_f)->group_inodes * (_g)) + (_i) + RTEMS_RFS_ROOT_INO)
114
128 size_t size,
129 size_t inodes,
130 rtems_rfs_group* group);
131
142 rtems_rfs_group* group);
143
158 bool inode,
159 rtems_rfs_bitmap_bit* result);
160
170 bool inode,
172
183 bool inode,
185 bool* state);
186
196 size_t* blocks,
197 size_t* inodes);
198
200#endif
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:292
struct _rtems_rfs_group rtems_rfs_group
Creates bit allocator for blocks in the group simpler.
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:172
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:333
int rtems_rfs_group_close(rtems_rfs_file_system *fs, rtems_rfs_group *group)
Close a group.
Definition: rtems-rfs-group.c:142
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:379
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:51
RTEMS File Systems Bitmap Routines.
int32_t rtems_rfs_bitmap_bit
Definition: rtems-rfs-bitmaps.h:103
Maps Blocks to the Media Interface Layers.
uint32_t rtems_rfs_buffer_block
Definition: rtems-rfs-buffer.h:81
Manages the Trace and Debugging Features of the RTEMS RFS File System.
Definition: rtems-rfs-file-system.h:135
Creates bit allocator for blocks in the group simpler.
Definition: rtems-rfs-group.h:71
rtems_rfs_buffer_block base
Definition: rtems-rfs-group.h:75
size_t size
Definition: rtems-rfs-group.h:80
rtems_rfs_buffer_handle inode_bitmap_buffer
Definition: rtems-rfs-group.h:100
rtems_rfs_buffer_handle block_bitmap_buffer
Definition: rtems-rfs-group.h:90
rtems_rfs_bitmap_control block_bitmap
Definition: rtems-rfs-group.h:85
rtems_rfs_bitmap_control inode_bitmap
Definition: rtems-rfs-group.h:95
Definition: rtems-rfs-bitmaps.h:124
Definition: rtems-rfs-buffer.h:111
unsigned size
Definition: tte.h:1