Changeset c5392ef9 in rtems


Ignore:
Timestamp:
Mar 1, 2012, 10:51:34 AM (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
04ca77e
Parents:
699ac7c
git-author:
Sebastian Huber <sebastian.huber@…> (03/01/12 10:51:34)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/13/12 11:24:16)
Message:

IMFS: Add make generic node support

Generic nodes are an alternative to standard drivers in RTEMS. The
handlers of a generic node are called with less overhead compared to the
standard driver operations. The usage of file system node handlers
enable more features like support for fsync() and fdatasync(). The
generic nodes use the reference counting of the IMFS. This provides
automatic node destruction when the last reference vanishes.

Extend type IMFS_types_union by new type IMFS_generic_t.

Extend enum IMFS_jnode_types_t by IMFS_GENERIC.

Add functions

o IMFS_make_generic_node(),
o IMFS_is_imfs_instance(),
o IMFS_generic_get_context_by_node(),
o IMFS_generic_get_context_by_location(), and
o IMFS_generic_get_context_by_iop().

New test fstests/fsimfsgeneric01.

Files:
5 added
4 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libfs/Makefile.am

    r699ac7c rc5392ef9  
    4646    src/imfs/imfs_eval.c src/imfs/imfs_fchmod.c \
    4747    src/imfs/imfs_fifo.c \
     48    src/imfs/imfs_make_generic_node.c \
    4849    src/imfs/imfs_fsunmount.c \
    4950    src/imfs/imfs_handlers_device.c \
  • cpukit/libfs/src/imfs/imfs.h

    r699ac7c rc5392ef9  
    5656  pipe_control_t  *pipe;
    5757} IMFS_fifo_t;
     58
     59typedef struct {
     60  void *context;
     61} IMFS_generic_t;
    5862
    5963/*
     
    134138  IMFS_LINEAR_FILE,
    135139  IMFS_FIFO,
     140  IMFS_GENERIC,
    136141  IMFS_INVALID_NODE
    137142} IMFS_jnode_types_t;
    138143
     144/* The IMFS_GENERIC does not count */
    139145#define IMFS_TYPE_COUNT (IMFS_FIFO + 1)
    140146
     
    147153  IMFS_linearfile_t  linearfile;
    148154  IMFS_fifo_t        fifo;
     155  IMFS_generic_t     generic;
    149156} IMFS_types_union;
    150157
     
    155162
    156163IMFS_jnode_t *IMFS_node_initialize_default(
     164  IMFS_jnode_t *node,
     165  const IMFS_types_union *info
     166);
     167
     168IMFS_jnode_t *IMFS_node_initialize_generic(
    157169  IMFS_jnode_t *node,
    158170  const IMFS_types_union *info
     
    371383);
    372384
     385extern bool IMFS_is_imfs_instance(
     386  const rtems_filesystem_location_info_t *loc
     387);
     388
     389extern int IMFS_make_generic_node(
     390  const char *path,
     391  mode_t mode,
     392  const IMFS_node_control *node_control,
     393  void *context
     394);
     395
    373396extern int IMFS_mount(
    374397  rtems_filesystem_mount_table_entry_t *mt_entry  /* IN */
     
    574597}
    575598
     599static inline void *IMFS_generic_get_context_by_node(
     600  const IMFS_jnode_t *node
     601)
     602{
     603  return node->info.generic.context;
     604}
     605
     606static inline void *IMFS_generic_get_context_by_location(
     607  const rtems_filesystem_location_info_t *loc
     608)
     609{
     610  const IMFS_jnode_t *node = (const IMFS_jnode_t *) loc->node_access;
     611
     612  return IMFS_generic_get_context_by_node( node );
     613}
     614
     615static inline void *IMFS_generic_get_context_by_iop(
     616  const rtems_libio_t *iop
     617)
     618{
     619  return IMFS_generic_get_context_by_location( &iop->pathinfo );
     620}
     621
    576622#ifdef __cplusplus
    577623}
  • testsuites/fstests/Makefile.am

    r699ac7c rc5392ef9  
    3232SUBDIRS += mrfs_fstime
    3333SUBDIRS += fsnofs01
     34SUBDIRS += fsimfsgeneric01
    3435
    3536EXTRA_DIST =
  • testsuites/fstests/configure.ac

    r699ac7c rc5392ef9  
    106106mrfs_fstime/Makefile
    107107fsnofs01/Makefile
     108fsimfsgeneric01/Makefile
    108109
    109110])
Note: See TracChangeset for help on using the changeset viewer.