Filesystem: Change pathconf_limits_and_options

The pathconf_limits_and_options field of
rtems_filesystem_mount_table_entry_t is now a const pointer to reduce
the read-write memory demands of file system instances.
This commit is contained in:
Sebastian Huber
2012-05-15 10:27:46 +02:00
parent da154e14f6
commit 0a95800a58
6 changed files with 7 additions and 11 deletions

View File

@@ -1439,7 +1439,7 @@ struct rtems_filesystem_mount_table_entry_tt {
rtems_filesystem_global_location_t *mt_fs_root;
bool mounted;
bool writeable;
rtems_filesystem_limits_and_options_t pathconf_limits_and_options;
const rtems_filesystem_limits_and_options_t *pathconf_limits_and_options;
/*
* The target or mount point of the file system.

View File

@@ -26,7 +26,7 @@ long fpathconf(
{
long return_value;
rtems_libio_t *iop;
rtems_filesystem_limits_and_options_t *the_limits;
const rtems_filesystem_limits_and_options_t *the_limits;
rtems_libio_check_fd(fd);
iop = rtems_libio_iop(fd);
@@ -36,7 +36,7 @@ long fpathconf(
* Now process the information request.
*/
the_limits = &iop->pathinfo.mt_entry->pathconf_limits_and_options;
the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options;
switch ( name ) {
case _PC_LINK_MAX:

View File

@@ -83,7 +83,7 @@ static rtems_filesystem_mount_table_entry_t *alloc_mount_table_entry(
mt_entry->mounted = true;
mt_entry->mt_fs_root = mt_fs_root;
mt_entry->pathconf_limits_and_options = rtems_filesystem_default_pathconf;
mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf;
mt_fs_root->location.mt_entry = mt_entry;
mt_fs_root->reference_count = 1;

View File

@@ -80,7 +80,7 @@ int IMFS_initialize_support(
if ( root_node != NULL ) {
mt_entry->fs_info = fs_info;
mt_entry->ops = op_table;
mt_entry->pathconf_limits_and_options = IMFS_LIMITS_AND_OPTIONS;
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 );
} else {

View File

@@ -622,7 +622,7 @@ rtems_filesystem_resolve_location(char *buf, int len, rtems_filesystem_location_
/* These are (except for MAXNAMLEN/MAXPATHLEN) copied from IMFS */
static rtems_filesystem_limits_and_options_t
static const rtems_filesystem_limits_and_options_t
nfs_limits_and_options = {
5, /* link_max */
6, /* max_canon */
@@ -1755,7 +1755,7 @@ char *path = mt_entry->dev;
mt_entry->ops = &nfs_fs_ops;
mt_entry->mt_fs_root->location.handlers = &nfs_dir_file_handlers;
mt_entry->pathconf_limits_and_options = nfs_limits_and_options;
mt_entry->pathconf_limits_and_options = &nfs_limits_and_options;
LOCK(nfsGlob.llock);
nfsGlob.num_mounted_fs++;

View File

@@ -51,7 +51,6 @@
#include <rtems.h>
#include <rtems/ftpfs.h>
#include <rtems/imfs.h>
#include <rtems/libio_.h>
#include <rtems/rtems_bsdnet.h>
#include <rtems/seterr.h>
@@ -1199,9 +1198,6 @@ int rtems_ftpfs_initialize(
/* We maintain no real file system nodes, so there is no real root */
e->mt_fs_root->location.node_access = NULL;
/* Just use the limits from IMFS */
e->pathconf_limits_and_options = IMFS_LIMITS_AND_OPTIONS;
return 0;
}