[rtems commit] Filesystem: Change pathconf_limits_and_options

Sebastian Huber sebh at rtems.org
Tue May 15 08:33:52 UTC 2012


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue May 15 10:27:46 2012 +0200

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 0e74c4c..b59ec0f 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 b0e0dc7..a48c5d3 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 4563bdb..84283bc 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 f005774..26152d8 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 372f078..bff5d6d 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 8c5f4db..3fd0ffa 100644
--- a/cpukit/libnetworking/lib/ftpfs.c
+++ b/cpukit/libnetworking/lib/ftpfs.c
@@ -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;
 }
 




More information about the vc mailing list