summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2011-07-21 12:03:26 +0000
committerSebastian Huber <sebastian.huber@embedded-brains.de>2011-07-21 12:03:26 +0000
commita2900a8b4b86ae6c81392a0c9247810132e2fdf5 (patch)
treefff691decb4b89e2221934933fbb931c4022ecf9 /cpukit
parent2011-07-21 Sebastian Huber <sebastian.huber@embedded-brains.de> (diff)
downloadrtems-a2900a8b4b86ae6c81392a0c9247810132e2fdf5.tar.bz2
2011-07-21 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libcsupport/include/rtems/libio_.h: Added rtems_filesystem_is_root_location(). * libfs/src/imfs/imfs_directory.c, libfs/src/imfs/imfs_eval.c, libfs/src/dosfs/msdos_dir.c, libfs/src/dosfs/msdos_eval.c: Use rtems_filesystem_is_root_location().
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/ChangeLog8
-rw-r--r--cpukit/libcsupport/include/rtems/libio_.h7
-rw-r--r--cpukit/libfs/src/dosfs/msdos_dir.c2
-rw-r--r--cpukit/libfs/src/dosfs/msdos_eval.c6
-rw-r--r--cpukit/libfs/src/imfs/imfs_directory.c2
-rw-r--r--cpukit/libfs/src/imfs/imfs_eval.c5
6 files changed, 21 insertions, 9 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index 7d9a36b0a7..a62cb4158d 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,5 +1,13 @@
2011-07-21 Sebastian Huber <sebastian.huber@embedded-brains.de>
+ * libcsupport/include/rtems/libio_.h: Added
+ rtems_filesystem_is_root_location().
+ * libfs/src/imfs/imfs_directory.c, libfs/src/imfs/imfs_eval.c,
+ libfs/src/dosfs/msdos_dir.c, libfs/src/dosfs/msdos_eval.c: Use
+ rtems_filesystem_is_root_location().
+
+2011-07-21 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
PR 1842/cpukit
* score/include/rtems/score/basedefs.h: Added RTEMS_STATIC_ASSERT().
diff --git a/cpukit/libcsupport/include/rtems/libio_.h b/cpukit/libcsupport/include/rtems/libio_.h
index f929669359..e9a7dd3cb8 100644
--- a/cpukit/libcsupport/include/rtems/libio_.h
+++ b/cpukit/libcsupport/include/rtems/libio_.h
@@ -238,6 +238,13 @@ void rtems_filesystem_get_sym_start_loc(const char *path,
int *index,
rtems_filesystem_location_info_t *loc);
+static inline bool rtems_filesystem_is_root_location(
+ const rtems_filesystem_location_info_t *loc
+)
+{
+ return loc->mt_entry->mt_fs_root.node_access == loc->node_access;
+}
+
#ifdef __cplusplus
}
#endif
diff --git a/cpukit/libfs/src/dosfs/msdos_dir.c b/cpukit/libfs/src/dosfs/msdos_dir.c
index 7e6bcf3db6..ee699aac43 100644
--- a/cpukit/libfs/src/dosfs/msdos_dir.c
+++ b/cpukit/libfs/src/dosfs/msdos_dir.c
@@ -679,7 +679,7 @@ msdos_dir_rmnod(rtems_filesystem_location_info_t *parent_pathloc,
/*
* You cannot remove the file system root node.
*/
- if (pathloc->mt_entry->mt_fs_root.node_access == pathloc->node_access)
+ if (rtems_filesystem_is_root_location(pathloc))
{
rtems_semaphore_release(fs_info->vol_sema);
rtems_set_errno_and_return_minus_one(EBUSY);
diff --git a/cpukit/libfs/src/dosfs/msdos_eval.c b/cpukit/libfs/src/dosfs/msdos_eval.c
index c128be8ff5..9b5e0c835d 100644
--- a/cpukit/libfs/src/dosfs/msdos_eval.c
+++ b/cpukit/libfs/src/dosfs/msdos_eval.c
@@ -128,8 +128,7 @@ msdos_eval_path(
/*
* Am I at the root of this mounted filesystem?
*/
- if (pathloc->node_access ==
- pathloc->mt_entry->mt_fs_root.node_access)
+ if (rtems_filesystem_is_root_location(pathloc))
{
/*
* Am I at the root of all filesystems?
@@ -310,8 +309,7 @@ msdos_eval4make(
/*
* Am I at the root of this mounted filesystem?
*/
- if (pathloc->node_access ==
- pathloc->mt_entry->mt_fs_root.node_access)
+ if (rtems_filesystem_is_root_location(pathloc))
{
/*
* Am I at the root of all filesystems?
diff --git a/cpukit/libfs/src/imfs/imfs_directory.c b/cpukit/libfs/src/imfs/imfs_directory.c
index 46ff335e59..54f8a4e4cd 100644
--- a/cpukit/libfs/src/imfs/imfs_directory.c
+++ b/cpukit/libfs/src/imfs/imfs_directory.c
@@ -300,7 +300,7 @@ int imfs_dir_rmnod(
* You cannot remove the file system root node.
*/
- if ( pathloc->mt_entry->mt_fs_root.node_access == pathloc->node_access )
+ if ( rtems_filesystem_is_root_location(pathloc) )
rtems_set_errno_and_return_minus_one( EBUSY );
/*
diff --git a/cpukit/libfs/src/imfs/imfs_eval.c b/cpukit/libfs/src/imfs/imfs_eval.c
index 477c09c935..b1f11b672f 100644
--- a/cpukit/libfs/src/imfs/imfs_eval.c
+++ b/cpukit/libfs/src/imfs/imfs_eval.c
@@ -346,7 +346,7 @@ int IMFS_evaluate_for_make(
* Am I at the root of this mounted filesystem?
*/
- if (pathloc->node_access == pathloc->mt_entry->mt_fs_root.node_access){
+ if ( rtems_filesystem_is_root_location( pathloc ) ) {
/*
* Am I at the root of all filesystems?
@@ -544,8 +544,7 @@ int IMFS_eval_path(
* Am I at the root of this mounted filesystem?
*/
- if (pathloc->node_access ==
- pathloc->mt_entry->mt_fs_root.node_access) {
+ if ( rtems_filesystem_is_root_location( pathloc ) ) {
/*
* Am I at the root of all filesystems?