RTEMS 6.1-rc5
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Functions | Variables
imfs.h File Reference

This header file defines the API of the In-Memory File System. More...

#include <sys/time.h>
#include <limits.h>
#include <rtems/libio_.h>
#include <rtems/pipe.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.
 
#define IMFS_NODE_INITIALIZER(node_control, name, namelen, mode)
 Initializer for an IMFS node.
 
#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.
 
#define IMFS_GENERIC_NODE_INITIALIZER(node_control, name, namelen, mode)    { IMFS_NODE_INITIALIZER( node_control, name, namelen, mode ), NULL }
 Initializer for a generic node.
 
#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.
 
typedef IMFS_jnode_t *(* IMFS_node_control_remove) (IMFS_jnode_t *node)
 Prepares the removal of an IMFS node from its parent directory.
 
typedef void(* IMFS_node_control_destroy) (IMFS_jnode_t *node)
 Destroys an IMFS node.
 

Functions

IMFS_jnode_tIMFS_node_initialize_default (IMFS_jnode_t *node, void *arg)
 Returns the node and does nothing else.
 
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.
 
IMFS_jnode_tIMFS_node_remove_default (IMFS_jnode_t *node)
 Returns the node and does nothing else.
 
IMFS_jnode_tIMFS_node_remove_directory (IMFS_jnode_t *node)
 
void IMFS_node_destroy_default (IMFS_jnode_t *node)
 Frees the node.
 
void IMFS_do_nothing_destroy (IMFS_jnode_t *node)
 Does nothing.
 
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, const void *tar_image, size_t tar_size)
 RTEMS load tarfs.
 
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.
 
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.
 
int IMFS_chown (const rtems_filesystem_location_info_t *loc, uid_t owner, gid_t group)
 Change the owner of IMFS.
 
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.
 
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.
 
int IMFS_add_node (const char *path, IMFS_jnode_t *node, void *arg)
 Adds an IMFS node.
 
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.
 
int IMFS_make_generic_node (const char *path, mode_t mode, const IMFS_node_control *node_control, void *context)
 Makes a generic IMFS node.
 
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_utimens (const rtems_filesystem_location_info_t *loc, struct timespec times[2])
 Set IMFS file access and modification times.
 
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.
 
ssize_t IMFS_readlink (const rtems_filesystem_location_info_t *loc, char *buf, size_t bufsize)
 Put IMFS symbolic link into buffer.
 
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.
 
int IMFS_rmnod (const rtems_filesystem_location_info_t *parentloc, const rtems_filesystem_location_info_t *loc)
 IMFS node removal handler.
 
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

This header file defines the API of the In-Memory File System.