[PATCH 3/3] Filesystem: Add const qualifier to lock/unlock

sebastian.huber at embedded-brains.de sebastian.huber at embedded-brains.de
Mon May 14 15:13:38 UTC 2012


From: Sebastian Huber <sebastian.huber at embedded-brains.de>

---
 cpukit/libcsupport/include/rtems/libio.h           |    8 ++++----
 cpukit/libcsupport/src/__usrenv.c                  |    2 +-
 .../libfs/src/defaults/default_lock_and_unlock.c   |    4 ++--
 cpukit/libfs/src/dosfs/msdos.h                     |    4 ++--
 cpukit/libfs/src/dosfs/msdos_init.c                |    4 ++--
 cpukit/libfs/src/nfsclient/src/nfs.c               |    4 ++--
 cpukit/libfs/src/rfs/rtems-rfs-rtems.c             |    8 ++++++--
 7 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/cpukit/libcsupport/include/rtems/libio.h b/cpukit/libcsupport/include/rtems/libio.h
index b42ff93..44dd847 100644
--- a/cpukit/libcsupport/include/rtems/libio.h
+++ b/cpukit/libcsupport/include/rtems/libio.h
@@ -69,7 +69,7 @@ typedef enum {
  * @see rtems_filesystem_default_lock().
  */
 typedef void (*rtems_filesystem_mt_entry_lock_t)(
-  rtems_filesystem_mount_table_entry_t *mt_entry
+  const rtems_filesystem_mount_table_entry_t *mt_entry
 );
 
 /**
@@ -80,7 +80,7 @@ typedef void (*rtems_filesystem_mt_entry_lock_t)(
  * @see rtems_filesystem_default_unlock().
  */
 typedef void (*rtems_filesystem_mt_entry_unlock_t)(
-  rtems_filesystem_mount_table_entry_t *mt_entry
+  const rtems_filesystem_mount_table_entry_t *mt_entry
 );
 
 /**
@@ -523,7 +523,7 @@ extern const rtems_filesystem_operations_table
  * @see rtems_filesystem_mt_entry_lock_t.
  */
 void rtems_filesystem_default_lock(
-  rtems_filesystem_mount_table_entry_t *mt_entry
+  const rtems_filesystem_mount_table_entry_t *mt_entry
 );
 
 /**
@@ -532,7 +532,7 @@ void rtems_filesystem_default_lock(
  * @see rtems_filesystem_mt_entry_unlock_t.
  */
 void rtems_filesystem_default_unlock(
-  rtems_filesystem_mount_table_entry_t *mt_entry
+  const rtems_filesystem_mount_table_entry_t *mt_entry
 );
 
 /**
diff --git a/cpukit/libcsupport/src/__usrenv.c b/cpukit/libcsupport/src/__usrenv.c
index 87ff25b..73d2b06 100644
--- a/cpukit/libcsupport/src/__usrenv.c
+++ b/cpukit/libcsupport/src/__usrenv.c
@@ -51,7 +51,7 @@ const rtems_filesystem_file_handlers_r rtems_filesystem_null_handlers = {
 };
 
 static void null_op_lock_or_unlock(
-  rtems_filesystem_mount_table_entry_t *mt_entry
+  const rtems_filesystem_mount_table_entry_t *mt_entry
 )
 {
   /* Do nothing */
diff --git a/cpukit/libfs/src/defaults/default_lock_and_unlock.c b/cpukit/libfs/src/defaults/default_lock_and_unlock.c
index de29a07..a88a99d 100644
--- a/cpukit/libfs/src/defaults/default_lock_and_unlock.c
+++ b/cpukit/libfs/src/defaults/default_lock_and_unlock.c
@@ -19,14 +19,14 @@
 #include <rtems/libio_.h>
 
 void rtems_filesystem_default_lock(
-  rtems_filesystem_mount_table_entry_t *mt_entry
+  const rtems_filesystem_mount_table_entry_t *mt_entry
 )
 {
   rtems_libio_lock();
 }
 
 void rtems_filesystem_default_unlock(
-  rtems_filesystem_mount_table_entry_t *mt_entry
+  const rtems_filesystem_mount_table_entry_t *mt_entry
 )
 {
   rtems_libio_unlock();
diff --git a/cpukit/libfs/src/dosfs/msdos.h b/cpukit/libfs/src/dosfs/msdos.h
index 25f25b5..f762656 100644
--- a/cpukit/libfs/src/dosfs/msdos.h
+++ b/cpukit/libfs/src/dosfs/msdos.h
@@ -252,9 +252,9 @@ int msdos_rename(
   size_t new_namelen
 );
 
-void msdos_lock(rtems_filesystem_mount_table_entry_t *mt_entry);
+void msdos_lock(const rtems_filesystem_mount_table_entry_t *mt_entry);
 
-void msdos_unlock(rtems_filesystem_mount_table_entry_t *mt_entry);
+void msdos_unlock(const rtems_filesystem_mount_table_entry_t *mt_entry);
 
 int msdos_initialize_support(
   rtems_filesystem_mount_table_entry_t    *temp_mt_entry,
diff --git a/cpukit/libfs/src/dosfs/msdos_init.c b/cpukit/libfs/src/dosfs/msdos_init.c
index 589ba1c..544fef4 100644
--- a/cpukit/libfs/src/dosfs/msdos_init.c
+++ b/cpukit/libfs/src/dosfs/msdos_init.c
@@ -51,7 +51,7 @@ const rtems_filesystem_operations_table  msdos_ops = {
   .statvfs_h      =  rtems_filesystem_default_statvfs
 };
 
-void msdos_lock(rtems_filesystem_mount_table_entry_t *mt_entry)
+void msdos_lock(const rtems_filesystem_mount_table_entry_t *mt_entry)
 {
   msdos_fs_info_t *fs_info = mt_entry->fs_info;
   rtems_status_code sc = rtems_semaphore_obtain(
@@ -64,7 +64,7 @@ void msdos_lock(rtems_filesystem_mount_table_entry_t *mt_entry)
   }
 }
 
-void msdos_unlock(rtems_filesystem_mount_table_entry_t *mt_entry)
+void msdos_unlock(const rtems_filesystem_mount_table_entry_t *mt_entry)
 {
   msdos_fs_info_t *fs_info = mt_entry->fs_info;
   rtems_status_code sc = rtems_semaphore_release(fs_info->vol_sema);
diff --git a/cpukit/libfs/src/nfsclient/src/nfs.c b/cpukit/libfs/src/nfsclient/src/nfs.c
index 95613c0..0f33cf3 100644
--- a/cpukit/libfs/src/nfsclient/src/nfs.c
+++ b/cpukit/libfs/src/nfsclient/src/nfs.c
@@ -2086,11 +2086,11 @@ static int nfs_rename(
 	return rv;
 }
 
-static void nfs_lock(rtems_filesystem_mount_table_entry_t *mt_entry)
+static void nfs_lock(const rtems_filesystem_mount_table_entry_t *mt_entry)
 {
 }
 
-static void nfs_unlock(rtems_filesystem_mount_table_entry_t *mt_entry)
+static void nfs_unlock(const rtems_filesystem_mount_table_entry_t *mt_entry)
 {
 }
 
diff --git a/cpukit/libfs/src/rfs/rtems-rfs-rtems.c b/cpukit/libfs/src/rfs/rtems-rfs-rtems.c
index 6f6d328..9a245f5 100644
--- a/cpukit/libfs/src/rfs/rtems-rfs-rtems.c
+++ b/cpukit/libfs/src/rfs/rtems-rfs-rtems.c
@@ -73,7 +73,9 @@ rtems_rfs_rtems_node_type_by_inode (rtems_rfs_inode_handle* inode)
 }
 
 static void
-rtems_rfs_rtems_lock_by_mt_entry (rtems_filesystem_mount_table_entry_t *mt_entry)
+rtems_rfs_rtems_lock_by_mt_entry (
+  const rtems_filesystem_mount_table_entry_t *mt_entry
+)
 {
   rtems_rfs_file_system* fs = mt_entry->fs_info;
 
@@ -81,7 +83,9 @@ rtems_rfs_rtems_lock_by_mt_entry (rtems_filesystem_mount_table_entry_t *mt_entry
 }
 
 static void
-rtems_rfs_rtems_unlock_by_mt_entry (rtems_filesystem_mount_table_entry_t *mt_entry)
+rtems_rfs_rtems_unlock_by_mt_entry (
+  const rtems_filesystem_mount_table_entry_t *mt_entry
+)
 {
   rtems_rfs_file_system* fs = mt_entry->fs_info;
 
-- 
1.6.4.2




More information about the devel mailing list