[rtems commit] imfs: Simplify code generation

Sebastian Huber sebh at rtems.org
Mon Mar 9 17:59:54 UTC 2020


Module:    rtems
Branch:    master
Commit:    103a371faa61eb938bf39bc38e1ac2b30cb18bd3
Changeset: http://git.rtems.org/rtems/commit/?id=103a371faa61eb938bf39bc38e1ac2b30cb18bd3

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Mar  5 21:56:31 2020 +0100

imfs: Simplify code generation

Update #3894.

---

 cpukit/libfs/src/imfs/imfs_initsupp.c | 28 +++++++++++++++++-----------
 1 file changed, 17 insertions(+), 11 deletions(-)

diff --git a/cpukit/libfs/src/imfs/imfs_initsupp.c b/cpukit/libfs/src/imfs/imfs_initsupp.c
index 211e929..b669964 100644
--- a/cpukit/libfs/src/imfs/imfs_initsupp.c
+++ b/cpukit/libfs/src/imfs/imfs_initsupp.c
@@ -27,15 +27,27 @@ int IMFS_initialize_support(
   const void                           *data
 )
 {
-  const IMFS_mount_data *mount_data = data;
-  IMFS_fs_info_t *fs_info = mount_data->fs_info;
-  IMFS_jnode_t *root_node;
+  const IMFS_mount_data   *mount_data;
+  IMFS_fs_info_t          *fs_info;
+  const IMFS_node_control *node_control;
+  IMFS_jnode_t            *root_node;
 
+  mount_data = data;
+
+  fs_info = mount_data->fs_info;
   fs_info->mknod_controls = mount_data->mknod_controls;
+  node_control = &mount_data->mknod_controls->directory->node_control;
+  root_node = &fs_info->Root_directory.Node;
+
+  mt_entry->fs_info = fs_info;
+  mt_entry->ops = mount_data->ops;
+  mt_entry->pathconf_limits_and_options = &IMFS_LIMITS_AND_OPTIONS;
+  mt_entry->mt_fs_root->location.node_access = root_node;
+  mt_entry->mt_fs_root->location.handlers = node_control->handlers;
 
   root_node = IMFS_initialize_node(
-    &fs_info->Root_directory.Node,
-    &fs_info->mknod_controls->directory->node_control,
+    root_node,
+    node_control,
     "",
     0,
     (S_IFDIR | 0755),
@@ -43,12 +55,6 @@ int IMFS_initialize_support(
   );
   IMFS_assert( root_node != NULL );
 
-  mt_entry->fs_info = fs_info;
-  mt_entry->ops = mount_data->ops;
-  mt_entry->pathconf_limits_and_options = &IMFS_LIMITS_AND_OPTIONS;
-  mt_entry->mt_fs_root->location.node_access = root_node;
-  IMFS_Set_handlers( &mt_entry->mt_fs_root->location );
-
   return 0;
 }
 



More information about the vc mailing list