RTEMS  5.0.0
Data Structures | Macros | Typedefs | Functions

RTEMS File System Information Node. More...

#include <sys/stat.h>
#include <rtems/rfs/rtems-rfs-data.h>
#include <rtems/rfs/rtems-rfs-file-system.h>

Go to the source code of this file.

Data Structures

struct  _rtems_rfs_inode
 
struct  _rtems_rfs_inode_handle
 

Macros

#define RTEMS_RFS_S_ISUID   S_ISUID
 
#define RTEMS_RFS_S_ISGID   S_ISGID
 
#define RTEMS_RFS_S_ISVTX   S_ISVTX
 
#define RTEMS_RFS_S_IREAD   S_IREAD
 
#define RTEMS_RFS_S_IWRITE   S_IWRITE
 
#define RTEMS_RFS_S_IEXEC   S_IEXEC
 
#define RTEMS_RFS_S_ENFMT   S_ENFMT
 
#define RTEMS_RFS_S_IFMT   S_IFMT
 
#define RTEMS_RFS_S_IFDIR   S_IFDIR
 
#define RTEMS_RFS_S_IFCHR   S_IFCHR
 
#define RTEMS_RFS_S_IFBLK   S_IFBLK
 
#define RTEMS_RFS_S_IFREG   S_IFREG
 
#define RTEMS_RFS_S_IFLNK   S_IFLNK
 
#define RTEMS_RFS_S_IFSOCK   S_IFSOCK
 
#define RTEMS_RFS_S_IFIFO   S_IFIFO
 
#define RTEMS_RFS_S_IRWXU   S_IRWXU
 
#define RTEMS_RFS_S_IRUSR   S_IRUSR
 
#define RTEMS_RFS_S_IWUSR   S_IWUSR
 
#define RTEMS_RFS_S_IXUSR   S_IXUSR
 
#define RTEMS_RFS_S_IRWXG   S_IRWXG
 
#define RTEMS_RFS_S_IRGRP   S_IRGRP
 
#define RTEMS_RFS_S_IWGRP   S_IWGRP
 
#define RTEMS_RFS_S_IXGRP   S_IXGRP
 
#define RTEMS_RFS_S_IRWXO   S_IRWXO
 
#define RTEMS_RFS_S_IROTH   S_IROTH
 
#define RTEMS_RFS_S_IWOTH   S_IWOTH
 
#define RTEMS_RFS_S_IXOTH   S_IXOTH
 
#define RTEMS_RFS_S_ISBLK(m)   S_ISBLK(m)
 
#define RTEMS_RFS_S_ISCHR(m)   S_ISCHR(m)
 
#define RTEMS_RFS_S_ISDIR(m)   S_ISDIR(m)
 
#define RTEMS_RFS_S_ISFIFO(m)   S_ISFIFO(m)
 
#define RTEMS_RFS_S_ISREG(m)   S_ISREG(m)
 
#define RTEMS_RFS_S_ISLNK(m)   S_ISLNK(m)
 
#define RTEMS_RFS_S_ISSOCK(m)   S_ISSOCK(m)
 
#define RTEMS_RFS_S_SYMLINK   RTEMS_RFS_S_IFLNK | RTEMS_RFS_S_IRWXU | RTEMS_RFS_S_IRWXG | RTEMS_RFS_S_IRWXO
 
#define RTEMS_RFS_INODE_DATA_NAME_SIZE   (RTEMS_RFS_INODE_BLOCKS * sizeof (rtems_rfs_inode_block))
 
#define RTEMS_RFS_INODE_SIZE   (sizeof (rtems_rfs_inode))
 
#define rtems_rfs_inode_is_loaded(_h)   ((_h)->node)
 
#define rtems_rfs_inode_ino(_h)   ((_h)->ino)
 

Typedefs

typedef uint32_t rtems_rfs_ino
 
typedef uint32_t rtems_rfs_time
 
typedef uint32_t rtems_rfs_inode_block
 
typedef struct _rtems_rfs_inode rtems_rfs_inode
 
typedef struct _rtems_rfs_inode_handle rtems_rfs_inode_handle
 

Functions

int rtems_rfs_inode_alloc (rtems_rfs_file_system *fs, rtems_rfs_bitmap_bit goal, rtems_rfs_ino *ino)
 
int rtems_rfs_inode_free (rtems_rfs_file_system *fs, rtems_rfs_ino ino)
 
int rtems_rfs_inode_open (rtems_rfs_file_system *fs, rtems_rfs_ino ino, rtems_rfs_inode_handle *handle, bool load)
 
int rtems_rfs_inode_close (rtems_rfs_file_system *fs, rtems_rfs_inode_handle *handle)
 
int rtems_rfs_inode_load (rtems_rfs_file_system *fs, rtems_rfs_inode_handle *handle)
 
int rtems_rfs_inode_unload (rtems_rfs_file_system *fs, rtems_rfs_inode_handle *handle, bool update_ctime)
 
int rtems_rfs_inode_create (rtems_rfs_file_system *fs, rtems_rfs_ino parent, const char *name, size_t length, uint16_t mode, uint16_t links, uid_t uid, gid_t gid, rtems_rfs_ino *ino)
 
int rtems_rfs_inode_delete (rtems_rfs_file_system *fs, rtems_rfs_inode_handle *handle)
 
int rtems_rfs_inode_initialise (rtems_rfs_inode_handle *handle, uint16_t links, uint16_t mode, uid_t uid, gid_t gid)
 
int rtems_rfs_inode_time_stamp_now (rtems_rfs_inode_handle *handle, bool atime, bool mtime)
 
rtems_rfs_pos rtems_rfs_inode_get_size (rtems_rfs_file_system *fs, rtems_rfs_inode_handle *handle)
 

Detailed Description

RTEMS File System Information Node.

RTEMS File System Information Node.

The information nodes hold the data about all nodes in the file system.

Macro Definition Documentation

◆ RTEMS_RFS_INODE_DATA_NAME_SIZE

#define RTEMS_RFS_INODE_DATA_NAME_SIZE   (RTEMS_RFS_INODE_BLOCKS * sizeof (rtems_rfs_inode_block))

The size of the data name field in the inode.

◆ rtems_rfs_inode_ino

#define rtems_rfs_inode_ino (   _h)    ((_h)->ino)

Get the inode ino for a handle.

◆ rtems_rfs_inode_is_loaded

#define rtems_rfs_inode_is_loaded (   _h)    ((_h)->node)

Is the inode loaded ?

◆ RTEMS_RFS_INODE_SIZE

#define RTEMS_RFS_INODE_SIZE   (sizeof (rtems_rfs_inode))

The size of an inode.

◆ RTEMS_RFS_S_ENFMT

#define RTEMS_RFS_S_ENFMT   S_ENFMT

Enforcement-mode locking

◆ RTEMS_RFS_S_IEXEC

#define RTEMS_RFS_S_IEXEC   S_IEXEC

Execute/search permission, owner

◆ RTEMS_RFS_S_IFBLK

#define RTEMS_RFS_S_IFBLK   S_IFBLK

Block special

◆ RTEMS_RFS_S_IFCHR

#define RTEMS_RFS_S_IFCHR   S_IFCHR

Character special

◆ RTEMS_RFS_S_IFDIR

#define RTEMS_RFS_S_IFDIR   S_IFDIR

Directory

◆ RTEMS_RFS_S_IFIFO

#define RTEMS_RFS_S_IFIFO   S_IFIFO

Fifo

◆ RTEMS_RFS_S_IFLNK

#define RTEMS_RFS_S_IFLNK   S_IFLNK

Symbolic link

◆ RTEMS_RFS_S_IFMT

#define RTEMS_RFS_S_IFMT   S_IFMT

Type of file

◆ RTEMS_RFS_S_IFREG

#define RTEMS_RFS_S_IFREG   S_IFREG

Regular

◆ RTEMS_RFS_S_IFSOCK

#define RTEMS_RFS_S_IFSOCK   S_IFSOCK

Socket

◆ RTEMS_RFS_S_IREAD

#define RTEMS_RFS_S_IREAD   S_IREAD

Read permission, owner

◆ RTEMS_RFS_S_IRGRP

#define RTEMS_RFS_S_IRGRP   S_IRGRP

Read permission, group

◆ RTEMS_RFS_S_IROTH

#define RTEMS_RFS_S_IROTH   S_IROTH

Read permission, other

◆ RTEMS_RFS_S_IRUSR

#define RTEMS_RFS_S_IRUSR   S_IRUSR

Read permission, owner

◆ RTEMS_RFS_S_ISGID

#define RTEMS_RFS_S_ISGID   S_ISGID

Set group id on execution

◆ RTEMS_RFS_S_ISUID

#define RTEMS_RFS_S_ISUID   S_ISUID

The RFS mode definitions. Currently map to the C library ones.Set user id on execution

◆ RTEMS_RFS_S_ISVTX

#define RTEMS_RFS_S_ISVTX   S_ISVTX

Save swapped text even after use

◆ RTEMS_RFS_S_IWGRP

#define RTEMS_RFS_S_IWGRP   S_IWGRP

Write permission, grougroup

◆ RTEMS_RFS_S_IWOTH

#define RTEMS_RFS_S_IWOTH   S_IWOTH

Write permission, other

◆ RTEMS_RFS_S_IWRITE

#define RTEMS_RFS_S_IWRITE   S_IWRITE

Write permission, owner

◆ RTEMS_RFS_S_IWUSR

#define RTEMS_RFS_S_IWUSR   S_IWUSR

Write permission, owner

◆ RTEMS_RFS_S_IXGRP

#define RTEMS_RFS_S_IXGRP   S_IXGRP

Execute/search permission, group

◆ RTEMS_RFS_S_IXOTH

#define RTEMS_RFS_S_IXOTH   S_IXOTH

Execute/search permission, other

◆ RTEMS_RFS_S_IXUSR

#define RTEMS_RFS_S_IXUSR   S_IXUSR

Execute/search permission, owner

◆ RTEMS_RFS_S_SYMLINK

#define RTEMS_RFS_S_SYMLINK   RTEMS_RFS_S_IFLNK | RTEMS_RFS_S_IRWXU | RTEMS_RFS_S_IRWXG | RTEMS_RFS_S_IRWXO

Permissions of a symlink.

Typedef Documentation

◆ rtems_rfs_ino

typedef uint32_t rtems_rfs_ino

The inode number or ino.

◆ rtems_rfs_inode

The inode.

◆ rtems_rfs_inode_block

typedef uint32_t rtems_rfs_inode_block

The size of a block value on disk. This include the inodes and indirect tables.

◆ rtems_rfs_inode_handle

RFS Inode Handle.

◆ rtems_rfs_time

typedef uint32_t rtems_rfs_time

The time in the file system.

Function Documentation

◆ rtems_rfs_inode_alloc()

int rtems_rfs_inode_alloc ( rtems_rfs_file_system fs,
rtems_rfs_bitmap_bit  goal,
rtems_rfs_ino ino 
)

Allocate an inode number and return it.

Parameters
[in]fsis the file system data.
[out]inowill contain the ino.
Return values
0Successful operation.
error_codeAn error occurred.

◆ rtems_rfs_inode_close()

int rtems_rfs_inode_close ( rtems_rfs_file_system fs,
rtems_rfs_inode_handle handle 
)

The close inode handle. All opened inodes need to be closed.

Parameters
[in]fsis the file system.
[in]handleis the handle to close.
Return values
0Successful operation.
error_codeAn error occurred.

◆ rtems_rfs_inode_create()

int rtems_rfs_inode_create ( rtems_rfs_file_system fs,
rtems_rfs_ino  parent,
const char *  name,
size_t  length,
uint16_t  mode,
uint16_t  links,
uid_t  uid,
gid_t  gid,
rtems_rfs_ino ino 
)

Create an inode allocating, initialising and adding an entry to the parent directory.

Parameters
[in]fsis the file system data.
[in]parentis the parent inode number to add the directory entry to.
[in]nameis a pointer to the name of the directory entryinode to create.

◆ rtems_rfs_inode_delete()

int rtems_rfs_inode_delete ( rtems_rfs_file_system fs,
rtems_rfs_inode_handle handle 
)

Delete the inode eraseing it and release the buffer to commit the write. You need to load the inode again if you wish to use it again.

Parameters
[in]fsis the file system.
[in]handleis the inode handle to erase.
Return values
0Successful operation.
error_codeAn error occurred.

◆ rtems_rfs_inode_free()

int rtems_rfs_inode_free ( rtems_rfs_file_system fs,
rtems_rfs_ino  ino 
)

Free an inode.

Parameters
[in]fsis the file system data.
[in]inois the ino too free.
Return values
0Successful operation.
error_codeAn error occurred.

◆ rtems_rfs_inode_get_size()

rtems_rfs_pos rtems_rfs_inode_get_size ( rtems_rfs_file_system fs,
rtems_rfs_inode_handle handle 
)

Calculate the size of data attached to the inode.

Parameters
[in]fsis the file system data.
[in]handleis the inode handle.
Return values
sizeThe data size in bytes in the block map attched to the inode.

◆ rtems_rfs_inode_initialise()

int rtems_rfs_inode_initialise ( rtems_rfs_inode_handle handle,
uint16_t  links,
uint16_t  mode,
uid_t  uid,
gid_t  gid 
)

Initialise a new inode.

Parameters
[in]handleis the inode handle to initialise.
[in]linksare the number of links to the inode.
[in]modeis the inode mode.
[in]uidis the user id.
[in]gidis the group id.
Return values
0Successful operation.
error_codeAn error occurred.

◆ rtems_rfs_inode_load()

int rtems_rfs_inode_load ( rtems_rfs_file_system fs,
rtems_rfs_inode_handle handle 
)

Load the inode into memory.

Parameters
[in]fsis the file system.
[in]handleis the inode handle to load.
Return values
0Successful operation.
error_codeAn error occurred.

◆ rtems_rfs_inode_open()

int rtems_rfs_inode_open ( rtems_rfs_file_system fs,
rtems_rfs_ino  ino,
rtems_rfs_inode_handle handle,
bool  load 
)

Open the inode handle. This reads the inode into the buffer and sets the data pointer. All data is in media byte order and needs to be accessed via the supporting calls.

Parameters
[in]fsis the file system.
[in]inois the inode number.
[in]handleis the handle to the inode we are opening.
[in]loadIf true load the inode into memory from the media.
Return values
0Successful operation.
error_codeAn error occurred.

◆ rtems_rfs_inode_time_stamp_now()

int rtems_rfs_inode_time_stamp_now ( rtems_rfs_inode_handle handle,
bool  atime,
bool  mtime 
)

Time stamp the inode with the current time. The ctime field is hanlded automatically.

Parameters
[in]handleis the inode handle.
[in]atimeUpdate the atime field.
[in]mtimeUPdate the mtime field.
Return values
0Successful operation.
ENXIONo inode is loaded.
error_codeAn error occurred.

◆ rtems_rfs_inode_unload()

int rtems_rfs_inode_unload ( rtems_rfs_file_system fs,
rtems_rfs_inode_handle handle,
bool  update_ctime 
)

Unload the inode from memory.

Parameters
[in]fsis the file system.
[in]handleis the inode handle to unload.
[in]update_ctimeUpdate the ctime field of the inode.
Return values
0Successful operation.
error_codeAn error occurred.