Changeset cf36b70 in rtems for cpukit/libblock


Ignore:
Timestamp:
Dec 31, 2014, 9:56:05 AM (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
29fa241
Parents:
369328f0
git-author:
Sebastian Huber <sebastian.huber@…> (12/31/14 09:56:05)
git-committer:
Sebastian Huber <sebastian.huber@…> (01/27/15 05:54:22)
Message:

IMFS: Replace node union with individual struct

This reduces the average node size.

Add and use IMFS_GENERIC_INITIALIZER().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libblock/src/blkdev-imfs.c

    r369328f0 rcf36b70  
    230230static IMFS_jnode_t *rtems_blkdev_imfs_initialize(
    231231  IMFS_jnode_t *node,
    232   const IMFS_types_union *info
     232  void *arg
    233233)
    234234{
     
    236236  rtems_disk_device *dd;
    237237
    238   node = IMFS_node_initialize_generic(node, info);
     238  node = IMFS_node_initialize_generic(node, arg);
    239239
    240240  ctx = IMFS_generic_get_context_by_node(node);
     
    245245}
    246246
    247 static IMFS_jnode_t *rtems_blkdev_imfs_destroy(IMFS_jnode_t *node)
     247static void rtems_blkdev_imfs_destroy(IMFS_jnode_t *node)
    248248{
    249249  rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_node(node);
     
    261261  free(ctx);
    262262
    263   return node;
    264 }
    265 
    266 static const IMFS_node_control rtems_blkdev_imfs_control = {
    267   .imfs_type = IMFS_GENERIC,
    268   .handlers = &rtems_blkdev_imfs_node,
    269   .node_initialize = rtems_blkdev_imfs_initialize,
    270   .node_remove = IMFS_node_remove_default,
    271   .node_destroy = rtems_blkdev_imfs_destroy
    272 };
     263  IMFS_node_destroy_default(node);
     264}
     265
     266static const IMFS_node_control rtems_blkdev_imfs_control =
     267  IMFS_GENERIC_INITIALIZER(
     268    &rtems_blkdev_imfs_node,
     269    rtems_blkdev_imfs_initialize,
     270    rtems_blkdev_imfs_destroy
     271  );
    273272
    274273rtems_status_code rtems_blkdev_create(
Note: See TracChangeset for help on using the changeset viewer.