From 0a95800a58036ad75aa2b972036d458906ac447c Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 15 May 2012 10:27:46 +0200 Subject: 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. --- cpukit/libcsupport/include/rtems/libio.h | 2 +- cpukit/libcsupport/src/fpathconf.c | 4 ++-- cpukit/libcsupport/src/mount.c | 2 +- cpukit/libfs/src/imfs/imfs_initsupp.c | 2 +- cpukit/libfs/src/nfsclient/src/nfs.c | 4 ++-- cpukit/libnetworking/lib/ftpfs.c | 4 ---- 6 files changed, 7 insertions(+), 11 deletions(-) diff --git a/cpukit/libcsupport/include/rtems/libio.h b/cpukit/libcsupport/include/rtems/libio.h index 0e74c4c7fe..b59ec0fb54 100644 --- a/cpukit/libcsupport/include/rtems/libio.h +++ b/cpukit/libcsupport/include/rtems/libio.h @@ -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. diff --git a/cpukit/libcsupport/src/fpathconf.c b/cpukit/libcsupport/src/fpathconf.c index b0e0dc7a75..a48c5d35fc 100644 --- a/cpukit/libcsupport/src/fpathconf.c +++ b/cpukit/libcsupport/src/fpathconf.c @@ -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: diff --git a/cpukit/libcsupport/src/mount.c b/cpukit/libcsupport/src/mount.c index 4563bdbf24..84283bc8e6 100644 --- a/cpukit/libcsupport/src/mount.c +++ b/cpukit/libcsupport/src/mount.c @@ -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; diff --git a/cpukit/libfs/src/imfs/imfs_initsupp.c b/cpukit/libfs/src/imfs/imfs_initsupp.c index f005774e1d..26152d8d3d 100644 --- a/cpukit/libfs/src/imfs/imfs_initsupp.c +++ b/cpukit/libfs/src/imfs/imfs_initsupp.c @@ -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 { diff --git a/cpukit/libfs/src/nfsclient/src/nfs.c b/cpukit/libfs/src/nfsclient/src/nfs.c index 372f078f14..bff5d6da16 100644 --- a/cpukit/libfs/src/nfsclient/src/nfs.c +++ b/cpukit/libfs/src/nfsclient/src/nfs.c @@ -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++; diff --git a/cpukit/libnetworking/lib/ftpfs.c b/cpukit/libnetworking/lib/ftpfs.c index 8c5f4db091..3fd0ffa6e4 100644 --- a/cpukit/libnetworking/lib/ftpfs.c +++ b/cpukit/libnetworking/lib/ftpfs.c @@ -51,7 +51,6 @@ #include #include -#include #include #include #include @@ -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; } -- cgit v1.2.3