[rtems commit] statvfs and ALL filesystem handlers: Add restrict keyword.

Joel Sherrill joel at rtems.org
Thu Nov 21 22:50:36 UTC 2013


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

Author:    Daniel Ramirez <javamonn at gmail.com>
Date:      Thu Nov 21 16:54:21 2013 -0600

statvfs and ALL filesystem handlers: Add restrict keyword.

---

 cpukit/libcsupport/include/rtems/libio.h    |    8 ++++----
 cpukit/libcsupport/include/sys/statvfs.h    |    2 +-
 cpukit/libcsupport/src/__usrenv.c           |    4 ++--
 cpukit/libcsupport/src/statvfs.c            |    2 +-
 cpukit/libfs/src/defaults/default_statvfs.c |    4 ++--
 cpukit/libfs/src/dosfs/msdos.h              |   13 +++++++------
 cpukit/libfs/src/dosfs/msdos_dir.c          |    4 ++--
 cpukit/libfs/src/dosfs/msdos_file.c         |    4 ++--
 cpukit/libfs/src/dosfs/msdos_statvfs.c      |    5 +++--
 cpukit/libfs/src/jffs2/src/fs-rtems.c       |    4 ++--
 cpukit/libfs/src/rfs/rtems-rfs-rtems.c      |    5 +++--
 11 files changed, 29 insertions(+), 26 deletions(-)

diff --git a/cpukit/libcsupport/include/rtems/libio.h b/cpukit/libcsupport/include/rtems/libio.h
index 21d57eb..c1b7b73 100644
--- a/cpukit/libcsupport/include/rtems/libio.h
+++ b/cpukit/libcsupport/include/rtems/libio.h
@@ -485,8 +485,8 @@ typedef int (*rtems_filesystem_rename_t)(
  * @see rtems_filesystem_default_statvfs().
  */
 typedef int (*rtems_filesystem_statvfs_t)(
-  const rtems_filesystem_location_info_t *loc,
-  struct statvfs *buf
+  const rtems_filesystem_location_info_t *__restrict loc,
+  struct statvfs *__restrict buf
 );
 
 /**
@@ -738,8 +738,8 @@ int rtems_filesystem_default_rename(
  * @see rtems_filesystem_statvfs_t.
  */
 int rtems_filesystem_default_statvfs(
-  const rtems_filesystem_location_info_t *loc,
-  struct statvfs *buf
+  const rtems_filesystem_location_info_t *__restrict loc,
+  struct statvfs *__restrict buf
 );
 
 /** @} */
diff --git a/cpukit/libcsupport/include/sys/statvfs.h b/cpukit/libcsupport/include/sys/statvfs.h
index eccc7d2..01f827e 100644
--- a/cpukit/libcsupport/include/sys/statvfs.h
+++ b/cpukit/libcsupport/include/sys/statvfs.h
@@ -50,7 +50,7 @@ struct statvfs
   unsigned long f_namemax; /**< Maximum filename length. */
 };
 
-extern int statvfs(const char *, struct statvfs *);
+extern int statvfs(const char *__restrict , struct statvfs *__restrict);
 extern int fstatvfs(int, struct statvfs *);
 
 #ifdef __cplusplus
diff --git a/cpukit/libcsupport/src/__usrenv.c b/cpukit/libcsupport/src/__usrenv.c
index 8e9e8c1..88058c4 100644
--- a/cpukit/libcsupport/src/__usrenv.c
+++ b/cpukit/libcsupport/src/__usrenv.c
@@ -186,8 +186,8 @@ static int null_op_rename(
 }
 
 static int null_op_statvfs(
-  const rtems_filesystem_location_info_t *loc,
-  struct statvfs *buf
+  const rtems_filesystem_location_info_t *__restrict loc,
+  struct statvfs *__restrict buf
 )
 {
   return -1;
diff --git a/cpukit/libcsupport/src/statvfs.c b/cpukit/libcsupport/src/statvfs.c
index 163d51e..dfca09f 100644
--- a/cpukit/libcsupport/src/statvfs.c
+++ b/cpukit/libcsupport/src/statvfs.c
@@ -19,7 +19,7 @@
 
 #include <rtems/libio_.h>
 
-int statvfs( const char *path, struct statvfs *buf )
+int statvfs( const char *__restrict path, struct statvfs *__restrict buf )
 {
   int rv = 0;
   rtems_filesystem_eval_path_context_t ctx;
diff --git a/cpukit/libfs/src/defaults/default_statvfs.c b/cpukit/libfs/src/defaults/default_statvfs.c
index 139d0b0..41ac1c0 100644
--- a/cpukit/libfs/src/defaults/default_statvfs.c
+++ b/cpukit/libfs/src/defaults/default_statvfs.c
@@ -21,8 +21,8 @@
 #include <rtems/seterr.h>
 
 int rtems_filesystem_default_statvfs(
-  const rtems_filesystem_location_info_t *loc,
-  struct statvfs *buf
+  const rtems_filesystem_location_info_t *__restrict loc,
+  struct statvfs *__restrict buf
 )
 {
   rtems_set_errno_and_return_minus_one( ENOSYS );
diff --git a/cpukit/libfs/src/dosfs/msdos.h b/cpukit/libfs/src/dosfs/msdos.h
index 6da47cc..2fa3b58 100644
--- a/cpukit/libfs/src/dosfs/msdos.h
+++ b/cpukit/libfs/src/dosfs/msdos.h
@@ -312,8 +312,9 @@ int msdos_rename(
   size_t new_namelen
 );
 
-int msdos_statvfs(const rtems_filesystem_location_info_t *root_loc,
-  struct statvfs *sb);
+int msdos_statvfs(
+  const rtems_filesystem_location_info_t *__restrict root_loc,
+  struct statvfs *__restrict sb);
 
 void msdos_lock(const rtems_filesystem_mount_table_entry_t *mt_entry);
 
@@ -347,8 +348,8 @@ ssize_t msdos_file_write(
 );
 
 int msdos_file_stat(
-  const rtems_filesystem_location_info_t *loc,
-  struct stat *buf
+  const rtems_filesystem_location_info_t *__restrict loc,
+  struct stat *__restrict buf
 );
 
 int
@@ -370,8 +371,8 @@ ssize_t msdos_dir_read(
 int msdos_dir_sync(rtems_libio_t *iop);
 
 int msdos_dir_stat(
-  const rtems_filesystem_location_info_t *loc,
-  struct stat *buf
+  const rtems_filesystem_location_info_t *__restrict loc,
+  struct stat *__restrict buf
 );
 
 /**
diff --git a/cpukit/libfs/src/dosfs/msdos_dir.c b/cpukit/libfs/src/dosfs/msdos_dir.c
index d7f6823..ffc9f7f 100644
--- a/cpukit/libfs/src/dosfs/msdos_dir.c
+++ b/cpukit/libfs/src/dosfs/msdos_dir.c
@@ -383,8 +383,8 @@ msdos_dir_read(rtems_libio_t *iop, void *buffer, size_t count)
  */
 int
 msdos_dir_stat(
-    const rtems_filesystem_location_info_t *loc,
-    struct stat *buf
+    const rtems_filesystem_location_info_t *__restrict loc,
+    struct stat *__restrict buf
 )
 {
     rtems_status_code  sc = RTEMS_SUCCESSFUL;
diff --git a/cpukit/libfs/src/dosfs/msdos_file.c b/cpukit/libfs/src/dosfs/msdos_file.c
index b19b848..03bf6d6 100644
--- a/cpukit/libfs/src/dosfs/msdos_file.c
+++ b/cpukit/libfs/src/dosfs/msdos_file.c
@@ -189,8 +189,8 @@ msdos_file_write(rtems_libio_t *iop,const void *buffer, size_t count)
  */
 int
 msdos_file_stat(
-    const rtems_filesystem_location_info_t *loc,
-    struct stat *buf
+    const rtems_filesystem_location_info_t *__restrict loc,
+    struct stat *__restrict buf
 )
 {
     rtems_status_code  sc = RTEMS_SUCCESSFUL;
diff --git a/cpukit/libfs/src/dosfs/msdos_statvfs.c b/cpukit/libfs/src/dosfs/msdos_statvfs.c
index 1a1d974..87d863e 100644
--- a/cpukit/libfs/src/dosfs/msdos_statvfs.c
+++ b/cpukit/libfs/src/dosfs/msdos_statvfs.c
@@ -18,8 +18,9 @@
 #include "fat_fat_operations.h"
 #include "msdos.h"
 
-int msdos_statvfs(const rtems_filesystem_location_info_t *root_loc,
-    struct statvfs *sb)
+int msdos_statvfs(
+  const rtems_filesystem_location_info_t *__restrict root_loc,
+  struct statvfs *__restrict sb)
 {
   msdos_fs_info_t *fs_info = root_loc->mt_entry->fs_info;
   fat_vol_t *vol = &fs_info->fat.vol;
diff --git a/cpukit/libfs/src/jffs2/src/fs-rtems.c b/cpukit/libfs/src/jffs2/src/fs-rtems.c
index 376c77f..1b7d719 100644
--- a/cpukit/libfs/src/jffs2/src/fs-rtems.c
+++ b/cpukit/libfs/src/jffs2/src/fs-rtems.c
@@ -1015,8 +1015,8 @@ static int rtems_jffs2_rename(
 }
 
 static int rtems_jffs2_statvfs(
-	const rtems_filesystem_location_info_t *loc,
-	struct statvfs *buf
+	const rtems_filesystem_location_info_t *__restrict loc,
+	struct statvfs *__restrict buf
 )
 {
 	struct _inode *inode = rtems_jffs2_get_inode_by_location(loc);
diff --git a/cpukit/libfs/src/rfs/rtems-rfs-rtems.c b/cpukit/libfs/src/rfs/rtems-rfs-rtems.c
index 100f70c..5f30cf7 100644
--- a/cpukit/libfs/src/rfs/rtems-rfs-rtems.c
+++ b/cpukit/libfs/src/rfs/rtems-rfs-rtems.c
@@ -740,8 +740,9 @@ rtems_rfs_rtems_rename(const rtems_filesystem_location_info_t* old_parent_loc,
  * @return int
  */
 static int
-rtems_rfs_rtems_statvfs (const rtems_filesystem_location_info_t* pathloc,
-                         struct statvfs*                         sb)
+rtems_rfs_rtems_statvfs (
+  const rtems_filesystem_location_info_t *__restrict pathloc,
+  struct statvfs *__restrict                         sb)
 {
   rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
   size_t                 blocks;




More information about the vc mailing list