diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-05-14 16:55:41 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-05-15 10:01:43 +0200 |
commit | da154e14f69e909a71ab0479c02dd56158f66ee0 (patch) | |
tree | 942675feba74c0ec16d60566fa32458c305daa2e /cpukit/libcsupport/include | |
parent | Filesystem: Add const qualifier to lock/unlock (diff) | |
download | rtems-da154e14f69e909a71ab0479c02dd56158f66ee0.tar.bz2 |
Filesystem: Move operations to mount table entry
The scope of the file system operations is the file system instance.
The scope of the file system node handlers is the file location. The
benefit of moving the operations to the mount table entry is a size
reduction of the file location (rtems_filesystem_location_info_t). The
code size is slightly increased due to additional load instructions.
Restructure rtems_filesystem_mount_table_entry_t to improve cache
efficiency.
Diffstat (limited to 'cpukit/libcsupport/include')
-rw-r--r-- | cpukit/libcsupport/include/rtems/libio.h | 5 | ||||
-rw-r--r-- | cpukit/libcsupport/include/rtems/libio_.h | 14 |
2 files changed, 13 insertions, 6 deletions
diff --git a/cpukit/libcsupport/include/rtems/libio.h b/cpukit/libcsupport/include/rtems/libio.h index 44dd847ebb..0e74c4c7fe 100644 --- a/cpukit/libcsupport/include/rtems/libio.h +++ b/cpukit/libcsupport/include/rtems/libio.h @@ -1431,13 +1431,14 @@ extern int rtems_mkdir(const char *path, mode_t mode); */ struct rtems_filesystem_mount_table_entry_tt { rtems_chain_node mt_node; + void *fs_info; + const rtems_filesystem_operations_table *ops; + const void *immutable_fs_info; rtems_chain_control location_chain; rtems_filesystem_global_location_t *mt_point_node; rtems_filesystem_global_location_t *mt_fs_root; bool mounted; bool writeable; - void *fs_info; - const void *immutable_fs_info; rtems_filesystem_limits_and_options_t pathconf_limits_and_options; /* diff --git a/cpukit/libcsupport/include/rtems/libio_.h b/cpukit/libcsupport/include/rtems/libio_.h index 3e2139f450..418f4a31ec 100644 --- a/cpukit/libcsupport/include/rtems/libio_.h +++ b/cpukit/libcsupport/include/rtems/libio_.h @@ -250,14 +250,18 @@ static inline void rtems_filesystem_instance_lock( const rtems_filesystem_location_info_t *loc ) { - (*loc->ops->lock_h)( loc->mt_entry ); + const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; + + (*mt_entry->ops->lock_h)( mt_entry ); } static inline void rtems_filesystem_instance_unlock( const rtems_filesystem_location_info_t *loc ) { - (*loc->ops->unlock_h)( loc->mt_entry ); + const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; + + (*mt_entry->ops->unlock_h)( mt_entry ); } /* @@ -582,9 +586,11 @@ static inline bool rtems_filesystem_location_is_root( const rtems_filesystem_location_info_t *loc ) { - return (*loc->ops->are_nodes_equal_h)( + const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; + + return (*mt_entry->ops->are_nodes_equal_h)( loc, - &loc->mt_entry->mt_fs_root->location + &mt_entry->mt_fs_root->location ); } |