RTEMS  5.1
Data Structures | Macros | Typedefs | Functions | Variables
imfs.h File Reference

Header File for the In-Memory File System. More...

#include <sys/time.h>
#include <limits.h>
#include <rtems/libio_.h>
#include <rtems/pipe.h>
#include <rtems/score/timecounter.h>

Go to the source code of this file.

Data Structures

struct  IMFS_node_control
 IMFS node control. More...
 
struct  IMFS_mknod_control
 
struct  IMFS_jnode_tt
 
struct  IMFS_directory_t
 
struct  IMFS_device_t
 
struct  IMFS_link_t
 
struct  IMFS_sym_link_t
 
struct  IMFS_filebase_t
 
struct  IMFS_memfile_t
 
struct  IMFS_linearfile_t
 
union  IMFS_file_t
 
struct  IMFS_fifo_t
 
struct  IMFS_generic_t
 
struct  IMFS_linearfile_context
 
struct  IMFS_mknod_controls
 
struct  IMFS_fs_info_t
 
struct  IMFS_mount_data
 

Macros

#define IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK   128
 
#define IMFS_MEMFILE_BYTES_PER_BLOCK   imfs_memfile_bytes_per_block
 
#define IMFS_MEMFILE_BLOCK_SLOTS   (IMFS_MEMFILE_BYTES_PER_BLOCK / sizeof(void *))
 
#define FIRST_INDIRECT   (0)
 
#define LAST_INDIRECT   (IMFS_MEMFILE_BLOCK_SLOTS - 1)
 
#define FIRST_DOUBLY_INDIRECT   (LAST_INDIRECT + 1)
 
#define LAST_DOUBLY_INDIRECT
 
#define FIRST_TRIPLY_INDIRECT   (LAST_DOUBLY_INDIRECT + 1)
 
#define LAST_TRIPLY_INDIRECT
 
#define IMFS_MEMFILE_MAXIMUM_SIZE   (LAST_TRIPLY_INDIRECT * IMFS_MEMFILE_BYTES_PER_BLOCK)
 
#define IMFS_NAME_MAX   _POSIX_NAME_MAX
 
#define IMFS_NODE_CONTROL_INITIALIZER(handlers, init, destroy)
 Initializer for an IMFS node control. More...
 
#define IMFS_NODE_INITIALIZER(node_control, name, namelen, mode)
 Initializer for an IMFS node. More...
 
#define IMFS_GENERIC_INITIALIZER(handlers, init, destroy)   IMFS_NODE_CONTROL_INITIALIZER( handlers, init, destroy )
 
#define IMFS_GENERIC_CONTROL_INITIALIZER(handlers, init, destroy)   IMFS_NODE_CONTROL_INITIALIZER( handlers, init, destroy )
 Initializer for a generic node control. More...
 
#define IMFS_GENERIC_NODE_INITIALIZER(node_control, name, namelen, mode)   { IMFS_NODE_INITIALIZER( node_control, name, namelen, mode ), NULL }
 Initializer for a generic node. More...
 
#define IMFS_assert(_x)
 
#define IMFS_STAT_FMT_HARD_LINK   0
 

Typedefs

typedef struct IMFS_jnode_tt IMFS_jnode_t
 
typedef uint8_t * block_p
 
typedef block_p * block_ptr
 
typedef IMFS_jnode_t *(* IMFS_node_control_initialize) (IMFS_jnode_t *node, void *arg)
 Initializes an IMFS node. More...
 
typedef IMFS_jnode_t *(* IMFS_node_control_remove) (IMFS_jnode_t *node)
 Prepares the removal of an IMFS node from its parent directory. More...
 
typedef void(* IMFS_node_control_destroy) (IMFS_jnode_t *node)
 Destroys an IMFS node. More...
 

Functions

IMFS_jnode_tIMFS_node_initialize_default (IMFS_jnode_t *node, void *arg)
 Returns the node and does nothing else. More...
 
IMFS_jnode_tIMFS_node_initialize_directory (IMFS_jnode_t *node, void *arg)
 
IMFS_jnode_tIMFS_node_initialize_generic (IMFS_jnode_t *node, void *arg)
 Returns the node and sets the generic node context. More...
 
IMFS_jnode_tIMFS_node_remove_default (IMFS_jnode_t *node)
 Returns the node and does nothing else. More...
 
IMFS_jnode_tIMFS_node_remove_directory (IMFS_jnode_t *node)
 
void IMFS_node_destroy_default (IMFS_jnode_t *node)
 Frees the node. More...
 
void IMFS_do_nothing_destroy (IMFS_jnode_t *node)
 Does nothing. More...
 
int IMFS_initialize (rtems_filesystem_mount_table_entry_t *mt_entry, const void *data)
 
int IMFS_initialize_support (rtems_filesystem_mount_table_entry_t *mt_entry, const void *data)
 
void IMFS_fsunmount (rtems_filesystem_mount_table_entry_t *mt_entry)
 Unmount this instance of IMFS.
 
int rtems_tarfs_load (const char *mountpoint, uint8_t *tar_image, size_t tar_size)
 RTEMS load tarfs. More...
 
void IMFS_node_destroy (IMFS_jnode_t *node)
 Destroy an IMFS node.
 
int IMFS_node_clone (rtems_filesystem_location_info_t *loc)
 Clone an IMFS node.
 
void IMFS_node_free (const rtems_filesystem_location_info_t *loc)
 Free an IMFS node.
 
int IMFS_stat (const rtems_filesystem_location_info_t *loc, struct stat *buf)
 Perform a status processing for the IMFS. More...
 
int IMFS_stat_file (const rtems_filesystem_location_info_t *loc, struct stat *buf)
 
void IMFS_eval_path (rtems_filesystem_eval_path_context_t *ctx)
 IMFS evaluation node support.
 
void IMFS_eval_path_devfs (rtems_filesystem_eval_path_context_t *ctx)
 IMFS device filesystem evaluation node support.
 
int IMFS_link (const rtems_filesystem_location_info_t *parentloc, const rtems_filesystem_location_info_t *targetloc, const char *name, size_t namelen)
 Create a new IMFS link node. More...
 
int IMFS_chown (const rtems_filesystem_location_info_t *loc, uid_t owner, gid_t group)
 Change the owner of IMFS. More...
 
int IMFS_mknod (const rtems_filesystem_location_info_t *parentloc, const char *name, size_t namelen, mode_t mode, dev_t dev)
 Create an IMFS node. More...
 
IMFS_jnode_tIMFS_initialize_node (IMFS_jnode_t *node, const IMFS_node_control *node_control, const char *name, size_t namelen, mode_t mode, void *arg)
 
IMFS_jnode_tIMFS_create_node (const rtems_filesystem_location_info_t *parentloc, const IMFS_node_control *node_control, size_t node_size, const char *name, size_t namelen, mode_t mode, void *arg)
 Create an IMFS node. More...
 
int IMFS_add_node (const char *path, IMFS_jnode_t *node, void *arg)
 Adds an IMFS node. More...
 
int IMFS_make_node (const char *path, mode_t mode, const IMFS_node_control *node_control, size_t node_size, void *context)
 
int IMFS_make_linearfile (const char *path, mode_t mode, const void *data, size_t size)
 Makes a linear IMFS file. More...
 
int IMFS_make_generic_node (const char *path, mode_t mode, const IMFS_node_control *node_control, void *context)
 Makes a generic IMFS node. More...
 
int IMFS_mount (rtems_filesystem_mount_table_entry_t *mt_entry)
 Mount an IMFS.
 
int IMFS_unmount (rtems_filesystem_mount_table_entry_t *mt_entry)
 Unmount an IMFS.
 
int IMFS_utime (const rtems_filesystem_location_info_t *loc, time_t actime, time_t modtime)
 Set IMFS file access and modification times. More...
 
int IMFS_fchmod (const rtems_filesystem_location_info_t *loc, mode_t mode)
 Change the IMFS file mode.
 
int IMFS_symlink (const rtems_filesystem_location_info_t *parentloc, const char *name, size_t namelen, const char *target)
 Create a new IMFS symbolic link node. More...
 
ssize_t IMFS_readlink (const rtems_filesystem_location_info_t *loc, char *buf, size_t bufsize)
 Put IMFS symbolic link into buffer. More...
 
int IMFS_rename (const rtems_filesystem_location_info_t *oldparentloc, const rtems_filesystem_location_info_t *oldloc, const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen)
 Rename the IMFS. More...
 
int IMFS_rmnod (const rtems_filesystem_location_info_t *parentloc, const rtems_filesystem_location_info_t *loc)
 IMFS node removal handler. More...
 
IMFS Memory File Handlers

This section contains the set of handlers used to process operations on IMFS memory file nodes. The memory files are created in memory using malloc'ed memory. Thus any data stored in one of these files is lost at system shutdown unless special arrangements to copy the data to some type of non-volailte storage are made by the application.

ssize_t IMFS_memfile_write (IMFS_memfile_t *memfile, off_t start, const unsigned char *source, unsigned int length)
 
IMFS Device Node Handlers

This section contains the set of handlers used to map operations on IMFS device nodes onto calls to the RTEMS Classic API IO Manager.

int device_open (rtems_libio_t *iop, const char *pathname, int oflag, mode_t mode)
 
int device_close (rtems_libio_t *iop)
 
ssize_t device_read (rtems_libio_t *iop, void *buffer, size_t count)
 
ssize_t device_write (rtems_libio_t *iop, const void *buffer, size_t count)
 
int device_ioctl (rtems_libio_t *iop, ioctl_command_t command, void *buffer)
 
int device_ftruncate (rtems_libio_t *iop, off_t length)
 

Variables

const int imfs_memfile_bytes_per_block
 
const IMFS_mknod_control IMFS_mknod_control_dir_default
 
const IMFS_mknod_control IMFS_mknod_control_dir_minimal
 
const IMFS_mknod_control IMFS_mknod_control_device
 
const IMFS_mknod_control IMFS_mknod_control_memfile
 
const IMFS_node_control IMFS_node_control_linfile
 
const IMFS_mknod_control IMFS_mknod_control_fifo
 
const IMFS_mknod_control IMFS_mknod_control_enosys
 
const rtems_filesystem_limits_and_options_t IMFS_LIMITS_AND_OPTIONS
 

Detailed Description

Header File for the In-Memory File System.